예제 #1
0
        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);
        }
예제 #2
0
        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));
        }
예제 #3
0
        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);
        }
예제 #4
0
        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());
        }
예제 #5
0
        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);
        }