本文整理汇总了C#中sct.cm.data.OperationResult类的典型用法代码示例。如果您正苦于以下问题:C# OperationResult类的具体用法?C# OperationResult怎么用?C# OperationResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OperationResult类属于sct.cm.data命名空间,在下文中一共展示了OperationResult类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SaveWareHouse
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);
}
开发者ID:liurongjin,项目名称:frame,代码行数:27,代码来源:WareHouseMgrController.cs
示例2: Create
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;
}
}
开发者ID:liurongjin,项目名称:frame,代码行数:56,代码来源:FacilityService.cs
示例3: Create
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;
}
}
开发者ID:liurongjin,项目名称:frame,代码行数:55,代码来源:StationService.cs
示例4: Create
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;
}
开发者ID:liurongjin,项目名称:frame,代码行数:14,代码来源:StationBaseService.cs
示例5: 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
示例6: 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
示例7: Create
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;
}
开发者ID:liurongjin,项目名称:frame,代码行数:14,代码来源:ArticleAnnexBaseService.cs
示例8: Create
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;
}
开发者ID:liurongjin,项目名称:frame,代码行数:14,代码来源:CompanyClientTypeBaseService.cs
示例9: Create
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;
}
开发者ID:liurongjin,项目名称:frame,代码行数:14,代码来源:FriendLinkBaseService.cs
示例10: 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
示例11: 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
示例12: Create
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;
}
开发者ID:liurongjin,项目名称:frame,代码行数:14,代码来源:PlateNewsBaseService.cs
示例13: Create
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;
}
开发者ID:liurongjin,项目名称:frame,代码行数:16,代码来源:AdviceService.cs
示例14: 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
示例15: Login
/// <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;
}
开发者ID:masicub5,项目名称:sctframe,代码行数:52,代码来源:StaffService.cs
示例16: 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
示例17: Remove
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;
}
开发者ID:liurongjin,项目名称:frame,代码行数:18,代码来源:ArticleAnnexBaseService.cs
示例18: SaveFunction
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);
}
开发者ID:liurongjin,项目名称:frame,代码行数:25,代码来源:SysMgrController.cs
示例19: Remove
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;
}
开发者ID:liurongjin,项目名称:frame,代码行数:18,代码来源:MaterialPurchaseItemBaseService.cs
示例20: SaveMenu
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);
}
开发者ID:liurongjin,项目名称:frame,代码行数:27,代码来源:SysMgrController.cs
注:本文中的sct.cm.data.OperationResult类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论