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