/// <summary> /// 三级机构修改 /// </summary> /// <param name="mt"></param> /// <returns></returns> public ActionResult Update(MechanismThirdModel mt) { if (imb.MechanismThirdUpdate(mt) > 0) { return(RedirectToAction("Index")); } else { return(RedirectToAction("ToUpdate")); } }
public int MechanismThirdUpdate(MechanismThirdModel p) { MechanismThird mt = new MechanismThird() { Id = p.Id, FirstMid = p.FirstMid, FirstMName = p.FirstMName, IsRetail = p.IsRetail, SalesId = p.SalesId, SecondMid = p.SecondMid, SecondMName = p.SecondMName, ThirdMName = p.ThirdMName, ThirdMid = p.ThirdMid }; return(Update(mt)); }
public List <MechanismThirdModel> MechanismThirdSelectFirst(string firstId) { List <MechanismThird> list = CreateContext().MechanismThirds.AsNoTracking().Where(e => e.FirstMid == firstId).Select(e => e).ToList(); List <MechanismThirdModel> list2 = new List <MechanismThirdModel>(); foreach (var p in list) { MechanismThirdModel mt = new MechanismThirdModel() { Id = p.Id, FirstMid = p.FirstMid, FirstMName = p.FirstMName, IsRetail = p.IsRetail, SalesId = p.SalesId, SecondMid = p.SecondMid, SecondMName = p.SecondMName, ThirdMName = p.ThirdMName, ThirdMid = p.ThirdMid }; list2.Add(mt); } return(list2); }
public List <MechanismThirdModel> MechanismThirdSelect() { List <MechanismThird> list = Select(); List <MechanismThirdModel> list2 = new List <MechanismThirdModel>(); foreach (var p in list) { MechanismThirdModel a = new MechanismThirdModel() { Id = p.Id, FirstMid = p.FirstMid, FirstMName = p.FirstMName, IsRetail = p.IsRetail, SalesId = p.SalesId, SecondMid = p.SecondMid, SecondMName = p.SecondMName, ThirdMName = p.ThirdMName, ThirdMid = p.ThirdMid }; list2.Add(a); } return(list2); }
/// <summary> /// 三级机构修改页面 /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult ToUpdate(int id) { MechanismThirdModel mt = imb.MechanismThirdBy(id); return(View(mt)); }
/// <summary> /// 三级机构添加 /// </summary> /// <param name="mt"></param> /// <returns></returns> public ActionResult Add(MechanismThirdModel mt) { return(Content(imb.MechanismThirdAdd(mt).ToString())); }
public int MechanismThirdUpdate(MechanismThirdModel p) { return(imd.MechanismThirdUpdate(p)); }
public int MechanismThirdAdd(MechanismThirdModel p) { return(imd.MechanismThirdAdd(p)); }