protected void pageSave(string doType) { string id = Utils.GetQueryStringValue("id"); var model = new EyouSoft.Model.SSOStructure.MGuanLiYuanInfo(); #region 表单取值 string getusername = Utils.GetFormValue(userName.UniqueID); string getuserpwd = Utils.GetFormValue(userPwd.UniqueID); string getcontactname = Utils.GetFormValue(ContactName.UniqueID); string gettel = Utils.GetFormValue(tel.UniqueID); string getremark = Utils.GetFormValue(remark.UniqueID); #endregion #region 实体赋值 model.Username = getusername; model.MiMa = getuserpwd; model.XingMing = getcontactname; model.Telephone = gettel; model.BeiZhu = getremark; model.CreateTime = DateTime.Now; model.IsAdmin = false; string stroldupload = Utils.GetFormValue("hideFileInfo"); string newupload = Utils.GetFormValue(this.UploadSeal.ClientHideID); if (!string.IsNullOrEmpty(newupload)) { if (!string.IsNullOrEmpty(newupload)) { model.GongZhangFilepath = newupload.Split('|')[1]; } } else { model.GongZhangFilepath = stroldupload; } #endregion #region 提交保存 bool result = false; string msg = ""; Response.Clear(); model.LeiXing = Utils.GetEnumValue<Eyousoft_yhq.Model.WebmasterLeiXing>(Utils.GetFormValue("txtLeiXing"), Eyousoft_yhq.Model.WebmasterLeiXing.系统); Eyousoft_yhq.BLL.User BLL = new Eyousoft_yhq.BLL.User(); if (doType == "add") { result = BLL.Add(model); msg = result ? "添加成功!" : "添加失败!"; Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg)); } else { model.UserId = id; result = BLL.Update(model); msg = result ? "修改成功!" : "修改失败!"; Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg)); } Response.End(); #endregion }
protected void pageSave(string doType) { string id = Utils.GetQueryStringValue("id"); var model = new EyouSoft.Model.SSOStructure.MGuanLiYuanInfo(); #region 表单取值 string getusername = Utils.GetFormValue(userName.UniqueID); string getuserpwd = Utils.GetFormValue(userPwd.UniqueID); string getcontactname = Utils.GetFormValue(ContactName.UniqueID); string gettel = Utils.GetFormValue(tel.UniqueID); string getremark = Utils.GetFormValue(remark.UniqueID); #endregion #region 实体赋值 model.Username = getusername; model.MiMa = getuserpwd; model.XingMing = getcontactname; model.Telephone = gettel; model.BeiZhu = getremark; model.CreateTime = DateTime.Now; model.IsAdmin = false; string stroldupload = Utils.GetFormValue("hideFileInfo"); string newupload = Utils.GetFormValue(this.UploadSeal.ClientHideID); if (!string.IsNullOrEmpty(newupload)) { if (!string.IsNullOrEmpty(newupload)) { model.GongZhangFilepath = newupload.Split('|')[1]; } } else { model.GongZhangFilepath = stroldupload; } #endregion #region 提交保存 bool result = false; string msg = ""; Response.Clear(); model.LeiXing = Utils.GetEnumValue <Eyousoft_yhq.Model.WebmasterLeiXing>(Utils.GetFormValue("txtLeiXing"), Eyousoft_yhq.Model.WebmasterLeiXing.系统); Eyousoft_yhq.BLL.User BLL = new Eyousoft_yhq.BLL.User(); if (doType == "add") { result = BLL.Add(model); msg = result ? "添加成功!" : "添加失败!"; Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg)); } else { model.UserId = id; result = BLL.Update(model); msg = result ? "修改成功!" : "修改失败!"; Response.Write(UtilsCommons.AjaxReturnJson(result ? "1" : "0", msg)); } Response.End(); #endregion }