You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

52 lines
1.7 KiB

using BWP.B3_YunKen.BO;
using BWP.B3Sale.BO;
using Forks.EnterpriseServices.BusinessInterfaces;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.EnterpriseServices.SqlDoms;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TSingSoft.WebPluginFramework.BIPlugins.BLEvents;
using TSingSoft.WebPluginFramework;
using BWP.B3Frameworks.Utils;
using BWP.B3Frameworks.BO;
namespace BWP.B3_YunKen.BLActions
{
public class SaleForecastEmpIsSame : IBLMethodAction
{
public string Description
{
get { return "【销售预报】若{创建人}关联的{员工}与{业务员}不一致,则提示错误"; }
}
public void Execute(IDmoContext context, object dmo, object parameter)
{
var forecast = dmo as SaleForecast;
if (parameter != null) {
var list = parameter.ToString().Split(',').ToList();
if (list.Contains(BLContext.Current.User.Name)) {
return;
}
}
if (forecast.Employee_ID != null) {
var empId = InnerBLUtil.GetDmoProperty<User_Employee, long?>(context.Session, "Employee_ID", new Tuple<string, object>("User_ID", BLContext.Current.User.ID));
if (empId != null && empId != forecast.Employee_ID)
throw new ApplicationException("当前登录用户关联的员工与单据业务员不一致");
}
}
public IList<string> Features
{
get { return new List<string>(); }
}
public string Name
{
get { return "B3_YunKen.业务员一致性检查"; }
}
}
}