void DeleteConfigIfExist(long goodsID, IDmoSession session) { var deleteDom = new DQDeleteDom(typeof(ChengPinToBanChengPinConfig)); deleteDom.Where.Conditions.Add(DQCondition.EQ("Goods_ID", goodsID)); session.ExecuteNonQuery(deleteDom); }
void DeleteConfigIfExist(long goodsID, IDmoSession session) { var deleteDom = new DQDeleteDom(typeof(GoodsReferencePrice)); deleteDom.Where.Conditions.Add(DQCondition.EQ("Goods_ID", goodsID)); session.ExecuteNonQuery(deleteDom); }
private static WorkShopPackBill GetBillByChaCarBarCode(IDmoSession session, string charBarCode) { var query = new DmoQuery(typeof(WorkShopPackBill)); query.Where.Conditions.Add(DQCondition.EQ("ChaCarBarCode", charBarCode)); var res = (WorkShopPackBill)session.ExecuteScalar(query); return(res); }
static long?GetProductIdByName(IDmoSession session, string name) { var query = new DQueryDom(new JoinAlias(typeof(ProductPlan))); query.Where.Conditions.Add(DQCondition.EQ("PlanNumber", name)); query.Where.Conditions.Add(DQCondition.GreaterThanOrEqual("BillState", 20)); query.Columns.Add(DQSelectColumn.Field("ID")); return(query.EExecuteScalar <long?>(session)); }
private static Tuple <long?, long?> GetCalculateCatalogIDByName(IDmoSession session, string name) { var query = new DQueryDom(new JoinAlias(typeof(CalculateGoods))); query.Where.Conditions.Add(DQCondition.EQ("Name", name)); query.Columns.Add(DQSelectColumn.Field("CalculateCatalog_ID")); query.Columns.Add(DQSelectColumn.Field("ID")); query.Where.Conditions.Add(DQCondition.EQ("Stopped", false)); return(query.EExecuteScalar <long?, long?>(session)); }
public static long?GetCurrentBindingEmployeeID(IDmoSession session) { if (BLContext.User.RoleSchema != B3FrameworksConsts.RoleSchemas.employee) { throw new Exception("当前用户不是员工类型"); } var query = new DQueryDom(new JoinAlias(typeof(User_Employee))); query.Where.Conditions.Add(DQCondition.EQ("User_ID", BLContext.User.ID)); query.Columns.Add(DQSelectColumn.Field("Employee_ID")); var result = (long?)query.EExecuteScalar(session); return(result); }
private static ClientGoodsSet FromProductNotice(IDmoSession session) { var client = new ClientGoodsSet(); client.Name = "from生产通知单";//固定值 var main = new JoinAlias(typeof(ProductNotice)); var detail = new JoinAlias(typeof(ProductNotice_Detail)); var goods = new JoinAlias(typeof(ButcheryGoods)); var query = new DQueryDom(main); query.From.AddJoin(JoinType.Left, new DQDmoSource(detail), DQCondition.EQ(main, "ID", detail, "ProductNotice_ID")); query.From.AddJoin(JoinType.Left, new DQDmoSource(goods), DQCondition.EQ(detail, "Goods_ID", goods, "ID")); query.Where.Conditions.Add(DQCondition.GreaterThanOrEqual(main, "BillState", 20)); query.Where.Conditions.Add(DQCondition.GreaterThanOrEqual(detail, "DeliveryDate", DateTime.Today.AddDays(-5))); query.Columns.Add(DQSelectColumn.Field("Goods_ID", detail)); query.Columns.Add(DQSelectColumn.Field("Goods_Name", detail)); query.Columns.Add(DQSelectColumn.Field("DeliveryDate", detail)); query.Columns.Add(DQSelectColumn.Field("GoodsProperty_ID", goods)); query.Columns.Add(DQSelectColumn.Field("GoodsProperty_Name", goods)); query.Columns.Add(DQSelectColumn.Field("MainUnitRatio", goods)); query.Columns.Add(DQSelectColumn.Field("Spell", goods)); query.Columns.Add(DQSelectColumn.Field("Spec", goods)); query.Columns.Add(DQSelectColumn.Field("Code", goods)); query.Columns.Add(DQSelectColumn.Field("SecondUnitII_MainUnitRatio", goods)); query.Columns.Add(DQSelectColumn.Field("StandardSecondNumber", goods)); using (var reader = session.ExecuteReader(query)) { while (reader.Read()) { var clientDe = new ClientGoodsSet_Detail(); clientDe.Goods_ID = (long)reader[0]; clientDe.Goods_Name = (string)reader[1]; clientDe.CompletedDate = (DateTime?)reader[2]; clientDe.GoodsProperty_ID = (long)reader[3]; clientDe.GoodsProperty_Name = (string)reader[4]; clientDe.Goods_MainUnitRatio = (Money <decimal>?)reader[5]; clientDe.Goods_Spell = (string)reader[6]; clientDe.Goods_Spec = (string)reader[7]; clientDe.Goods_Code = (string)reader[8]; clientDe.Goods_SecondUnitII_MainUnitRatio = (Money <decimal>?)reader[9]; clientDe.Goods_StandardSecondNumber = (Money <decimal>?)reader[10]; client.Details.Add(clientDe); } } return(client); }
static void SetEmployeeDepartment(FrozenInStore dmo, IDmoSession session) { var employeeId = GetCurrentBindingEmployeeID(session); dmo.Employee_ID = employeeId; var query = new DQueryDom(new JoinAlias(typeof(Employee))); query.Where.Conditions.Add(DQCondition.EQ("ID", employeeId)); query.Columns.Add(DQSelectColumn.Field("Department_ID")); using (var reader = session.ExecuteReader(query)) { if (reader.Read()) { var depId = (long?)reader[0] ?? 0; dmo.Department_ID = depId; } } }
static long?GetGoodsIdByName(IDmoSession session, string name) { var firstQuery = new DQueryDom(new JoinAlias(typeof(CalculateGoods))); firstQuery.Columns.Add(DQSelectColumn.Field("Goods_ID")); firstQuery.Where.Conditions.Add(DQCondition.EQ("Name", name)); firstQuery.Where.Conditions.Add(DQCondition.EQ("Stopped", false)); var goodsID = firstQuery.EExecuteScalar <long?>(session); if (goodsID == null || goodsID == 0) { var query = new DQueryDom(new JoinAlias(typeof(Goods))); query.Where.Conditions.Add(DQCondition.EQ("Name", name)); query.Columns.Add(DQSelectColumn.Field("ID")); goodsID = query.EExecuteScalar <long?>(session); } return(goodsID); }