本文整理匯總了C#中sct.cm.data.OperationResult類的典型用法代碼示例。如果您正苦於以下問題:C# OperationResult類的具體用法?C# OperationResult怎麽用?C# OperationResult使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
OperationResult類屬於sct.cm.data命名空間,在下文中一共展示了OperationResult類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}