public static List <ProductInStoreWithDetailDto> GetListOnlyOneDetail(int pageIndex, int pageSize) { var list = new List <ProductInStoreWithDetailDto>(); var dmoQuery = new DmoQuery(typeof(ProductInStore)); dmoQuery.Range = new SelectRange(pageSize * pageIndex, pageSize); dmoQuery.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID", true)); dmoQuery.Where.Conditions.Add(DQCondition.EQ("Domain_ID", DomainContext.Current.ID)); var dmoList = dmoQuery.EExecuteList().Cast <ProductInStore>(); foreach (ProductInStore inStore in dmoList) { var dto = new ProductInStoreWithDetailDto(); dto.ID = inStore.ID; dto.Date = inStore.InStoreDate; dto.BillState = inStore.BillState.Value; dto.BillStateStr = inStore.BillState.Name; var detail = inStore.Details.FirstOrDefault(); if (detail != null) { dto.Goods_Name = detail.Goods_Name; dto.Goods_Spec = detail.Goods_Spec; dto.Number = detail.Number; dto.SecondNumber = detail.SecondNumber; list.Add(dto); } } return(list); }
public static string GetCalculateSpec() { var query = new DmoQuery(typeof(CalculateSpec)); query.Where.Conditions.Add(DQCondition.EQ("Stopped", false)); var list = query.EExecuteList().Cast <CalculateSpec>().ToList(); return(JsonConvert.SerializeObject(list)); }
public static string GetAllWorkShopCountConfigList() { var dmoquery = new DmoQuery(typeof(WorkShopCountConfig)); dmoquery.Where.Conditions.Add(DQCondition.EQ("Stopped", false)); var list = dmoquery.EExecuteList().Cast <WorkShopCountConfig>().ToList(); var jsonStr = JsonConvert.SerializeObject(list); //var jsonStr = serializer.Serialize(list); return(jsonStr); }
public static IList <ProductInStoreTemplate> GetProductInStoreTemplate(long[] id) { if (id.Length == 0) { return(new List <ProductInStoreTemplate>()); } var query = new DmoQuery(typeof(ProductInStoreTemplate)); query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID")); query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("ID"), id.Select(x => DQExpression.Value(x)).ToArray())); return(query.EExecuteList().Cast <ProductInStoreTemplate>().ToList()); }
public static string GetAllFrozenInStoreSetBillList(int billstate) { var dmoquery = new DmoQuery(typeof(FrozenInStoreSetBill)); dmoquery.Where.Conditions.Add(DQCondition.EQ("BillState", billstate)); var list = dmoquery.EExecuteList().Cast <FrozenInStoreSetBill>().ToList(); var jsonStr = JsonConvert.SerializeObject(list); //var jsonStr = serializer.Serialize(list); return(jsonStr); }