当前位置: 首页>>代码示例>>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;未经允许,请勿转载。