/// <summary> /// 确认事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Accept_Click(object sender, EventArgs e) { bool IsOk = false; bpms_button = ControlBindHelper.GetWebControls <BPMS_Button>(this.Page); bpms_button.Enabled = Enabled.Checked ? 1 : 0; bpms_button.Split = Split.Checked ? 1 : 0; if (!string.IsNullOrEmpty(_key))//判断是否编辑 { bpms_button.ButtonId = _key; bpms_button.ModifyDate = DateTime.Now; bpms_button.ModifyUserId = RequestSession.GetSessionUser().UserId; bpms_button.ModifyUserName = RequestSession.GetSessionUser().UserName; IsOk = bpms_buttonibll.Update(bpms_button); if (IsOk) { ShowMsgHelper.AlertCallback(MessageHelper.MSG0006); } } else { bpms_button.ButtonId = CommonHelper.GetGuid; bpms_button.CreateUserId = RequestSession.GetSessionUser().UserId; bpms_button.CreateUserName = RequestSession.GetSessionUser().UserName; IsOk = bpms_buttonibll.Insert(bpms_button); if (IsOk) { ShowMsgHelper.AlertCallback(MessageHelper.MSG0005); } } if (!IsOk) { ShowMsgHelper.Alert_Error(MessageHelper.MSG0022); } }
/// <summary> /// 得到一个对象实体 /// </summary> public void InitControl() { if (!string.IsNullOrEmpty(_key)) { bpms_button = bpms_buttonibll.GetEntity(_key); ControlBindHelper.SetWebControls(this.Page, bpms_button); if (bpms_button.Img != "") { Img_Menu_Img.Src = "/Themes/Images/16/" + bpms_button.Img; } } }
/// <summary> /// 增加一条数据 /// </summary> /// <param name="entity">实体类</param> /// <returns></returns> public int Insert(BPMS_Button entity) { int IsOk = DataFactory.DbUtils().Insert(entity); #region 写日操作日志 if (IsOk > 0) { BPMS_SysLogDAL.Instance.AddTaskLog <BPMS_Button>(entity, RequestSession.GetSessionUser().UserId, RequestSession.GetSessionUser().UserName); } #endregion return(IsOk); }
/// <summary> /// 更新一条数据 /// </summary> /// <param name="entity">实体类</param> /// <returns></returns> public int Update(BPMS_Button entity) { #region 获取旧值 var oldEntity = this.GetEntity(BPMS_SysLogDAL.Instance.GetKeyFieldValue <BPMS_Button>(entity).ToString()); #endregion int IsOk = DataFactory.DbUtils().Update(entity, "ButtonId"); #region 写日操作日志 if (IsOk > 0) { BPMS_SysLogDAL.Instance.UpdateTaskLog <BPMS_Button>(oldEntity, entity, RequestSession.GetSessionUser().UserId, RequestSession.GetSessionUser().UserName); } #endregion return(IsOk); }
/// <summary> /// 更新一条数据 /// </summary> /// <param name="entity">实体类</param> /// <returns></returns> public bool Update(BPMS_Button entity) { return(dal.Update(entity) >= 0 ? true : false); }
/// <summary> /// 增加一条数据 /// </summary> /// <param name="entity">实体类</param> /// <returns></returns> public bool Insert(BPMS_Button entity) { return(dal.Insert(entity) >= 0 ? true : false); }