private void CreateModel(global::Drision.Framework.Entity.T_User entityModel) { entityModel.SetPropertyConvertValue("Department_ID", ddlDepartment_ID8T.GetValue()); entityModel.SetPropertyConvertValue("User_Code", txtUser_Code7Z.GetValue()); entityModel.SetPropertyConvertValue("User_Name", txtUser_Name8F.GetValue()); entityModel.SetPropertyConvertValue("Is_Attend", cbIs_AttendKD.GetValue()); }
private void CreateModel(global::Drision.Framework.Entity.T_User entityModel) { entityModel.SetPropertyConvertValue("Department_ID", ctrl_Department_ID.GetValue()); entityModel.SetPropertyConvertValue("User_Code", ctrl_User_Code.GetValue()); entityModel.SetPropertyConvertValue("User_Name", ctrl_User_Name.GetValue()); entityModel.SetPropertyConvertValue("EntryDate", ctrl_EntryDate.GetValue()); entityModel.SetPropertyConvertValue("Card_No", ctrl_Card_No.GetValue()); entityModel.SetPropertyConvertValue("User_Mobile", ctrl_User_Mobile.GetValue()); entityModel.SetPropertyConvertValue("User_EMail", ctrl_User_EMail.GetValue()); entityModel.SetPropertyConvertValue("User_Status", ctrl_User_Status.GetValue()); entityModel.SetPropertyConvertValue("Is_Prohibit_Web", ctrl_Is_Prohibit_Web.GetValue()); entityModel.SetPropertyConvertValue("Is_Prohibit_Mobile", ctrl_Is_Prohibit_Mobile.GetValue()); entityModel.SetPropertyConvertValue("User_Comment", ctrl_User_Comment.GetValue()); entityModel.SetPropertyConvertValue("User_Type", txt_User_TypeJW.GetValue()); }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { try { string __RedirectURL = string.Empty; ButtonOperationContext __ButtonOperationContext = new ButtonOperationContext(); global::Drision.Framework.Entity.T_User entityModel = null; entityModel = this.GenericHelper.FindById <global::Drision.Framework.Entity.T_User>(__Id); CreateModel(entityModel); PluginEventArgs __PluginEventArg = new PluginEventArgs() { entityModel = entityModel, RedirectURL = __RedirectURL, CurrentUserID = this.LoginUserID }; { #region 钮前插件 if (!__ButtonOperationContext.IsEnd) { try { PagePluginFactory.InvokeBeforePlugins(sender, __PluginEventArg); __ButtonOperationContext.RedirectURL = __PluginEventArg.RedirectURL; if (!string.IsNullOrEmpty(__ButtonOperationContext.RedirectURL)) { __ButtonOperationContext.IsEnd = true; } } catch (MessageException ex) { __ButtonOperationContext.IsEnd = true; __ButtonOperationContext.AlertMessage = ex.Message; } } #endregion #region 框架自己操作 if (!__ButtonOperationContext.IsEnd) { this.GenericHelper.Update(entityModel); __Id = entityModel.User_ID; } #endregion #region 钮后插件 if (!__ButtonOperationContext.IsEnd) { try { PagePluginFactory.InvokeAfterPlugins(sender, __PluginEventArg); __ButtonOperationContext.RedirectURL = __PluginEventArg.RedirectURL; if (!string.IsNullOrEmpty(__ButtonOperationContext.RedirectURL)) { __ButtonOperationContext.IsEnd = true; } } catch (MessageException ex) { __ButtonOperationContext.IsEnd = true; __ButtonOperationContext.AlertMessage = ex.Message; } } #endregion //结束事务 #region 最后处理 if (__ButtonOperationContext.IsEnd) { if (!string.IsNullOrEmpty(__ButtonOperationContext.AlertMessage)) { this.AjaxAlert(__ButtonOperationContext.AlertMessage, "EnableButton();"); return; } if (!string.IsNullOrEmpty(__ButtonOperationContext.RedirectURL)) { Response.Redirect(__ButtonOperationContext.RedirectURL); return; } } #endregion } __RedirectURL = "~/HR_Common/T_Attend_User_Query_Set.aspx"; if (__RedirectURL.Contains(this.Request.Url.AbsolutePath)) { __RedirectURL = this.Request.Url.PathAndQuery; } //如果没有id就加上id __RedirectURL = AppendQueryStringToUrl(__RedirectURL, "id", __Id);//2013-11-13 V3.0 Response.Redirect(__RedirectURL, false); } catch (Exception ex) { DrisionLog.Add(ex); this.AjaxAlert(ex, "EnableButton();"); } }