當前位置: 首頁>>代碼示例>>C#>>正文


C# imp.MRPDbContext類代碼示例

本文整理匯總了C#中sct.svc.mrp.imp.MRPDbContext的典型用法代碼示例。如果您正苦於以下問題:C# MRPDbContext類的具體用法?C# MRPDbContext怎麽用?C# MRPDbContext使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MRPDbContext類屬於sct.svc.mrp.imp命名空間,在下文中一共展示了MRPDbContext類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Create

 public virtual OperationResult Create(MaterialPurchaseItemInfo info)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失敗,請稍後重試!");
     using (var DbContext = new MRPDbContext())
     {
       MaterialPurchaseItem entity = new MaterialPurchaseItem();
       DESwap.MaterialPurchaseItemDTE(info, entity);
       MaterialPurchaseItemRpt.Insert(DbContext, entity);
       DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
開發者ID:liurongjin,項目名稱:frame,代碼行數:14,代碼來源:MaterialPurchaseItemBaseService.cs

示例2: Create

 public virtual OperationResult Create(GatherBillInfo info)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失敗,請稍後重試!");
     using (var DbContext = new MRPDbContext())
     {
       GatherBill entity = new GatherBill();
       DESwap.GatherBillDTE(info, entity);
       GatherBillRpt.Insert(DbContext, entity);
       DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
開發者ID:liurongjin,項目名稱:frame,代碼行數:14,代碼來源:GatherBillBaseService.cs

示例3: Create

 public virtual OperationResult Create(WareHouseInfo info)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失敗,請稍後重試!");
     using (var DbContext = new MRPDbContext())
     {
       WareHouse entity = new WareHouse();
       DESwap.WareHouseDTE(info, entity);
       WareHouseRpt.Insert(DbContext, entity);
       DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
開發者ID:liurongjin,項目名稱:frame,代碼行數:14,代碼來源:WareHouseBaseService.cs

示例4: Create

 public virtual OperationResult Create(ProductWareStockInfo info)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失敗,請稍後重試!");
     using (var DbContext = new MRPDbContext())
     {
       ProductWareStock entity = new ProductWareStock();
       DESwap.ProductWareStockDTE(info, entity);
       ProductWareStockRpt.Insert(DbContext, entity);
       DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
開發者ID:liurongjin,項目名稱:frame,代碼行數:14,代碼來源:ProductWareStockBaseService.cs

示例5: Create

 public virtual OperationResult Create(IEnumerable<ProductCatalogInfo> infoList)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失敗,請稍後重試!");
     List<ProductCatalog> eList = new List<ProductCatalog>();
     infoList.ForEach(x =>
     {
         ProductCatalog entity = new ProductCatalog();
         DESwap. ProductCatalogDTE(x, entity);
         eList.Add(entity);
     });
     using (var DbContext = new MRPDbContext())
     {
     ProductCatalogRpt.Insert(DbContext, eList);
     DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
開發者ID:liurongjin,項目名稱:frame,代碼行數:19,代碼來源:ProductCatalogBaseService.cs

示例6: Load

 public virtual ProductCatalogInfo Load(string key)
 {
     ProductCatalogInfo info = new ProductCatalogInfo();
     using (var DbContext = new MRPDbContext())
     {
     ProductCatalog entity = ProductCatalogRpt.Get(DbContext, key);
     DESwap.ProductCatalogETD(entity,info);
     }
     return info;
 }
開發者ID:liurongjin,項目名稱:frame,代碼行數:10,代碼來源:ProductCatalogBaseService.cs

示例7: Load

 public virtual WareHouseInfo Load(string key)
 {
     WareHouseInfo info = new WareHouseInfo();
     using (var DbContext = new MRPDbContext())
     {
     WareHouse entity = WareHouseRpt.Get(DbContext, key);
     DESwap.WareHouseETD(entity,info);
     }
     return info;
 }
開發者ID:liurongjin,項目名稱:frame,代碼行數:10,代碼來源:WareHouseBaseService.cs

示例8: Modify

 public virtual OperationResult Modify(IEnumerable<ManufacturePlanInfo> infoList)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失敗,請稍後重試!");
     List<ManufacturePlan> eList = new List<ManufacturePlan>();
     infoList.ForEach(x =>
     {
         ManufacturePlan entity = new ManufacturePlan();
         DESwap. ManufacturePlanDTE(x, entity);
         eList.Add(entity);
     });
     using (var DbContext = new MRPDbContext())
     {
     ManufacturePlanRpt.Update(DbContext, eList);
     DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
開發者ID:liurongjin,項目名稱:frame,代碼行數:19,代碼來源:ManufacturePlanBaseService.cs

示例9: Load

 public virtual ManufacturePlanInfo Load(string key)
 {
     ManufacturePlanInfo info = new ManufacturePlanInfo();
     using (var DbContext = new MRPDbContext())
     {
     ManufacturePlan entity = ManufacturePlanRpt.Get(DbContext, key);
     DESwap.ManufacturePlanETD(entity,info);
     }
     return info;
 }
開發者ID:liurongjin,項目名稱:frame,代碼行數:10,代碼來源:ManufacturePlanBaseService.cs

示例10: ListByCondition

        public PageResult<ProductInfo> ListByCondition(NameValueCollection searchCondtionCollection, NameValueCollection sortCollection, int pageNumber, int pageSize)
        {
            PageResult<ProductInfo> result = new PageResult<ProductInfo>();
            int skip = (pageNumber - 1) * pageSize;
            int take = pageSize;
            List<ProductInfo> list = null;

            using (var DbContext = new MRPDbContext())
            {
                var query = from i in DbContext.Product
                            join p in DbContext.ProductCatalog on i.ProductCatalogId equals p.Id
                            select new ProductInfo()
                            {
                                Id = i.Id,
                                ProductCode = i.ProductCode,
                                ProductName = i.ProductName,
                                ProductCatalogName = p.ProductCatalogName,
                                ProductCatalogId = i.ProductCatalogId,
                                ImageUrl = i.ImageUrl,
                                SearchKey = i.SearchKey,
                                Special = i.Special,
                                Size = i.Size,
                                MinStock = i.MinStock,
                                Stock = i.Stock,
                                MaxStock = i.MaxStock,
                                Texture = i.Texture,
                                Color = i.Color,
                                UnitId = i.UnitId,
                                SYS_IsValid = i.SYS_IsValid,
                                SYS_OrderSeq = i.SYS_OrderSeq,
                                SYS_AppId = i.SYS_AppId,
                                SYS_StaffId = i.SYS_StaffId,
                                SYS_StationId = i.SYS_StationId,
                                SYS_DepartmentId = i.SYS_DepartmentId,
                                SYS_CompanyId = i.SYS_CompanyId,
                                SYS_CreateTime = i.SYS_CreateTime
                            };

                #region 條件
                foreach (string key in searchCondtionCollection)
                {
                    string condition = searchCondtionCollection[key];
                    switch (key.ToLower())
                    {
                        case "productname":
                            query = query.Where(x => x.ProductName.Contains(condition));
                            break;
                        case "productcatalogid":
                            query = query.Where(x => x.ProductCatalogId.Equals(condition));
                            break;
                        case "searchkey":
                            query = query.Where(x => x.SearchKey.Equals(condition));
                            break;
                        case "isvalid":
                            int value = Convert.ToInt32(condition);
                            query = query.Where(x => x.SYS_IsValid.Equals(value));
                            break;
                        default:
                            break;
                    }
                }
                #endregion

                result.TotalRecords = query.Count();

                #region 排序
                foreach (string sort in sortCollection)
                {
                    string direct = sortCollection[sort];
                    switch (sort.ToLower())
                    {
                        case "createtime":
                            if (direct.ToLower().Equals("asc"))
                            {
                                query = query.OrderBy(x => new { x.SYS_CreateTime }).Skip(skip).Take(take);
                            }
                            else
                            {
                                query = query.OrderByDescending(x => new { x.SYS_CreateTime }).Skip(skip).Take(take);
                            }
                            break;
                        case "productname":
                            if (direct.ToLower().Equals("asc"))
                            {
                                query = query.OrderBy(x => x.ProductName).Skip(skip).Take(take);
                            }
                            else
                            {
                                query = query.OrderByDescending(x => x.ProductName).Skip(skip).Take(take);
                            }
                            break;
                        default:
                            query = query.OrderByDescending(x => new { x.SYS_OrderSeq }).Skip(skip).Take(take);
                            break;
                    }
                }
                #endregion
                list = query.ToList();
            }

//.........這裏部分代碼省略.........
開發者ID:liurongjin,項目名稱:frame,代碼行數:101,代碼來源:ProductService.cs

示例11: Load

 public virtual ProductOrderItemInfo Load(string key)
 {
     ProductOrderItemInfo info = new ProductOrderItemInfo();
     using (var DbContext = new MRPDbContext())
     {
     ProductOrderItem entity = ProductOrderItemRpt.Get(DbContext, key);
     DESwap.ProductOrderItemETD(entity,info);
     }
     return info;
 }
開發者ID:liurongjin,項目名稱:frame,代碼行數:10,代碼來源:ProductOrderItemBaseService.cs

示例12: ListAllByCondition

        public virtual List<MaterialPurchaseItemInfo> ListAllByCondition(NameValueCollection searchCondtionCollection, NameValueCollection sortCollection)
        {
            List<MaterialPurchaseItem> list = null;

            using (var DbContext = new MRPDbContext())
            {
            var query = from i in DbContext.MaterialPurchaseItem
                        select i;

            #region 條件
            foreach (string key in searchCondtionCollection)
            {
                string condition = searchCondtionCollection[key];
                switch (key.ToLower())
                {
                    case "isvalid":
                        int value = Convert.ToInt32(condition);
                        query = query.Where(x => x.SYS_IsValid.Equals(value));
                        break;
                    default:
                        break;
                }
            }
            #endregion

            #region 排序
            foreach (string sort in sortCollection)
            {
                string direct = string.Empty;
                switch (sort.ToLower())
                {
                    case "createtime":
                        if (direct.ToLower().Equals("asc"))
                        {
                            query = query.OrderBy(x => new { x.SYS_CreateTime });
                        }
                        else
                        {
                            query = query.OrderByDescending(x => new { x.SYS_CreateTime });
                        }
                        break;
                    default:
                        query = query.OrderByDescending(x => new { x.SYS_OrderSeq });
                        break;
                }
            }
               list = query.ToList();
            }
            #endregion
            #region linq to entity
            List<MaterialPurchaseItemInfo> ilist = new List<MaterialPurchaseItemInfo>();
            list.ForEach(x =>
            {
                MaterialPurchaseItemInfo info = new MaterialPurchaseItemInfo();
                DESwap.MaterialPurchaseItemETD(x, info);
                ilist.Add(info);
            });
            #endregion

            return ilist;;
        }
開發者ID:liurongjin,項目名稱:frame,代碼行數:61,代碼來源:MaterialPurchaseItemBaseService.cs

示例13: Load

 public virtual GatherBillInfo Load(string key)
 {
     GatherBillInfo info = new GatherBillInfo();
     using (var DbContext = new MRPDbContext())
     {
     GatherBill entity = GatherBillRpt.Get(DbContext, key);
     DESwap.GatherBillETD(entity,info);
     }
     return info;
 }
開發者ID:liurongjin,項目名稱:frame,代碼行數:10,代碼來源:GatherBillBaseService.cs

示例14: Remove

 public virtual OperationResult Remove(string key)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失敗,請稍後重試!");
     using (var DbContext = new MRPDbContext())
     {
     MaterialPurchaseItem entity = MaterialPurchaseItemRpt.Get(DbContext, key);
     MaterialPurchaseItemRpt.Delete(DbContext, entity);
     DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
開發者ID:liurongjin,項目名稱:frame,代碼行數:13,代碼來源:MaterialPurchaseItemBaseService.cs

示例15: Modify

 public virtual OperationResult Modify(IEnumerable<ProductWareStockInfo> infoList)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失敗,請稍後重試!");
     List<ProductWareStock> eList = new List<ProductWareStock>();
     infoList.ForEach(x =>
     {
         ProductWareStock entity = new ProductWareStock();
         DESwap. ProductWareStockDTE(x, entity);
         eList.Add(entity);
     });
     using (var DbContext = new MRPDbContext())
     {
     ProductWareStockRpt.Update(DbContext, eList);
     DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
開發者ID:liurongjin,項目名稱:frame,代碼行數:19,代碼來源:ProductWareStockBaseService.cs


注:本文中的sct.svc.mrp.imp.MRPDbContext類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。