Browse Source

提交

master
wushukun 8 years ago
parent
commit
87f40913aa
1 changed files with 32 additions and 0 deletions
  1. +32
    -0
      BWP.B3_YunKen/TypeIoc/CustomerApplyBeforeSaveTypeIoc.cs

+ 32
- 0
BWP.B3_YunKen/TypeIoc/CustomerApplyBeforeSaveTypeIoc.cs View File

@ -0,0 +1,32 @@
using BWP.B3Frameworks;
using BWP.B3Sale.BL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BWP.B3Sale.BO;
using Forks.EnterpriseServices.BusinessInterfaces;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.EnterpriseServices.DomainObjects2;
namespace BWP.B3_YunKen.TypeIoc
{
[TypeIOC(typeof(CustomerApplyBL), typeof(CustomerApplyBL.BaseBLIOCs.BeforeSave))]
class CustomerApplyBeforeSaveTypeIoc : CustomerApplyBL.BaseBLIOCs.BeforeSave
{
public void Invoke(IDmoContext context, CustomerApply dmo)
{
var alias = new JoinAlias("cus", typeof(Customer));
var query = new DQueryDom(alias);
query.Where.Conditions.Add(DQCondition.EQ("Stopped", false));
query.Where.Conditions.Add(DQCondition.EQ("Name", dmo.Name));
query.Columns.Add(DQSelectColumn.Field("ID"));
var re = context.Session.ExecuteScalar(query);
if (re != null)
{
throw new Exception(string.Format("客户名称{0}和客户档案中单据ID为{1}的一致", dmo.Name, re));
}
}
}
}

Loading…
Cancel
Save