using Lskj.Model; using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Reflection; using System.Text; namespace Lskj.Business.Impl { public class WorkFlowBaseImpl : BaseImpl { /// /// 说明:获取基础流转步骤 /// 创建人:王一帆 /// 创建日期:2019-06-28 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// DataTable. public static DataTable GetBaseFlowData(string menuCode) { string sqlValue = string.Format("select * from p_systemdlltabflow where typeCode='{0}'", menuCode); return GetDataTableResult(sqlValue); } /// /// 说明:获取角色 /// 创建人:王一帆 /// 创建日期:2019-11-03 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// DataTable. public static DataTable GetWorkFlowRole(string mf) { string where = string.Empty; if (!string.IsNullOrEmpty(mf)) where = string.Format("where roleName like '%{0}%' or dbo.P_getpy(roleName) like '%{0}%'", mf); string sqlValue = "select * from p_systemRoleSetTab " + where; return GetDataTableResult(sqlValue); } /// /// 说明:获取小类设置操作员 /// 创建人:龚宇超 /// 创建日期:2019-06-24 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// DataTable. public static DataTable GetWorkFlowUsers(string depid, string mf) { string where = string.Empty; if (!string.IsNullOrEmpty(depid)) where = " and departmentid=" + depid; if (!string.IsNullOrEmpty(mf)) where = string.Format(" and (loginaccount like '%{0}%' or employeename like '%{0}%' or dbo.P_getpy(employeename) like '%{0}%')", mf); string sqlValue = "select loginaccount,employeename,departmentid from p_employeeTab where sign=0 and UseFlag=1 " + where; return GetDataTableResult(sqlValue); } /// /// 说明:获取部门数据 /// 创建人:龚宇超 /// 创建日期:2019-06-24 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// DataTable. public static DataTable GetDeps() { string sqlValue = string.Format(@"select '' departmentid,'' departmentname union select CAST(departmentid as varchar),departmentname from P_DepartmentTab"); return GetDataTableResult(sqlValue); } /// /// 说明:获取小类设置数据 /// 创建人:龚宇超 /// 创建日期:2019-06-24 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// DataTable. public static DataTable GetBaseFlowType(string typeCode) { string sqlValue = string.Format("select * from P_Systemdlltabflowtype where typeCode='{0}'", typeCode); return GetDataTableResult(sqlValue); } /// /// 说明:获取单表设置操作权限表 /// 创建人:王一帆 /// 创建日期:2019-10-17 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// DataTable. public static DataTable GetPowerTable() { string sqlValue = string.Format("select BillFlowPurview,DllFlowPurview from p_systemtab"); return GetDataTableResult(sqlValue); } /// /// /// 说明:获取单据基础审批流转 /// 创建人:龚宇超 /// 创建日期:2019-06-24 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// DataTable. public static DataTable GetBaseFlowTypeStep(string typeCode, string billtype) { string sqlValue = string.Format("select * from P_Systemdlltabflowtypestep where typecode='{0}' and billtype='{1}' order by stepCode asc", typeCode, billtype); return GetDataTableResult(sqlValue); } /// /// 说明:获取小类billtype /// 创建人:龚宇超 /// 创建日期:2019-06-26 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// System.String. public static string GetBaseFlowBaseType() { string sqlValue = "select ISNULL( right('0000' + CAST( MAX(cast(billType as int))+1 as varchar(5)),4),'0001') aaa from P_Systemdlltabflowtype"; return GetResult(sqlValue) + ""; } /// /// 说明:新增流转步骤 /// 创建人:龚宇超 /// 创建日期:2019-06-24 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// System.Int32. public static bool SaveBaseFlow(BaseflowModel model) { string sqlValue = string.Format(@"INSERT INTO P_systemdlltabflow(typeCode,stepCode,stepName,stepAction,backAction,stepGroup,stepSql,billModifyFields,detailModifyFields,beforeEvent, afterEvent,stepApplyText,stepBackText,stepApplyContent,stepBackContent,pStepCode,stepCloseText,stepCloseContent,stepCloseTip) VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}','{18}'); SELECT @@IDENTITY", model.typeCode, model.stepCode, model.stepName, model.stepAction, model.backAction, model.stepGroup, model.stepSql, model.billModifyFields, model.detailModifyFields, model.beforeEvent, model.afterEvent, model.stepApplyText, model.stepBackText, model.stepApplyContent, model.stepBackContent, model.pStepCode, model.stepCloseText, model.stepCloseContent, model.stepCloseTip); model.id = Convert.ToInt32(GetResult(sqlValue)); // 生成流转步骤sql语句 string stepSql = string.Format("exec p_systemCreateFlowSQL '{0}',{1},'{2}',''", model.typeCode, model.stepCode, ERPInfo.Instance.UserId); ExecSqlValue(stepSql); return model.id > 0; } /// /// 说明:新增流转步骤,带事务 /// 创建人:龚宇超 /// 创建日期:2019-06-24 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// System.Int32. public static bool SaveBaseFlow(BaseflowModel model, SqlTransaction Trans) { string sqlValue = string.Format(@"INSERT INTO P_systemdlltabflow(typeCode,stepCode,stepName,stepAction,backAction,stepGroup,stepSql,billModifyFields,detailModifyFields,beforeEvent, afterEvent,stepApplyText,stepBackText,stepApplyContent,stepBackContent,pStepCode,stepCloseText,stepCloseContent,stepCloseTip) VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}','{18}'); SELECT @@IDENTITY", model.typeCode, model.stepCode, model.stepName, model.stepAction, model.backAction, model.stepGroup, model.stepSql, model.billModifyFields, model.detailModifyFields, model.beforeEvent, model.afterEvent, model.stepApplyText, model.stepBackText, model.stepApplyContent, model.stepBackContent, model.pStepCode, model.stepCloseText, model.stepCloseContent, model.stepCloseTip); model.id = Convert.ToInt32(GetResult(sqlValue, Trans)); // 生成流转步骤sql语句 string stepSql = string.Format("exec p_systemCreateFlowSQL '{0}',{1},'{2}',''", model.typeCode, model.stepCode, ERPInfo.Instance.UserId); ExecSqlValue(stepSql, Trans); return model.id > 0; } /// /// 说明:修改流转步骤 /// 创建人:龚宇超 /// 创建日期:2019-06-25 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The model. /// true if XXXX, false otherwise. public static bool UpdateBaseFlow(BaseflowModel model) { string sqlValue = string.Format(@"update P_systemdlltabflow set stepName='{0}',stepAction='{1}',backAction='{2}',stepGroup='{3}',billModifyFields='{4}',detailModifyFields='{5}', beforeEvent='{6}',afterEvent='{7}',stepApplyText='{8}',stepBackText='{9}',stepApplyContent='{10}',stepBackContent='{11}',pStepCode='{12}', stepCloseText='{17}',stepCloseContent='{13}',stepCloseTip='{14}' where id='{16}'", model.stepName.Replace("'", "''"), model.stepAction.Replace("'", "''"), model.backAction.Replace("'", "''"), model.stepGroup.Replace("'", "''"), model.billModifyFields.Replace("'", "''"), model.detailModifyFields.Replace("'", "''"), model.beforeEvent.Replace("'", "''"), model.afterEvent.Replace("'", "''"), model.stepApplyText.Replace("'", "''"), model.stepBackText.Replace("'", "''"), model.stepApplyContent.Replace("'", "''"), model.stepBackContent.Replace("'", "''"), model.pStepCode.Replace("'", "''"), model.stepCloseContent.Replace("'", "''"), model.stepCloseTip.Replace("'", "''") , "", model.id, model.stepCloseText.Replace("'", "''")); // 生成流转步骤sql语句 string stepSql = string.Format("exec p_systemCreateFlowSQL '{0}',{1},'{2}',''", model.typeCode, model.stepCode, ERPInfo.Instance.UserId); ExecSqlValue(stepSql); return ExecSqlValue(sqlValue) > 0; } public static bool newUpdateBaseFlow(BaseflowModel model) { string sqlValue = string.Format(@"update P_systemdlltabflow set stepName='{0}',stepAction='{1}',backAction='{2}',stepGroup='{3}',billModifyFields='{4}',detailModifyFields='{5}', beforeEvent='{6}',afterEvent='{7}',stepApplyText='{8}',stepBackText='{9}',stepApplyContent='{10}',stepBackContent='{11}',pStepCode='{12}', stepCloseText='{17}',stepCloseContent='{13}',stepCloseTip='{14}' , requiredFields='{18}' where id='{16}'", model.stepName.Replace("'", "''"), model.stepAction.Replace("'", "''"), model.backAction.Replace("'", "''"), model.stepGroup.Replace("'", "''"), model.billModifyFields.Replace("'", "''"), model.detailModifyFields.Replace("'", "''"), model.beforeEvent.Replace("'", "''"), model.afterEvent.Replace("'", "''"), model.stepApplyText.Replace("'", "''"), model.stepBackText.Replace("'", "''"), model.stepApplyContent.Replace("'", "''"), model.stepBackContent.Replace("'", "''"), model.pStepCode.Replace("'", "''"), model.stepCloseContent.Replace("'", "''"), model.stepCloseTip.Replace("'", "''") , "", model.id, model.stepCloseText.Replace("'", "''"), model.requiredFields.Replace("'", "''")); // 生成流转步骤sql语句 sqlValue = sqlValue.Replace("''''", "''"); string stepSql = string.Format("exec p_systemCreateFlowSQL '{0}',{1},'{2}',''", model.typeCode, model.stepCode, ERPInfo.Instance.UserId); ExecSqlValue(stepSql); return ExecSqlValue(sqlValue) > 0; } /// /// 说明:流转步骤删除 /// 创建人:龚宇超 /// 创建日期:2019-06-26 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The model. /// true if XXXX, false otherwise. public static bool DeleteBaseFlow(BaseflowModel model) { // 1. 删除流转步骤;2. 删除流转步骤表格数据;3.删除表格颜色;删除小类流转步骤 string sqlValue = string.Format(@"delete p_systemdlltabflowtypestep where typecode='{0}' and stepcode='{1}'; delete p_systemdlltabflowstepgrid where typecode='{0}' and stepcode='{1}'; delete p_systemwordbookcolor where tab='FLOWSTEP_{0}_{1}_{2}'; delete p_systemdlltabflow where id='{2}'", model.typeCode, model.stepCode, model.id); return ExecSqlValue(sqlValue) > 0; } /// /// 说明:保存小类 /// 创建人:龚宇超 /// 创建日期:2019-06-26 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The model. /// true if XXXX, false otherwise. public static bool SaveBaseFlowType(BaseflowTypeModel model) { string sqlValue = string.Format(@"INSERT INTO p_systemdlltabflowtype(typeCode,billtype,billtypename,operuser,typekey) VALUES('{0}','{1}','{2}','{3}','{4}'); SELECT @@IDENTITY", model.typeCode, model.billType, model.billTypeName, model.operUser, model.typekey); model.id = Convert.ToInt32(GetResult(sqlValue)); return model.id > 0; } /// /// 说明:更新小类 /// 创建人:龚宇超 /// 创建日期:2019-06-26 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The model. /// true if XXXX, false otherwise. public static bool UpdateBaseFlowType(BaseflowTypeModel model) { string sqlValue = string.Format(@"update p_systemdlltabflowtype set billtypename='{0}',operuser='{1}' where id='{2}'", model.billTypeName.Replace("'", "''"), model.operUser.Replace("'", "''"), model.id); sqlValue = sqlValue.Replace("''''", "''"); return ExecSqlValue(sqlValue) > 0; } /// /// 说明:删除小类 /// 创建人:龚宇超 /// 创建日期:2019-06-26 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The model. /// true if XXXX, false otherwise. public static bool DeleteBaseFlowType(BaseflowTypeModel model) { // 1. 删除流转步骤;2. 删除流转步骤表格数据;3.删除表格颜色;删除小类流转步骤 string sqlValue = string.Format(@"delete p_systemdlltabflowtype where id='{0}'; delete p_systemdlltabflowtypestep where billtype='{0}' and typecode='{1}';", model.id, model.typeCode); return ExecSqlValue(sqlValue) > 0; } /// /// 说明:生成小类流转步骤 /// 创建人:龚宇超 /// 创建日期:2019-06-26 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The model. /// true if XXXX, false otherwise. public static bool SaveBaseFlowTypeStep(string typeCode, string billtype) { string sqlValue = string.Format(@"insert into p_systemdlltabflowtypestep(typeCode,billType,stepCode,stepName,stepGroup,stepBackCode,typekey,pStepCode,SameAudited,stepClosed,remindSelect) select a.typeCode,b.id,stepCode,stepName,stepGroup,cast(stepCode as int)-100,b.typekey,0,0,0,0 from p_systemdlltabflow a inner join p_systemdlltabflowtype b on a.typeCode=b.typeCode where a.typeCode='{0}' and b.id='{1}' and stepCode not in (select stepCode from p_systemdllflowtypestep where typeCode='{0}' and billType='{1}')", typeCode, billtype); return ExecSqlValue(sqlValue) > 0; } /// /// 说明:修改小类流转步骤 /// 创建人:龚宇超 /// 创建日期:2019-06-26 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The model. /// true if XXXX, false otherwise. public static bool UpdateBaseFlowTypeStep(BaseflowTypeStepModel model) { string sqlValue = string.Format(@"update p_systemdlltabflowtypestep set stepTime={0},autoStep='{1}',viewUser='{2}',operUser='{3}',stepBackCode='{4}', pStepCode='{7}',SameAudited='{8}',stepClosed='{9}',comfirmOper='{10}', remindOper='{11}',remindSelect='{12}',signOper='{13}',flowcharTagId='{14}',flowcharWidth='{15}',flowcharHeght='{16}', FlowCharfillcolor='{17}', LeftFlowCharfillcolor='{18}', LeftFlowCharWidth='{19}', fontSize='{20}', fontWeight='{21}',fontFamily='{22}',flowcharLineHeght='{23}',LeftFontColor='{24}',fontColor='{25}',affirmbak='{26}' where id='{27}'", string.IsNullOrEmpty(model.stepTime) ? "NULL" : model.stepTime.Replace("'", "''"), model.autoStep.Replace("'", "''"), model.viewUser.Replace("'", "''"), model.operUser.Replace("'", "''"), model.stepBackCode.Replace("'", "''"), model.StepOverCond.Replace("'", "''"), model.autoStepCond.Replace("'", "''"), model.pStepCode.Replace("'", "''"), model.SameAudited.Replace("'", "''"), model.stepClosed.Replace("'", "''"), model.comfirmOper.Replace("'", "''"), model.remindOper.Replace("'", "''"), model.remindSelect.Replace("'", "''"), model.signOper.Replace("'", "''"), model.flowcharTagId.Replace("'", "''"), model.flowcharWidth.Replace("'", "''"), model.flowcharHeght.Replace("'", "''"), model.FlowCharfillcolor.Replace("'", "''"), model.LeftFlowCharfillcolor.Replace("'", "''"), model.LeftFlowCharWidth.Replace("'", "''"), model.fontSize.Replace("'", "''"), model.fontWeight.Replace("'", "''"), model.fontFamily.Replace("'", "''"), model.flowcharLineHeght.Replace("'", "''"), model.LeftFontColor.Replace("'", "''"), model.fontColor.Replace("'", "''"), model.affirmbak.Replace("'", "''"), model.id); return ExecSqlValue(sqlValue) > 0; } public static bool newUpdateBaseFlowTypeStep(BaseflowTypeStepModel model) { string sqlValue = string.Format(@"update p_systemdlltabflowtypestep set stepTime={0},autoStep='{1}',viewUser='{2}',operUser='{3}',stepBackCode='{4}',autoStepCond='{6}', pStepCode='{7}',SameAudited='{8}',stepClosed='{9}',comfirmOper='{10}', remindOper='{11}',remindSelect='{12}',signOper='{13}',flowcharTagId='{14}',flowcharWidth='{15}',flowcharHeght='{16}', FlowCharfillcolor='{17}', LeftFlowCharfillcolor='{18}', LeftFlowCharWidth='{19}', fontSize='{20}', fontWeight='{21}',fontFamily='{22}',flowcharLineHeght='{23}',LeftFontColor='{24}',fontColor='{25}',affirmbak='{26}' where id='{27}'", string.IsNullOrEmpty(model.stepTime) ? "NULL" : model.stepTime.Replace("'", "''"), model.autoStep.Replace("'", "''"), model.viewUser.Replace("'", "''"), model.operUser.Replace("'", "''"), model.stepBackCode.Replace("'", "''"), model.StepOverCond.Replace("'", "''"), model.autoStepCond.Replace("'", "''"), model.pStepCode.Replace("'", "''"), model.SameAudited.Replace("'", "''"), model.stepClosed.Replace("'", "''"), model.comfirmOper.Replace("'", "''"), model.remindOper.Replace("'", "''"), model.remindSelect.Replace("'", "''"), model.signOper.Replace("'", "''"), model.flowcharTagId.Replace("'", "''"), model.flowcharWidth.Replace("'", "''"), model.flowcharHeght.Replace("'", "''"), model.FlowCharfillcolor.Replace("'", "''"), model.LeftFlowCharfillcolor.Replace("'", "''"), model.LeftFlowCharWidth.Replace("'", "''"), model.fontSize.Replace("'", "''"), model.fontWeight.Replace("'", "''"), model.fontFamily.Replace("'", "''"), model.flowcharLineHeght.Replace("'", "''"), model.LeftFontColor.Replace("'", "''"), model.fontColor.Replace("'", "''"), model.affirmbak.Replace("'", "''"), model.id); sqlValue = sqlValue.Replace("''''", "''"); return ExecSqlValue(sqlValue) > 0; } /// /// 说明:循环修改流程图步骤 /// 创建人:龚宇超 /// 创建日期:2019-10-12 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The model. /// true if XXXX, false otherwise. public static bool UpdateAllBaseFlow(BaseflowTypeStepModel model) { string sqlValue = string.Format(@"update p_systemdlltabflowtypestep set flowcharTagId='{0}',flowcharWidth='{1}',flowcharHeght='{2}', FlowCharfillcolor='{3}', LeftFlowCharfillcolor='{4}', LeftFlowCharWidth='{5}', fontSize='{6}', fontWeight='{7}',fontFamily='{8}',flowcharLineHeght='{9}',LeftFontColor='{10}',fontColor='{11}',affirmbak='{12}' where id='{13}'", model.flowcharTagId, model.flowcharWidth, model.flowcharHeght, model.FlowCharfillcolor, model.LeftFlowCharfillcolor, model.LeftFlowCharWidth, model.fontSize, model.fontWeight, model.fontFamily, model.flowcharLineHeght, model.LeftFontColor, model.fontColor, model.affirmbak, model.id); return ExecSqlValue(sqlValue) > 0; } /// /// 说明:重置权限 /// 创建人:龚宇超 /// 创建日期:2019-06-28 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// true if XXXX, false otherwise. public static string ResetPurview(string menuCode, int billtype) { string sqlValue = string.Format(@"declare @p6 varchar(2000) set @p6='1' exec p_system_init_purview 1,'{0}',{1},{2},'{3}',@p6 output select @p6", menuCode, billtype, ERPInfo.Instance.UserId, ERPInfo.Instance.UserName); return GetResult(sqlValue) + ""; } /// /// 说明:初始化权限 /// 创建人:龚宇超 /// 创建日期:2019-06-28 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// System.String. public static string InitPurview(string menuCode) { string sqlValue = string.Format(@"declare @p6 varchar(2000) set @p6='1' exec p_system_init_purview 1,'{0}',{1},{2},'{3}',@p6 output select @p6", menuCode, 0, ERPInfo.Instance.UserId, ERPInfo.Instance.UserName); return GetResult(sqlValue) + ""; } /// /// 说明:获得终审回退信息 /// 创建人:曹屹峰 /// 创建日期:2022-06-7 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// System.String. public static DataTable getFinalBack(string mMenuCode) { string sqlValue = string.Format("select OverBackSql,OverBackOper,OverBackKey from P_systemdlltab where DllCoid='{0}'", mMenuCode); return GetDataTableResult(sqlValue); } /// /// 说明:保存终审回退信息 /// 创建人:曹屹峰 /// 创建日期:2022-06-7 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// System.String. public static bool UpdateFinalReturnSettings(string sql, string name, string mMenuCode) { string sqlValue = string.Format("update P_systemdlltab set OverBackSql='{0}' , OverBackOper='{1}' where DllCoid='{2}'", sql.Replace("'", "''"), name, mMenuCode); sqlValue = sqlValue.Replace("''''", "''"); return ExecSqlValue(sqlValue) > 0; } /// /// 说明:获取终审条件信息 /// 创建人:曹屹峰 /// 创建日期:2022-06-7 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// System.String. public static DataTable getFallbackCondition(string key) { string sql = string.Format(@"select id,sourceId,controlName,controlLabel,controlType,defaultValue,sourceSql,keyField,resultField,controlLeft,controlTop,controlHeight,controlWidth,checkCond,formKey,orderId,isnull(ShowMobile,0) ShowMobile,isFix,Column_ID,BSRowId,BSColPercent,TitleColor,InputHintText,edited from p_systembillsourcecond where formKey = '{0}'", key); return GetDataTableResult(sql); } /// /// 说明:保存终审条件信息 /// 创建人:曹屹峰 /// 创建日期:2022-06-7 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// System.String. public static bool SaveFinalConditions(DataRow dr, string key) { string sqlValue = string.Empty; string id = dr["id"] + ""; if (string.IsNullOrWhiteSpace(id)) { //新增 sqlValue = string.Format(@"INSERT INTO p_systembillsourcecond (sourceId,controlName,controlLabel,controlType,defaultValue,sourceSql,keyField,resultField,controlLeft, controlTop,controlHeight,controlWidth,checkCond,ShowMobile,formKey) VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}')", 0, (dr["controlName"] + "").Replace("'", "''"), (dr["controlLabel"] + "").Replace("'", "''"), (dr["controlType"] + "").Replace("'", "''"), (dr["defaultValue"] + "").Replace("'", "''"), (dr["sourceSql"] + "").Replace("'", "''"), (dr["keyField"] + "").Replace("'", "''"), (dr["resultField"] + "").Replace("'", "''"), (dr["controlLeft"] + "").Replace("'", "''"), (dr["controlTop"] + "").Replace("'", "''"), (dr["controlHeight"] + "").Replace("'", "''"), (dr["controlWidth"] + "").Replace("'", "''"), (dr["checkCond"] + "").Replace("'", "''"), (dr["ShowMobile"] + "").Replace("'", "''"), key); } else { //修改 sqlValue = string.Format(@"UPDATE p_systembillsourcecond set controlName='{0}',controlLabel='{1}',controlType='{2}',defaultValue='{3}',sourceSql='{4}',keyField='{5}',resultField='{6}', controlLeft='{7}',controlTop='{8}',controlHeight='{9}',controlWidth='{10}',checkCond='{11}',ShowMobile='{12}' where id='{13}' ;", (dr["controlName"] + "").Replace("'", "''"), (dr["controlLabel"] + "").Replace("'", "''"), (dr["controlType"] + "").Replace("'", "''"), (dr["defaultValue"] + "").Replace("'", "''"), (dr["sourceSql"] + "").Replace("'", "''"), (dr["keyField"] + "").Replace("'", "''"), (dr["resultField"] + "").Replace("'", "''"), (dr["controlLeft"] + "").Replace("'", "''"), (dr["controlTop"] + "").Replace("'", "''"), (dr["controlHeight"] + "").Replace("'", "''"), (dr["controlWidth"] + "").Replace("'", "''"), (dr["checkCond"] + "").Replace("'", "''"), (dr["ShowMobile"] + "").Replace("'", "''"), (dr["id"] + "").Replace("'", "''") ); } sqlValue = sqlValue.Replace("''''", "''"); return ExecSqlValue(sqlValue) > 0; } /// /// 说明:保存终审条件信息 /// 创建人:曹屹峰 /// 创建日期:2022-06-7 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// System.String. public static bool deleteFinalConditions(string id, string key) { string sqlValue = string.Empty; sqlValue = string.Format("delete from p_systemControlLocation where formkey='{0}' and fieldid='{1}'", key, id); sqlValue += string.Format("delete from p_systembillsourcecond where id='{0}'", id); return ExecSqlValue(sqlValue) > 0; } } }