/// <summary> /// 保存管线信息(管线信息页面起止人井信息保存) /// </summary> /// <returns></returns> public ActionResult EditGxxx(FormCollection form) { try { var id = ConvertUtility.ToDecimal(form["Gxxxid"]); var model = gxxxBusiness.Find(id); if (model == null) { return(Json(AjaxResult.Error("请保存管线基本信息后再保存管线起止井信息"))); } GX_GXXX gxxx = new GX_GXXX(); gxxx = model; //起止井位置信息 gxxx.QJ = form["Qjszwz"]; gxxx.ZJ = form["Zjszwz"]; //起止井所在管孔位置 gxxx.QJGKWZ = form["gxszgkqjwz"]; gxxx.ZJGKWZ = form["gxszgkwz"]; gxxx.MODIFYBY = CurrentUser.UserName; gxxx.MODIFYTIME = DateTime.Now; gxxxBusiness.UpdateEntity(model); var ret = gxxxBusiness.SaveChange(); return(Json(ret > 0 ? AjaxResult.Success("数据操作成功") : AjaxResult.Error("数据操作失败"))); } catch (Exception ex) { return(Json(AjaxResult.Error("删除失败:" + (ex.InnerException != null ? ex.InnerException.Message : ex.Message)))); } }
public ActionResult EditJbxx(FormCollection form, GX_GXXX gxxx) { var id = ConvertUtility.ToDecimal(form["Gxxxid"]); var model = gxxxBusiness.Find(id); if (model == null) { return(Json(AjaxResult.Error("未找到需要更新的数据"))); } gxxx.XMYSXXID = ConvertUtility.ToDecimal(form["ysid"]); gxxx.GCBH = form["GXBH"]; gxxx.GXWZ = form["GXWZ"]; gxxx.GXCD = ConvertUtility.ToDecimal(form["GXCD"]); gxxx.DXLX = form["DXLX"]; gxxx.GXLX = form["GXLX"]; gxxx.JSZT = form["JSZT"]; gxxx.YWLX = form["YWLX"]; gxxx.GJZ = form["GJZ"]; gxxx.XNZC = form["XNZC"]; gxxx.GKCL = form["GKCL"]; gxxx.SYZT = ConvertUtility.ToDecimal(form["SYZT"]); gxxx.GKHS = ConvertUtility.ToDecimal(form["GKHS"]); gxxx.GKLS = ConvertUtility.ToDecimal(form["GCBH"]); gxxx.PLSX = ConvertUtility.ToDecimal(form["GCBH"]); gxxx.GXZT = form["GCBH"]; gxxx.MODIFYBY = CurrentUser.UserName; gxxx.MODIFYTIME = DateTime.Now; gxxxBusiness.UpdateEntity(gxxx); ViewData["GxxxId"] = gxxx.ID; return(Json(gxxxBusiness.SaveChange() > 0 ? AjaxResult.Success("数据操作成功!") : AjaxResult.Error("数据操作失败!"))); }
public ActionResult AddJbxx(FormCollection form, GX_GXXX gxxx) { gxxx.ID = ConvertUtility.ToDecimal(form["Gxxxid"]); var model = gxxxBusiness.Find(ConvertUtility.ToDecimal(form["Gxxxid"])); if (model == null) { //如果页面未关闭 多次点击保存按钮 验证是否存在 不存在生成数据 gxxxBusiness.AddEntity(gxxx); gxxxBusiness.SaveChange(); } //如果页面数据存在 则编辑数据 gxxx.XMYSXXID = ConvertUtility.ToDecimal(form["ysid"]); gxxx.GCBH = form["GXBH"]; gxxx.GXWZ = form["GXWZ"]; gxxx.GXCD = ConvertUtility.ToDecimal(form["GXCD"]); gxxx.DXLX = form["DXLX"]; gxxx.GXLX = form["GXLX"]; gxxx.JSZT = form["JSZT"]; gxxx.YWLX = form["YWLX"]; gxxx.GJZ = form["GJZ"]; gxxx.XNZC = form["XNZC"]; gxxx.GKCL = form["GKCL"]; gxxx.SYZT = ConvertUtility.ToDecimal(form["SYZT"]); gxxx.GKHS = ConvertUtility.ToDecimal(form["GKHS"]); gxxx.GKLS = ConvertUtility.ToDecimal(form["GCBH"]); gxxx.PLSX = ConvertUtility.ToDecimal(form["GCBH"]); gxxx.GXZT = form["GCBH"]; gxxx.CREATEBY = CurrentUser.UserName; gxxx.CREATETIME = DateTime.Now; gxxxBusiness.UpdateEntity(gxxx); ViewData["GxxxId"] = gxxx.ID; return(Json(gxxxBusiness.SaveChange() > 0 ? AjaxResult.Success("数据操作成功!") : AjaxResult.Error("数据操作失败!"))); }
/// <summary> /// 获取页面显示的数据列表 /// </summary> /// <param name="page"></param> /// <param name="rows"></param> /// <returns></returns> public ActionResult List(int page, int rows) { var xmgcid = ConvertUtility.ToDecimal(Request["gcbdid"]); var gxbh = ConvertUtility.ToString(Request["gxbh"]); var stqk = ConvertUtility.ToString(Request["stqk"]); int totalRecord = 0; var list = gxxxBusiness.FindAllGxxxList(xmgcid, gxbh, stqk, page, rows, out totalRecord); List <GX_GXXX> gxxxList = new List <GX_GXXX>(); foreach (var item in list) { GX_GXXX gxxx = new GX_GXXX(); gxxx = item; gxxx.QJ = GetRjmcById(item.QJ); gxxx.ZJ = GetRjmcById(item.ZJ); gxxxList.Add(gxxx); } return(Json(new { total = totalRecord, rows = gxxxList })); }
public void DeleteEntity(GX_GXXX gxGxxx) { GxxxRepository gxRjxxRepository = new GxxxRepository(uw); gxRjxxRepository.DeleteEntity(gxGxxx); }
public void AddEntity(GX_GXXX gxGxxx) { GxxxRepository gxRjxxRepository = new GxxxRepository(uw); gxRjxxRepository.AddEntity(gxGxxx); }