/// <summary> /// 对象编辑 /// </summary> /// <param name="tWfSettingFlow">用户对象</param> /// <returns>是否成功</returns> public bool Edit(TWfSettingFlowVo tWfSettingFlow) { string strSQL = SqlHelper.BuildUpdateExpress(tWfSettingFlow, TWfSettingFlowVo.T_WF_SETTING_FLOW_TABLE); strSQL += string.Format(" where ID='{0}' ", tWfSettingFlow.ID); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tWfSettingFlow_UpdateSet">UpdateSet用户对象</param> /// <param name="tWfSettingFlow_UpdateWhere">UpdateWhere用户对象</param> /// <returns>是否成功</returns> public bool Edit(TWfSettingFlowVo tWfSettingFlow_UpdateSet, TWfSettingFlowVo tWfSettingFlow_UpdateWhere) { string strSQL = SqlHelper.BuildUpdateExpress(tWfSettingFlow_UpdateSet, TWfSettingFlowVo.T_WF_SETTING_FLOW_TABLE); strSQL += this.BuildWhereStatement(tWfSettingFlow_UpdateWhere); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
public static string SaveData(string strid, string strWF_CAPTION, string strWF_ID, string strWF_CLASS_ID, string strFSTEP_RETURN_URL, string strWF_NOTE) { bool isSuccess = true; TWfSettingFlowVo twfsfv = new TWfSettingFlowVo(); twfsfv.WF_CAPTION = strWF_CAPTION; twfsfv.WF_ID = strWF_ID; twfsfv.WF_CLASS_ID = strWF_CLASS_ID; twfsfv.FSTEP_RETURN_URL = strFSTEP_RETURN_URL; twfsfv.WF_NOTE = strWF_NOTE; if (strid != "0") { twfsfv.ID = strid; twfsfv.DEAL_DATE = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); twfsfv.DEAL_TYPE = "1"; twfsfv.DEAL_USER = new PageBase().LogInfo.UserInfo.ID; isSuccess = new TWfSettingFlowLogic().Edit(twfsfv); if (isSuccess) { new PageBase().WriteLog("编辑流程", "", new PageBase().LogInfo.UserInfo.USER_NAME + "编辑流程" + strid + "成功"); } } else { long i = 1; Guid guid = Guid.NewGuid(); foreach (byte b in guid.ToByteArray()) { i *= ((int)b + 1); } twfsfv.ID = string.Format("{0:x}", i - DateTime.Now.Ticks).ToUpper(); twfsfv.WF_VERSION = WF_VERSION_FIELD; twfsfv.WF_STATE = "1"; twfsfv.WF_FORM_MAIN = ""; twfsfv.CREATE_DATE = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); twfsfv.CREATE_USER = new PageBase().LogInfo.UserInfo.ID; isSuccess = new TWfSettingFlowLogic().Create(twfsfv); if (isSuccess) { new PageBase().WriteLog("新增流程", "", new PageBase().LogInfo.UserInfo.USER_NAME + "新增流程" + strid + "成功"); } } if (isSuccess) { return("1"); } else { return("0"); } }
/// <summary> /// 获取对象DataTable /// </summary> /// <param name="tWfSettingFlow">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public DataTable SelectByTable(TWfSettingFlowVo tWfSettingFlow, int iIndex, int iCount) { string strSQL = " select * from T_WF_SETTING_FLOW {0} "; strSQL = String.Format(strSQL, BuildWhereStatement(tWfSettingFlow)); return(SqlHelper.ExecuteDataTable(BuildPagerExpress(strSQL, iIndex, iCount))); }
/// <summary> /// 对象删除 /// </summary> /// <param name="Id">ID</param> /// <returns>是否成功</returns> public bool Delete(TWfSettingFlowVo tWfSettingFlow) { string strSQL = "delete from T_WF_SETTING_FLOW "; strSQL += this.BuildWhereStatement(tWfSettingFlow); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 加载用户信息 /// </summary> public void InitUserData() { TWfSettingFlowVo setting = new TWfSettingFlowVo() { WF_STATE = "1" }; TWfSettingFlowLogic logic = new TWfSettingFlowLogic(setting); pager.RecordCount = logic.GetSelectResultCount(setting); DataTable dt = logic.SelectByTable(setting, pager.CurrentPageIndex, pager.PageSize); grdList.DataSource = dt.DefaultView; grdList.DataBind(); }
//获取信息 private void getData() { string strSortname = Request.Params["sortname"]; string strSortorder = Request.Params["sortorder"]; //当前页面 int intPageIndex = Convert.ToInt32(Request.Params["page"]); //每页记录数 int intPageSize = Convert.ToInt32(Request.Params["pagesize"]); TWfSettingFlowLogic logic = new TWfSettingFlowLogic(); TWfSettingFlowVo setting = new TWfSettingFlowVo(); setting.WF_STATE = "1"; setting.SORT_FIELD = strSortname; setting.SORT_TYPE = strSortorder; DataTable dt = logic.SelectByTable(setting, intPageIndex, intPageSize); int intTotalCount = logic.GetSelectResultCount(setting); string strJson = CreateToJson(dt, intTotalCount); Response.Write(strJson); Response.End(); }
/// <summary> /// 对象明细 /// </summary> /// <param name="tWfSettingFlow">对象条件</param> /// <returns>对象</returns> public TWfSettingFlowVo Details(TWfSettingFlowVo tWfSettingFlow) { string strSQL = String.Format("select * from T_WF_SETTING_FLOW " + this.BuildWhereStatement(tWfSettingFlow)); return(SqlHelper.ExecuteObject(new TWfSettingFlowVo(), strSQL)); }
/// <summary> /// 获得查询结果总行数,用于分页 /// </summary> /// <param name="tWfSettingFlow">对象</param> /// <returns>返回行数</returns> public int GetSelectResultCount(TWfSettingFlowVo tWfSettingFlow) { string strSQL = "select Count(*) from T_WF_SETTING_FLOW " + this.BuildWhereStatement(tWfSettingFlow); return(Convert.ToInt32(SqlHelper.ExecuteScalar(strSQL))); }
/// <summary> /// 根据对象构造条件语句 /// </summary> /// <param name="tWfSettingFlow"></param> /// <returns></returns> public string BuildWhereStatement(TWfSettingFlowVo tWfSettingFlow) { StringBuilder strWhereStatement = new StringBuilder(" Where 1=1 "); if (null != tWfSettingFlow) { //编号 if (!String.IsNullOrEmpty(tWfSettingFlow.ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND ID = '{0}'", tWfSettingFlow.ID.ToString())); } //工作流编号 if (!String.IsNullOrEmpty(tWfSettingFlow.WF_ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND WF_ID = '{0}'", tWfSettingFlow.WF_ID.ToString())); } //工作流简称 if (!String.IsNullOrEmpty(tWfSettingFlow.WF_CAPTION.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND WF_CAPTION = '{0}'", tWfSettingFlow.WF_CAPTION.ToString())); } //类别归属 if (!String.IsNullOrEmpty(tWfSettingFlow.WF_CLASS_ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND WF_CLASS_ID = '{0}'", tWfSettingFlow.WF_CLASS_ID.ToString())); } //生成的版本 if (!String.IsNullOrEmpty(tWfSettingFlow.WF_VERSION.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND WF_VERSION = '{0}'", tWfSettingFlow.WF_VERSION.ToString())); } //存在状态 if (!String.IsNullOrEmpty(tWfSettingFlow.WF_STATE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND WF_STATE = '{0}'", tWfSettingFlow.WF_STATE.ToString())); } //工作流描述 if (!String.IsNullOrEmpty(tWfSettingFlow.WF_NOTE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND WF_NOTE = '{0}'", tWfSettingFlow.WF_NOTE.ToString())); } //主表单 if (!String.IsNullOrEmpty(tWfSettingFlow.WF_FORM_MAIN.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND WF_FORM_MAIN = '{0}'", tWfSettingFlow.WF_FORM_MAIN.ToString())); } //创建人 if (!String.IsNullOrEmpty(tWfSettingFlow.CREATE_USER.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND CREATE_USER = '******'", tWfSettingFlow.CREATE_USER.ToString())); } //创建日期 if (!String.IsNullOrEmpty(tWfSettingFlow.CREATE_DATE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND CREATE_DATE = '{0}'", tWfSettingFlow.CREATE_DATE.ToString())); } //处理类型 if (!String.IsNullOrEmpty(tWfSettingFlow.DEAL_TYPE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND DEAL_TYPE = '{0}'", tWfSettingFlow.DEAL_TYPE.ToString())); } //删除人 if (!String.IsNullOrEmpty(tWfSettingFlow.DEAL_USER.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND DEAL_USER = '******'", tWfSettingFlow.DEAL_USER.ToString())); } //删除日期 if (!String.IsNullOrEmpty(tWfSettingFlow.DEAL_DATE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND DEAL_DATE = '{0}'", tWfSettingFlow.DEAL_DATE.ToString())); } //首环节跳转页面 if (!String.IsNullOrEmpty(tWfSettingFlow.FSTEP_RETURN_URL.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND FSTEP_RETURN_URL = '{0}'", tWfSettingFlow.FSTEP_RETURN_URL.ToString())); } //备注 if (!String.IsNullOrEmpty(tWfSettingFlow.REMARK.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK = '{0}'", tWfSettingFlow.REMARK.ToString())); } } return(strWhereStatement.ToString()); }
/// <summary> /// 对象添加 /// </summary> /// <param name="sysRole">对象</param> /// <returns>是否成功</returns> public bool Create(TWfSettingFlowVo tWfSettingFlow) { return(access.Create(tWfSettingFlow)); }
/// <summary> /// 根据对象特征获取单一对象 /// </summary> /// <param name="tWfSettingFlow">对象</param> /// <returns></returns> public TWfSettingFlowVo SelectByObject(TWfSettingFlowVo tWfSettingFlow) { return(access.SelectByObject(tWfSettingFlow)); }
/// <summary> /// 根据对象获取全部数据,用Table承载 /// 数据量较小时使用【不推荐】 /// </summary> /// <param name="tWfSettingFlow"></param> /// <returns></returns> public DataTable SelectByTable(TWfSettingFlowVo tWfSettingFlow) { return(access.SelectByTable(tWfSettingFlow)); }
/// <summary> /// 对象删除 /// </summary> /// <param name="Id">ID</param> /// <returns>是否成功</returns> public bool Delete(TWfSettingFlowVo tWfSettingFlow) { return(access.Delete(tWfSettingFlow)); }
/// <summary> /// 根据对象获取全部数据,用Table承载 /// 数据量较小时使用【不推荐】 /// </summary> /// <param name="tWfSettingFlow"></param> /// <returns></returns> public DataTable SelectByTable(TWfSettingFlowVo tWfSettingFlow) { string strSQL = "select * from T_WF_SETTING_FLOW " + this.BuildWhereStatement(tWfSettingFlow); return(SqlHelper.ExecuteDataTable(strSQL)); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tWfSettingFlow">用户对象</param> /// <returns>是否成功</returns> public bool Edit(TWfSettingFlowVo tWfSettingFlow) { return(access.Edit(tWfSettingFlow)); }
/// <summary> /// 对象明细 /// </summary> /// <param name="tWfSettingFlow">对象条件</param> /// <returns>对象</returns> public TWfSettingFlowVo Details(TWfSettingFlowVo tWfSettingFlow) { return(access.Details(tWfSettingFlow)); }
/// <summary> /// 获得查询结果总行数,用于分页 /// </summary> /// <param name="tWfSettingFlow">对象</param> /// <returns>返回行数</returns> public int GetSelectResultCount(TWfSettingFlowVo tWfSettingFlow) { return(access.GetSelectResultCount(tWfSettingFlow)); }
public TWfSettingFlowLogic(TWfSettingFlowVo _tWfSettingFlow) { tWfSettingFlow = _tWfSettingFlow; access = new TWfSettingFlowAccess(); }
/// <summary> /// 获取对象List /// </summary> /// <param name="tWfSettingFlow">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public List <TWfSettingFlowVo> SelectByObject(TWfSettingFlowVo tWfSettingFlow, int iIndex, int iCount) { string strSQL = String.Format("select * from T_WF_SETTING_FLOW " + this.BuildWhereStatement(tWfSettingFlow)); return(SqlHelper.ExecuteObjectList(tWfSettingFlow, BuildPagerExpress(strSQL, iIndex, iCount))); }
/// <summary> /// 对象添加 /// </summary> /// <param name="tWfSettingFlow">对象</param> /// <returns>是否成功</returns> public bool Create(TWfSettingFlowVo tWfSettingFlow) { string strSQL = SqlHelper.BuildInsertExpress(tWfSettingFlow, TWfSettingFlowVo.T_WF_SETTING_FLOW_TABLE); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 获取对象List /// </summary> /// <param name="tWfSettingFlow">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public List <TWfSettingFlowVo> SelectByObject(TWfSettingFlowVo tWfSettingFlow, int iIndex, int iCount) { return(access.SelectByObject(tWfSettingFlow, iIndex, iCount)); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tWfSettingFlow_UpdateSet">UpdateSet用户对象</param> /// <param name="tWfSettingFlow_UpdateWhere">UpdateWhere用户对象</param> /// <returns>是否成功</returns> public bool Edit(TWfSettingFlowVo tWfSettingFlow_UpdateSet, TWfSettingFlowVo tWfSettingFlow_UpdateWhere) { return(access.Edit(tWfSettingFlow_UpdateSet, tWfSettingFlow_UpdateWhere)); }
/// <summary> /// 获取对象DataTable /// </summary> /// <param name="tWfSettingFlow">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public DataTable SelectByTable(TWfSettingFlowVo tWfSettingFlow, int iIndex, int iCount) { return(access.SelectByTable(tWfSettingFlow, iIndex, iCount)); }
protected void btnSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(ID.Value)) { TWfSettingFlowVo twfsfv = new TWfSettingFlowVo(); twfsfv = BindControlsToObjectMode(twfsfv) as TWfSettingFlowVo; //验证工作流数据完整性 if (string.IsNullOrEmpty(twfsfv.WF_CAPTION) || string.IsNullOrEmpty(twfsfv.WF_ID)) { this.Alert("工作流简称和代码不可为空"); return; } //验证工作流简称是否重复 if (!string.IsNullOrEmpty(new TWfSettingFlowLogic().Details(new TWfSettingFlowVo() { WF_CAPTION = twfsfv.WF_CAPTION }).ID)) { this.Alert("工作流简称重复,请再指定"); return; } //验证工作流代码是否重复 if (!string.IsNullOrEmpty(new TWfSettingFlowLogic().Details(new TWfSettingFlowVo() { WF_ID = twfsfv.WF_ID }).ID)) { this.Alert("工作流代码重复,请再指定"); return; } twfsfv.ID = string.IsNullOrEmpty(twfsfv.ID) ? this.GetGUID() : twfsfv.ID; twfsfv.WF_VERSION = WF_VERSION_FIELD; twfsfv.WF_STATE = "1"; twfsfv.WF_FORM_MAIN = ""; twfsfv.CREATE_DATE = this.GetDateTimeToStanString(); twfsfv.CREATE_USER = base.LogInfo.UserInfo.ID; if (new TWfSettingFlowLogic().Create(twfsfv)) { this.Alert("增加工作流成功"); //以下是日志记录 return; } else { this.Alert("增加工作流失败,请重试"); //以下是日志记录 } } else { //是修改的 TWfSettingFlowVo twfsfv = new TWfSettingFlowVo(); twfsfv = BindControlsToObjectMode(twfsfv) as TWfSettingFlowVo; twfsfv.ID = ID.Value; //验证工作流数据完整性 if (string.IsNullOrEmpty(twfsfv.WF_CAPTION) || string.IsNullOrEmpty(twfsfv.WF_ID)) { this.Alert("工作流简称和代码不可为空"); return; } twfsfv.DEAL_DATE = this.GetDateTimeToStanString(); twfsfv.DEAL_TYPE = "1"; twfsfv.DEAL_USER = this.LogInfo.UserInfo.ID; if (new TWfSettingFlowLogic().Edit(twfsfv)) { this.Alert("编辑工作流成功"); //以下是日志记录 return; } else { this.Alert("编辑工作流失败,请重试"); //以下是日志记录 } } }