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