|
|
|
@ -0,0 +1,82 @@ |
|
|
|
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 TSingSoft.WebPluginFramework; |
|
|
|
using TSingSoft.WebPluginFramework.BIPlugins.BLEvents; |
|
|
|
|
|
|
|
namespace BWP.B3QingDaoWanFu.BLActions |
|
|
|
{ |
|
|
|
class SaleOrderCreateUpdateDepEmpBLAction: IBLMethodAction |
|
|
|
{ |
|
|
|
public void Execute(IDmoContext context, object dmo, object parameter) |
|
|
|
{ |
|
|
|
var order = dmo as Order; |
|
|
|
long? depid; |
|
|
|
long? empid; |
|
|
|
BLActionUtil.GetDepEmpByCustomer(context.Session,order.Customer_ID??0, out depid,out empid); |
|
|
|
if (depid != null) |
|
|
|
{ |
|
|
|
order.Department_ID = depid; |
|
|
|
} |
|
|
|
if (empid != null) |
|
|
|
{ |
|
|
|
order.Employee_ID = empid; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public string Name |
|
|
|
{ |
|
|
|
get { return "B3QingDaoWanFu.销售订单创建根据客户档案更新部门经办人"; } |
|
|
|
} |
|
|
|
public string Description |
|
|
|
{ |
|
|
|
get { return "销售订单创建根据客户档案更新部门经办人"; } |
|
|
|
} |
|
|
|
public IList<string> Features |
|
|
|
{ |
|
|
|
get { return new List<string>(); } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
class SaleOrderCheckUpdateDepEmpBLAction : IBLMethodAction |
|
|
|
{ |
|
|
|
public void Execute(IDmoContext context, object dmo, object parameter) |
|
|
|
{ |
|
|
|
var order = dmo as Order; |
|
|
|
long? depid; |
|
|
|
long? empid; |
|
|
|
BLActionUtil.GetDepEmpByCustomer(context.Session, order.Customer_ID ?? 0, out depid, out empid); |
|
|
|
if (depid.HasValue || empid.HasValue) |
|
|
|
{ |
|
|
|
var updateDom = new DQUpdateDom(typeof(Order)); |
|
|
|
if (depid.HasValue) |
|
|
|
{ |
|
|
|
updateDom.Columns.Add(new DQUpdateColumn("Department_ID", depid)); |
|
|
|
} |
|
|
|
if (empid.HasValue) |
|
|
|
{ |
|
|
|
updateDom.Columns.Add(new DQUpdateColumn("Employee_ID", empid)); |
|
|
|
} |
|
|
|
updateDom.Where.Conditions.Add(DQCondition.EQ("ID",order.ID)); |
|
|
|
context.Session.ExecuteNonQuery(updateDom); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public string Name |
|
|
|
{ |
|
|
|
get { return "B3QingDaoWanFu.销售订单审核根据客户档案更新部门经办人"; } |
|
|
|
} |
|
|
|
public string Description |
|
|
|
{ |
|
|
|
get { return "销售订单审核根据客户档案更新部门经办人"; } |
|
|
|
} |
|
|
|
public IList<string> Features |
|
|
|
{ |
|
|
|
get { return new List<string>(); } |
|
|
|
} |
|
|
|
} |
|
|
|
} |