public ActionResult SaveWareHouse(WareHouseInfo info)
        {
            OperationResult opr = new OperationResult(OperationResultType.Success);
            try
            {
                if (string.IsNullOrEmpty(info.Id))
                {
                    info.Id = System.Guid.NewGuid().ToString();
                    opr = WareHouseService.Create(info);
                }
                else
                {
                    opr = WareHouseService.Modify(info);

                }

                ViewBag.DicRegion = PublicMethod.ListAllRegionInfo(RegionService, null);

                ViewBag.PromptMsg = opr.Message;
            }
            catch (Exception err)
            {
                ViewBag.PromptMsg = err.Message;
            }

            return View("WareHouseForm", info);
        }
Example #2
0
        public override OperationResult Create(FacilityInfo info)
        {
            OperationResult result = new OperationResult(OperationResultType.Error, "操作失败,请稍后重试!");
            using (var DbContext = new UCDbContext())
            {
                Facility entity = new Facility();
                DESwap.FacilityDTE(info, entity);
                FacilityRpt.Insert(DbContext, entity);

                /*关联功能是否为空*/
                if (info.FacilityFunctionInfoList != null)
                {
                    /*****新增列表*********/
                    List<FacilityFunction> insertlist = new List<FacilityFunction>();
                    /*****删除列表*********/
                    List<FacilityFunction> deletelist = new List<FacilityFunction>();

                    /*原有列表*/
                    var existlist = (from i in DbContext.FacilityFunction
                                     where i.FacilityId.Equals(info.Id)
                                     select i).ToList();

                    /*************如果为选中且没有关联表id则为新增******************/
                    foreach (var ffinfo in info.FacilityFunctionInfoList)
                    {
                        if (string.IsNullOrEmpty(ffinfo.Id) && ffinfo.Selected)
                        {
                            /*************如果为选中且没有关联表id则为新增******************/
                            ffinfo.Id = System.Guid.NewGuid().ToString();
                            ffinfo.FacilityId = info.Id;
                            FacilityFunction facilityFunction = new FacilityFunction();
                            DESwap.FacilityFunctionDTE(ffinfo, facilityFunction);
                            insertlist.Add(facilityFunction);
                        }
                        else if (!string.IsNullOrEmpty(ffinfo.Id) && ffinfo.Selected == false)
                        {
                            /*************如果为未选中且有关联表id则为删除******************/
                            var facilityFunction = existlist.Where(x => x.Id.Equals(ffinfo.Id)).FirstOrDefault();
                            if (facilityFunction == null)
                            {
                                deletelist.Add(facilityFunction);
                            }
                        }
                    }

                    FacilityFunctionRpt.Insert(DbContext, insertlist);
                    FacilityFunctionRpt.Delete(DbContext, deletelist);
                }

                DbContext.SaveChanges();

                result.ResultType = OperationResultType.Success;
                result.Message = "操作成功!";
                return result;
            }
        }
Example #3
0
        public override OperationResult Create(StationInfo info)
        {
            OperationResult result = new OperationResult(OperationResultType.Error, "操作失败,请稍后重试!");
            using (var DbContext = new UCDbContext())
            {
                Station entity = new Station();
                DESwap.StationDTE(info, entity);
                StationRpt.Insert(DbContext, entity);

                /*关联角色是否为空*/
                if (info.StationRoleInfoList != null)
                {
                    /*****新增列表*********/
                    List<StationRole> insertlist = new List<StationRole>();
                    /*****删除列表*********/
                    List<StationRole> deletelist = new List<StationRole>();

                    /*原有列表*/
                    var existlist = (from i in DbContext.StationRole
                                     where i.StationId.Equals(info.Id)
                                     select i).ToList();

                    /*************如果为选中且没有关联表id则为新增******************/
                    foreach (var rfinfo in info.StationRoleInfoList)
                    {
                        if (string.IsNullOrEmpty(rfinfo.Id) && rfinfo.Selected)
                        {
                            /*************如果为选中且没有关联表id则为新增******************/
                            rfinfo.Id = System.Guid.NewGuid().ToString();
                            rfinfo.StationId = info.Id;
                            StationRole StationRole = new StationRole();
                            DESwap.StationRoleDTE(rfinfo, StationRole);
                            insertlist.Add(StationRole);
                        }
                        else if (!string.IsNullOrEmpty(rfinfo.Id) && rfinfo.Selected == false)
                        {
                            /*************如果为未选中且有关联表id则为删除******************/
                            var StationRole = existlist.Where(x => x.Id.Equals(rfinfo.Id)).FirstOrDefault();
                            if (StationRole == null)
                            {
                                deletelist.Add(StationRole);
                            }
                        }
                    }

                    StationRoleRpt.Insert(DbContext, insertlist);
                    StationRoleRpt.Delete(DbContext, deletelist);
                }
                DbContext.SaveChanges();

                result.ResultType = OperationResultType.Success;
                result.Message = "操作成功!";
                return result;
            }
        }
Example #4
0
 public virtual OperationResult Create(StationInfo info)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失败,请稍后重试!");
     using (var DbContext = new UCDbContext())
     {
       Station entity = new Station();
       DESwap.StationDTE(info, entity);
       StationRpt.Insert(DbContext, entity);
       DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
 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;
 }
Example #6
0
 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;
 }
 public virtual OperationResult Create(ArticleAnnexInfo info)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失败,请稍后重试!");
     using (var DbContext = new CmsDbContext())
     {
       ArticleAnnex entity = new ArticleAnnex();
       DESwap.ArticleAnnexDTE(info, entity);
       ArticleAnnexRpt.Insert(DbContext, entity);
       DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
 public virtual OperationResult Create(CompanyClientTypeInfo info)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失败,请稍后重试!");
     using (var DbContext = new UCDbContext())
     {
       CompanyClientType entity = new CompanyClientType();
       DESwap.CompanyClientTypeDTE(info, entity);
       CompanyClientTypeRpt.Insert(DbContext, entity);
       DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
 public virtual OperationResult Create(FriendLinkInfo info)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失败,请稍后重试!");
     using (var DbContext = new CmsDbContext())
     {
       FriendLink entity = new FriendLink();
       DESwap.FriendLinkDTE(info, entity);
       FriendLinkRpt.Insert(DbContext, entity);
       DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
 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;
 }
Example #11
0
 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;
 }
Example #12
0
 public virtual OperationResult Create(PlateNewsInfo info)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失败,请稍后重试!");
     using (var DbContext = new CmsDbContext())
     {
       PlateNews entity = new PlateNews();
       DESwap.PlateNewsDTE(info, entity);
       PlateNewsRpt.Insert(DbContext, entity);
       DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
Example #13
0
 public override OperationResult Create(AdviceInfo info)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失败,请稍后重试!");
     using (var DbContext = new CmsDbContext())
     {
         Advice entity = new Advice();
         DESwap.AdviceDTE(info, entity);
         /*需要设默认值*/
         entity.HandleTime = DateTime.Now;
         AdviceRpt.Insert(DbContext, entity);
         DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
 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;
 }
Example #15
0
 public virtual OperationResult Create(IEnumerable<WareHouseInfo> infoList)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失败,请稍后重试!");
     List<WareHouse> eList = new List<WareHouse>();
     infoList.ForEach(x =>
     {
         WareHouse entity = new WareHouse();
         DESwap. WareHouseDTE(x, entity);
         eList.Add(entity);
     });
     using (var DbContext = new MRPDbContext())
     {
     WareHouseRpt.Insert(DbContext, eList);
     DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
Example #16
0
 public virtual OperationResult Create(IEnumerable<FriendLinkInfo> infoList)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失败,请稍后重试!");
     List<FriendLink> eList = new List<FriendLink>();
     infoList.ForEach(x =>
     {
         FriendLink entity = new FriendLink();
         DESwap. FriendLinkDTE(x, entity);
         eList.Add(entity);
     });
     using (var DbContext = new CmsDbContext())
     {
     FriendLinkRpt.Insert(DbContext, eList);
     DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
 public virtual OperationResult Create(IEnumerable<ArticleAnnexInfo> infoList)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失败,请稍后重试!");
     List<ArticleAnnex> eList = new List<ArticleAnnex>();
     infoList.ForEach(x =>
     {
         ArticleAnnex entity = new ArticleAnnex();
         DESwap. ArticleAnnexDTE(x, entity);
         eList.Add(entity);
     });
     using (var DbContext = new CmsDbContext())
     {
     ArticleAnnexRpt.Insert(DbContext, eList);
     DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
Example #18
0
 public virtual OperationResult Create(IEnumerable<StationInfo> infoList)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失败,请稍后重试!");
     List<Station> eList = new List<Station>();
     infoList.ForEach(x =>
     {
         Station entity = new Station();
         DESwap. StationDTE(x, entity);
         eList.Add(entity);
     });
     using (var DbContext = new UCDbContext())
     {
     StationRpt.Insert(DbContext, eList);
     DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
 public virtual OperationResult Create(IEnumerable<MaterialPurchaseItemInfo> infoList)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失败,请稍后重试!");
     List<MaterialPurchaseItem> eList = new List<MaterialPurchaseItem>();
     infoList.ForEach(x =>
     {
         MaterialPurchaseItem entity = new MaterialPurchaseItem();
         DESwap. MaterialPurchaseItemDTE(x, entity);
         eList.Add(entity);
     });
     using (var DbContext = new MRPDbContext())
     {
     MaterialPurchaseItemRpt.Insert(DbContext, eList);
     DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
Example #20
0
        /// <summary>
        /// 用户登陆
        /// </summary>
        /// <param name="usercode">账号</param>
        /// <param name="password">密码</param>
        /// <returns></returns>
        public OperationResult Login(string usercode, string password)
        {
            OperationResult result = new OperationResult(OperationResultType.Error, "操作失败,请稍后重试!");
            using (var DbContext = new UCDbContext())
            {
                var infolist = (from i in DbContext.Staff
                                where i.UserCode.Equals(usercode)
                                select i).ToList();

                if (infolist != null && infolist.Count > 0)
                {
                    StaffInfo info = new StaffInfo();
                    DESwap.StaffETD(infolist[0], info);
                    /*加载用户对应的功能*/
                    if (info.Password == password)
                    {
                        var rolefacilitylist = (from ss in DbContext.StaffStation
                                                join sr in DbContext.StationRole on ss.StationId equals sr.StationId
                                                join rf in DbContext.RoleFacility on sr.RoleId equals rf.RoleId
                                                select rf).Distinct().ToList();
                        List<RoleFacilityInfo> ilist = new List<RoleFacilityInfo>();
                        rolefacilitylist.ForEach(x =>
                        {
                            RoleFacilityInfo rfInfo = new RoleFacilityInfo();
                            DESwap.RoleFacilityETD(x, rfInfo);
                            ilist.Add(rfInfo);
                        });
                        result.ResultType = OperationResultType.Success;
                        result.Message = "登陆成功!";
                        result.AppendData = ilist;
                    }
                    else
                    {
                        result.ResultType = OperationResultType.Warning;
                        result.Message = "用户账号或密码不正确!";
                    }
                }
                else
                {
                    result.ResultType = OperationResultType.Warning;
                    result.Message = "用户账号或密码不正确!";
                }
            }

            return result;
        }
 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;
 }
 public virtual OperationResult Remove(IEnumerable<string> keyList)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失败,请稍后重试!");
     List<ArticleAnnex> eList = new List<ArticleAnnex>();
     using (var DbContext = new CmsDbContext())
     {
     keyList.ForEach(x =>
     {
         ArticleAnnex entity = ArticleAnnexRpt.Get(DbContext, x);
         eList.Add(entity);
     });
     ArticleAnnexRpt.Delete(DbContext, eList);
     DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
 public virtual OperationResult Remove(string key)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失败,请稍后重试!");
     using (var DbContext = new CmsDbContext())
     {
     ArticleAnnex entity = ArticleAnnexRpt.Get(DbContext, key);
     ArticleAnnexRpt.Delete(DbContext, entity);
     DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
Example #24
0
        public ActionResult SaveFunction(FunctionInfo info)
        {
            OperationResult opr = new OperationResult(OperationResultType.Success);
            try
            {
                if (string.IsNullOrEmpty(info.Id))
                {
                    info.Id = System.Guid.NewGuid().ToString();
                    opr = FunctionService.Create(info);
                }
                else
                {
                    opr = FunctionService.Modify(info);

                }

                ViewBag.PromptMsg = opr.Message;
            }
            catch (Exception err)
            {
                ViewBag.PromptMsg = err.Message;
            }

            return View("FunctionForm", info);
        }
 public virtual OperationResult Remove(IEnumerable<string> keyList)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失败,请稍后重试!");
     List<MaterialPurchaseItem> eList = new List<MaterialPurchaseItem>();
     using (var DbContext = new MRPDbContext())
     {
     keyList.ForEach(x =>
     {
         MaterialPurchaseItem entity = MaterialPurchaseItemRpt.Get(DbContext, x);
         eList.Add(entity);
     });
     MaterialPurchaseItemRpt.Delete(DbContext, eList);
     DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
 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;
 }
Example #27
0
        public ActionResult SaveMenu(MenuInfo info)
        {
            OperationResult opr = new OperationResult(OperationResultType.Success);
            try
            {
                if (string.IsNullOrEmpty(info.Id))
                {
                    info.Id = System.Guid.NewGuid().ToString();
                    opr = MenuService.Create(info);
                }
                else
                {
                    opr = MenuService.Modify(info);

                }
                ViewBag.DicMenu = PublicMethod.ListAllMenuInfo(MenuService, info.Id);
                ViewBag.DicApp = PublicMethod.ListAllAppInfo(AppService, null);

                ViewBag.PromptMsg = opr.Message;
            }
            catch (Exception err)
            {
                ViewBag.PromptMsg = err.Message;
            }

            return View("MenuForm", info);
        }
Example #28
0
        public override OperationResult Modify(ArticleInfo info)
        {
            OperationResult result = new OperationResult(OperationResultType.Error, "操作失败,请稍后重试!");
            using (var DbContext = new CmsDbContext())
            {
                /*******保存资讯正文摘要*******/
                Article article = ArticleRpt.Get(DbContext, info.Id);
                DESwap.ArticleDTE(info, article);
                ArticleRpt.Update(DbContext, article);

                if (info.ArticleType == (int)sct.dto.cms.EnumSet.ArticleType.Article)
                {
                    /*******保存正文*******/
                    ArticleDetail detail = ArticleDetailRpt.Get(DbContext, info.ArticleDetail.Id);
                    DESwap.ArticleDetailDTE(info.ArticleDetail, detail);
                    ArticleDetailRpt.Update(DbContext, detail);
                }
                else if (info.ArticleType == (int)sct.dto.cms.EnumSet.ArticleType.Picture)
                {
                    /*****新增列表*********/
                    List<ArticleImage> imageinsertlist = new List<ArticleImage>();
                    /*****例改列表*********/
                    List<ArticleImage> imageupdatelist = new List<ArticleImage>();
                    /*****删除列表*********/
                    List<ArticleImage> imagedeletelist = new List<ArticleImage>();

                    var imageexistlist = (from i in DbContext.ArticleImage
                                          where i.ArticleId.Equals(article.Id)
                                          select i).ToList();

                    /*************新增或修改******************/
                    foreach (var imageinfo in info.ArticleImageList)
                    {
                        if (string.IsNullOrEmpty(imageinfo.Id))
                        {
                            /*************新增************************/
                            imageinfo.Id = System.Guid.NewGuid().ToString();
                            imageinfo.ArticleId = info.Id;
                            ArticleImage image = new ArticleImage();
                            DESwap.ArticleImageDTE(imageinfo, image);
                            imageinsertlist.Add(image);
                        }
                        else
                        {
                            /****************修改********************/
                            var image = imageexistlist.Where(x => x.Id.Equals(imageinfo.Id)).FirstOrDefault();
                            if (image != null)
                            {
                                //ArticleImage image = ArticleImageRpt.Get(DbContext, imageinfo.Id);
                                DESwap.ArticleImageDTE(imageinfo, image);
                                imageupdatelist.Add(image);
                            }
                            else
                            {
                                imageinfo.Id = System.Guid.NewGuid().ToString();
                                imageinfo.ArticleId = info.Id;
                                image = new ArticleImage();
                                DESwap.ArticleImageDTE(imageinfo, image);
                                imageinsertlist.Add(image);
                            }
                        }
                    }

                    /*************删除******************/
                    foreach (var imageexist in imageexistlist)
                    {
                        var image = info.ArticleImageList.Where(x => x.Id.Equals(imageexist.Id)).FirstOrDefault();
                        if (image == null)
                        {
                            imagedeletelist.Add(imageexist);
                        }
                    }
                    ArticleImageRpt.Insert(DbContext, imageinsertlist);
                    ArticleImageRpt.Update(DbContext, imageupdatelist);
                    ArticleImageRpt.Delete(DbContext, imagedeletelist);

                }
                else if (info.ArticleType == (int)sct.dto.cms.EnumSet.ArticleType.Video)
                {
                    /*******保存视频*******/
                    ArticleVideo video = ArticleVideoRpt.Get(DbContext, info.ArticleVideo.Id);
                    DESwap.ArticleVideoDTE(info.ArticleVideo, video);
                    ArticleVideoRpt.Update(DbContext, video);
                }
                /*异常数据未处理*/

                DbContext.SaveChanges();
            }
            result.ResultType = OperationResultType.Success;
            result.Message = "操作成功!";
            return result;
        }
Example #29
0
 public virtual OperationResult Modify(IEnumerable<PlateNewsInfo> infoList)
 {
     OperationResult result = new OperationResult(OperationResultType.Error, "操作失败,请稍后重试!");
     List<PlateNews> eList = new List<PlateNews>();
     infoList.ForEach(x =>
     {
         PlateNews entity = new PlateNews();
         DESwap. PlateNewsDTE(x, entity);
         eList.Add(entity);
     });
     using (var DbContext = new CmsDbContext())
     {
     PlateNewsRpt.Update(DbContext, eList);
     DbContext.SaveChanges();
     }
     result.ResultType = OperationResultType.Success;
     result.Message = "操作成功!";
     return result;
 }
Example #30
0
        public override OperationResult Create(ArticleInfo info)
        {
            OperationResult result = new OperationResult(OperationResultType.Error, "操作失败,请稍后重试!");
            using (var DbContext = new CmsDbContext())
            {
                /*******保存资讯正文摘要*******/
                info.AuditTime = DateTime.Now;
                info.AuditState = (int)sct.dto.cms.EnumSet.ArticleAuditState.Edit;
                Article entity = new Article();
                DESwap.ArticleDTE(info, entity);
                ArticleRpt.Insert(DbContext, entity);

                if (info.ArticleType == (int)sct.dto.cms.EnumSet.ArticleType.Article)
                {
                    /*******保存正文*******/
                    if (info.ArticleDetail == null)
                    {
                        info.ArticleDetail = new ArticleDetailInfo();
                    }
                    info.ArticleDetail.Id = System.Guid.NewGuid().ToString();
                    info.ArticleDetail.ArticleId = info.Id;
                    ArticleDetail detail = new ArticleDetail();
                    DESwap.ArticleDetailDTE(info.ArticleDetail, detail);
                    ArticleDetailRpt.Insert(DbContext, detail);
                }
                else if (info.ArticleType == (int)sct.dto.cms.EnumSet.ArticleType.Picture)
                {
                    /*******保存图片*******/
                    List<ArticleImage> imagelist = new List<ArticleImage>();
                    foreach (var imageinfo in info.ArticleImageList)
                    {
                        if (string.IsNullOrEmpty(imageinfo.Id))
                        {
                            imageinfo.Id = System.Guid.NewGuid().ToString();
                            imageinfo.ArticleId = info.Id;
                            ArticleImage image = new ArticleImage();
                            DESwap.ArticleImageDTE(imageinfo, image);
                            imagelist.Add(image);
                        }
                    }
                    ArticleImageRpt.Insert(DbContext, imagelist);

                }
                else if (info.ArticleType == (int)sct.dto.cms.EnumSet.ArticleType.Video)
                {
                    /*******保存视频*******/
                    if (info.ArticleVideo == null)
                    {
                        info.ArticleVideo = new ArticleVideoInfo();
                    }
                    info.ArticleVideo.Id = System.Guid.NewGuid().ToString();
                    info.ArticleVideo.ArticleId = info.Id;
                    ArticleVideo video = new ArticleVideo();
                    DESwap.ArticleVideoDTE(info.ArticleVideo, video);
                    ArticleVideoRpt.Insert(DbContext, video);
                }
                /*异常数据未处理*/

                DbContext.SaveChanges();
            }
            result.ResultType = OperationResultType.Success;
            result.Message = "操作成功!";
            return result;
        }