📄 documentflow.cs
字号:
else
return "";
}
#endregion
#region 删除模板实体
/// <summary>
/// 删除模板实体
/// </summary>
/// <param name="StyleID">风格表格ID</param>
/// <param name="Path">路径</param>
public int DeleteTemplate(long StyleID,string Path)
{
int iReturn=0;
UDS.Components.Database mySQL = new UDS.Components.Database();
SqlDataReader dr;
SqlParameter[] parameters = {
mySQL.MakeInParam("@StyleID",SqlDbType.Int,4,StyleID)
};
try
{
mySQL.RunProc("sp_Flow_GetStyle",parameters,out dr);
if(dr.Read())
{
string FileName;
FileName = Path + "\\" + dr["Template"].ToString();
if(System.IO.File.Exists(FileName)==true)
{
System.IO.File.Delete(FileName);
}
}
}
catch(Exception e)
{
Error.Log(e.ToString());
}
finally
{
mySQL.Close();
mySQL = null;
}
return iReturn;
}
#endregion
#region 获得流程的表格样式描述
/// <summary>
/// 获得流程的表格样式描述
/// </summary>
/// <param name="FlowID">流程ID</param>
/// <param name="Judged">是否包括条件判断的字段</param>
/// <param name="dr">数据集合</param>
public int GetStyleDescription(long FlowID,int Judged,out SqlDataReader dr )
{
//int iReturn=-1;
UDS.Components.Database mySQL = new UDS.Components.Database();
SqlParameter[] parameters = {
mySQL.MakeInParam("@FlowID",SqlDbType.Int ,4,FlowID),
mySQL.MakeInParam("@Judged",SqlDbType.Int ,4,0)
};
try
{
mySQL.RunProc("sp_flow_getstyle_description",parameters,out dr);
}
catch(Exception e)
{
Error.Log(e.ToString());
dr = null;
}
finally
{
//mySQL.Close();
//mySQL = null;
}
return 0;
}
#endregion
#region 获得流程的表格样式描述
/// <summary>
/// 获得流程的表格样式描述
/// </summary>
/// <param name="StyleID">流程ID</param>
/// <param name="dr">数据集合</param>
public int GetStyleDescription(long StyleID,out SqlDataReader dr )
{
//int iReturn=-1;
UDS.Components.Database mySQL = new UDS.Components.Database();
SqlParameter[] parameters = {
mySQL.MakeInParam("@StyleID",SqlDbType.Int ,4,StyleID)
};
try
{
mySQL.RunProc("sp_flow_getstyle_description_ex",parameters,out dr);
}
catch(Exception e)
{
Error.Log(e.ToString());
dr = null;
}
finally
{
//mySQL.Close();
//mySQL = null;
}
return 0;
}
#endregion
#region 获得流程的表格样式描述
/// <summary>
/// 获得流程的表格样式描述
/// </summary>
/// <param name="FlowID">流程ID</param>
/// <param name="Judged">是否包括条件判断的字段</param>
/// <param name="dt">返回表格</param>
public int GetStyleDescription(long FlowID,int Judged,out DataTable dt )
{
//int iReturn=-1;
SqlDataReader dr;
UDS.Components.Database mySQL = new UDS.Components.Database();
SqlParameter[] parameters = {
mySQL.MakeInParam("@FlowID",SqlDbType.Int ,4,FlowID),
mySQL.MakeInParam("@Judged",SqlDbType.Int ,4,0)
};
try
{
mySQL.RunProc("sp_flow_getstyle_description",parameters,out dr);
dt = UDS.Components.Tools.ConvertDataReaderToDataTable(dr);
}
catch(Exception e)
{
Error.Log(e.ToString());
dt = null;
}
finally
{
mySQL.Close();
mySQL = null;
}
return 0;
}
#endregion
//////////////////////////////////////////////
/// 流程管理相关
//////////////////////////////////////////////
#region 添加流程
/// <summary>
/// 添加流程
/// </summary>
/// <param name="FlowName">流程名</param>
/// <param name="FlowRemark">流程简介</param>
/// <param name="Builder">流程制定者</param>
/// <param name="StyleID">流程自定义表单</param>
public int AddFlow(string FlowName,string FlowRemark,string Builder,long StyleID)
{
int iReturn=-1;
UDS.Components.Database mySQL = new UDS.Components.Database();
SqlParameter[] parameters = {
mySQL.MakeInParam("@FlowName",SqlDbType.VarChar ,300,FlowName),
mySQL.MakeInParam("@FlowRemark",SqlDbType.NText ,3000,FlowRemark ),
mySQL.MakeInParam("@Builder",SqlDbType.VarChar,300,Builder),
mySQL.MakeInParam("@StyleID",SqlDbType.Int ,4,StyleID)
};
try
{
iReturn = mySQL.RunProc("sp_Flow_AddFlow",parameters);
}
catch(Exception e)
{
Error.Log(e.ToString());
}
finally
{
mySQL.Close();
mySQL = null;
}
return iReturn;
}
#endregion
#region 删除流程
/// <summary>
/// 删除流程
/// </summary>
/// <param name="FlowID">被删除的流程ID</param>
public int DeleteFlow(long FlowID)
{
int iReturn=-1;
UDS.Components.Database mySQL = new UDS.Components.Database();
SqlParameter[] parameters = {
mySQL.MakeInParam("@FlowID",SqlDbType.Int ,4,FlowID)
};
try
{
iReturn = mySQL.RunProc("sp_Flow_DeleteFlow",parameters);
}
catch(Exception e)
{
Error.Log(e.ToString());
}
finally
{
mySQL.Close();
mySQL = null;
}
return iReturn;
}
#endregion
#region 修改流程
/// <summary>
/// 修改流程
/// </summary>
/// <param name="FlowID">流程ID</param>
/// <param name="FlowName">流程名</param>
/// <param name="FlowRemark">流程简介</param>
/// <param name="Builder">流程制定者</param>
/// <param name="StyleID">流程自定义表单</param>
public int UpdateFlow(long FlowID,string FlowName,string FlowRemark,string Builder,long StyleID)
{
int iReturn=-1;
UDS.Components.Database mySQL = new UDS.Components.Database();
SqlParameter[] parameters = {
mySQL.MakeInParam("@FlowID",SqlDbType.Int ,4,FlowID),
mySQL.MakeInParam("@FlowName",SqlDbType.VarChar ,300,FlowName),
mySQL.MakeInParam("@FlowRemark",SqlDbType.NText ,3000,FlowRemark ),
mySQL.MakeInParam("@Builder",SqlDbType.VarChar,300,Builder),
mySQL.MakeInParam("@StyleID",SqlDbType.Int ,4,StyleID)
};
try
{
iReturn = mySQL.RunProc("sp_Flow_UpdateFlow",parameters);
}
catch(Exception e)
{
Error.Log(e.ToString());
}
finally
{
mySQL.Close();
mySQL = null;
}
return iReturn;
}
#endregion
#region 得到流程基本信息
/// <summary>
/// 得到流程基本信息
/// </summary>
/// <param name="FlowID">流程ID</param>
/// <param name="dt">返回表格</param>
public int GetFlow(long FlowID,out DataTable dt)
{
int iReturn=-1;
SqlDataReader dr;
UDS.Components.Database mySQL = new UDS.Components.Database();
SqlParameter[] parameters = {
mySQL.MakeInParam("@FlowID",SqlDbType.Int ,4,FlowID)
};
try
{
mySQL.RunProc("sp_Flow_GetFlow",parameters,out dr);
iReturn = 0;
dt = Tools.ConvertDataReaderToDataTable(dr);
}
catch(Exception e)
{
Error.Log(e.ToString());
dt = null;
}
finally
{
mySQL.Close();
mySQL = null;
}
return iReturn;
}
#endregion
#region 得到流程名
/// <summary>
/// 得到流程名
/// </summary>
/// <param name="FlowID">流程ID</param>
/// <param name="dt">返回表格</param>
public string GetFlowTitle(long FlowID)
{
string strReturn="";
SqlDataReader dr;
UDS.Components.Database mySQL = new UDS.Components.Database();
SqlParameter[] parameters = {
mySQL.MakeInParam("@FlowID",SqlDbType.Int ,4,FlowID)
};
try
{
mySQL.RunProc("sp_Flow_GetFlow",parameters,out dr);
if(dr.Read())
{
strReturn = "<a href='#' title='" + dr["Remark"].ToString() + "'>" + dr["Flow_Name"].ToString() + "</a>";
}
dr.Close();
}
catch(Exception e)
{
Error.Log(e.ToString());
}
finally
{
mySQL.Close();
mySQL = null;
}
return strReturn;
}
#endregion
//////////////////////////////////////////////
/// 流程步骤管理相关
//////////////////////////////////////////////
#region 添加步骤
/// <summary>
/// 添加步骤
/// </summary>
/// <param name="StepName">步骤名</param>
/// <param name="StepRemark">步骤简介</param>
/// <param name="RightToFinish">是否有权利结束</param>
/// <param name="FlowRule">流转规则</param>
/// <param name="PassNum">会签数目</param>
public int AddStep(long FlowID,string StepName,string StepRemark,int RightToFinish,int FlowRule,int PassNum,int LocalAlert,int BaseHour,int CycTimes,int Period)
{
int iReturn=-1;
UDS.Components.Database mySQL = new UDS.Components.Database();
SqlParameter[] parameters = {
mySQL.MakeInParam("@FlowID",SqlDbType.Int ,4,FlowID),
mySQL.MakeInParam("@StepName",SqlDbType.VarChar ,300,StepName),
mySQL.MakeInParam("@StepRemark",SqlDbType.NText ,3000,StepRemark),
mySQL.MakeInParam("@RightToFinish",SqlDbType.Bit,1,RightToFinish),
mySQL.MakeInParam("@FlowRule",SqlDbType.Int,4,FlowRule),
mySQL.MakeInParam("@PassNum",SqlDbType.Int,4,PassNum),
mySQL.MakeInParam("@LocalAlert",SqlDbType.Bit,1,LocalAlert),
mySQL.MakeInParam("@BaseHour",SqlDbType.Int,4,BaseHour),
mySQL.MakeInParam("@CycTimes",SqlDbType.Int,4,CycTimes),
mySQL.MakeInParam("@Period",SqlDbType.Int,4,Period)
};
try
{
iReturn = mySQL.RunProc("sp_Flow_AddStep",parameters);
}
catch (Exception ex)
{
UDS.Components.Error.Log(ex.ToString());
}
finally
{
mySQL.Close();
mySQL = null;
}
return iReturn;
}
#endregion
#region 删除步骤
/// <summary>
/// 删除步骤
/// </summary>
/// <param name="FlowID">被删除的步骤的流程ID</param>
/// <param name="StepID">被删除的步骤的步骤ID</param>
public int DeleteStep(long FlowID,long StepID)
{
int iReturn=-1;
UDS.Components.Database mySQL = new UDS.Components.Database();
SqlParameter[] parameters = {
mySQL.MakeInParam("@FlowID",SqlDbType.Int ,4,FlowID),
mySQL.MakeInParam("@StepID",SqlDbType.Int ,4,StepID)
};
try
{
iReturn = mySQL.RunProc("sp_Flow_DeleteStep",parameters);
}
catch(Exception e)
{
Error.Log(e.ToString());
}
finally
{
mySQL.Close();
mySQL = null;
}
return iReturn;
}
#endregion
#region 修改步骤
/// <summary>
/// 修改步骤
/// </summary>
/// <param name="FlowID">流程ID</param>
/// <param name="StepID">步骤ID</param>
/// <param name="TacheName">步骤名</param>
/// <param name="TacheRemark">步骤简介</param>
/// <param name="RightToFinish">是否有权利结束</param>
/// <param name="FlowRule">流转规则</param>
/// <param name="PassNum">会签数目</param>
public int UpdateStep(long FlowID,long StepID,string StepName,string StepRemark,int RightToFinish,int FlowRule,int PassNum,int LocalAlert,int BaseHour,int CycTimes,int Period)
{
int iReturn=-1;
UDS.Components.Database mySQL = new UDS.Components.Database();
SqlParameter[] parameters = {
mySQL.MakeInParam("@FlowID",SqlDbType.Int ,4,FlowID),
mySQL.MakeInParam("@StepID",SqlDbType.Int ,4,StepID),
mySQL.MakeInParam("@StepName",SqlDbType.VarChar ,300,StepName),
mySQL.MakeInParam("@StepRemark",SqlDbType.NText ,3000,StepRemark),
mySQL.MakeInParam("@RightToFinish",SqlDbType.Bit,1,RightToFinish),
mySQL.MakeInParam("@FlowRule",SqlDbType.Int,4,FlowRule),
mySQL.MakeInParam("@PassNum",SqlDbType.Int,4,PassNum),
mySQL.MakeInParam("@LocalAlert",SqlDbType.Bit,1,LocalAlert),
mySQL.MakeInParam("@BaseHour",SqlDbType.Int,4,BaseHour),
mySQL.MakeInParam("@CycTimes",SqlDbType.Int,4,CycTimes),
mySQL.MakeInParam("@Period",SqlDbType.Int,4,Period)
};
try
{
iReturn = mySQL.RunProc("sp_Flow_UpdateStep",parameters);
}
catch (Exception ex)
{
UDS.Components.Error.Log(ex.ToString());
}
finally
{
mySQL.Close();
mySQL = null;
}
return iReturn;
}
#endregion
#region 上移步骤
/// <summary>
/// 上移步骤
/// </summary>
/// <param name="FlowID">流程ID</param>
/// <param name="StepID">步骤ID</param>
public int MoveUpStep(long FlowID,long StepID)
{
int iReturn=-1;
UDS.Components.Database mySQL = new UDS.Components.Database();
SqlParameter[] parameters = {
mySQL.MakeInParam("@FlowID",SqlDbType.Int ,4,FlowID),
mySQL.MakeInParam("@StepID",SqlDbType.Int ,4,StepID)
};
try
{
iReturn = mySQL.RunProc("sp_Flow_MoveUpStep",parameters);
}
catch (Exception ex)
{
UDS.Components.Error.Log(ex.ToString());
}
finally
{
mySQL.Close();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -