private static IEnumerable <WordPair> SelectProductLinkTemplate(ChoiceBoxArgument argu) { var main = new JoinAlias(typeof(ProductLinkTemplate)); var query = new DQueryDom(main); query.Columns.Add(DQSelectColumn.Field("ID")); query.Columns.Add(DQSelectColumn.Field("Name")); if (!string.IsNullOrEmpty(argu.CodeArgument)) { var accDep = argu.CodeArgument.Split(new[] { '|' }).ToArray(); query.Where.Conditions.Add(DQCondition.EQ("AccountingUnit_ID", accDep[0])); var id = GetDepartment(Convert.ToInt64(accDep[1])); var field = string.Format("Department_TreeDeep{0}ID", id); var deptCondition = B3ButcheryUtil.部门或上级部门条件(Convert.ToInt64(accDep[1])); query.Where.Conditions.Add(DQCondition.Or(DQCondition.EQ(main, field, accDep[1]), deptCondition)); } if (!string.IsNullOrEmpty(argu.InputArgument)) { IList <IDQExpression> conditions = new List <IDQExpression>(); conditions.Add(DQCondition.Like("Name", argu.InputArgument)); conditions.Add(DQCondition.Like("Spell", argu.InputArgument)); query.Where.Conditions.Add(DQCondition.Or(conditions)); } return(query.EExecuteList <long, string>().Select(x => new WordPair(x.Item2, x.Item1.ToString(CultureInfo.InvariantCulture)))); }
public static long PdaInsertAndCheck(FrozenInStore dmo) { if (!BLContext.User.IsInRole("B3Butchery.产出单.新建")) { return(0); } if (!BLContext.User.IsInRole("B3Butchery.产出单.审核")) { return(-1); } SetSecondNumberByNumber(dmo); using (var context = new TransactionContext()) { var bl = BIFactory.Create <IFrozenInStoreBL>(context.Session); dmo.Date = dmo.Date ?? DateTime.Today; dmo.Employee_ID = B3ButcheryUtil.GetCurrentBindingEmployeeID(context.Session); bl.InitNewDmo(dmo); bl.Insert(dmo); bl.Check(dmo); context.Commit(); } return(dmo.ID); }
static Tuple <long?, string> GetProductPlan(long?nullable1, long?nullable2, DateTime?nullable3) { var query = new DQueryDom(new JoinAlias(typeof(ProductPlan))); query.Columns.Add(DQSelectColumn.Field("ID")); query.Columns.Add(DQSelectColumn.Field("PlanNumber")); query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("AccountingUnit_ID", nullable1), DQCondition.EQ("Date", nullable3), DQCondition.EQ("BillState", 单据状态.已审核))); query.Where.Conditions.Add(B3ButcheryUtil.部门或上级部门条件(nullable2 ?? 0)); return(query.EExecuteScalar <long?, string>()); }
public static List <GoodsInfoDto> GetFromProductPlanByDept(long departId) { if (departId == 0) { throw new Exception("员工档案上没有配置部门"); } JoinAlias mainJoinAlias; var query = GetPlanDquery(out mainJoinAlias); query.Where.Conditions.Add(B3ButcheryUtil.部门或上级部门条件(departId, mainJoinAlias)); return(GetListByDquery(query)); }
public static long PdaInsert(ProduceOutput dmo) { using (var context = new TransactionContext()) { var bl = BIFactory.Create <IProduceOutputBL>(context.Session); dmo.Time = DateTime.Today; dmo.IsHandsetSend = true; dmo.Employee_ID = B3ButcheryUtil.GetCurrentBindingEmployeeID(context.Session); // bl.InitNewDmo(dmo); 板块信息由手持机传入 bl.Insert(dmo); bl.Check(dmo); context.Commit(); } return(dmo.ID); }
public static long PdaInsertAndCheck(ProduceOutput dmo) { SetSecondNumberByNumber(dmo); using (var context = new TransactionContext()) { var bl = BIFactory.Create <IProduceOutputBL>(context.Session); dmo.Time = dmo.Time ?? DateTime.Today; dmo.Employee_ID = B3ButcheryUtil.GetCurrentBindingEmployeeID(context.Session); bl.InitNewDmo(dmo); bl.Insert(dmo); bl.Check(dmo); context.Commit(); } return(dmo.ID); }