/// <summary> /// 添加权限 /// </summary> /// <param name="SrcID"></param> /// <param name="ObjID"></param> /// <param name="BaseOn"></param> /// <param name="ProcID"></param> /// <returns></returns> public int AddRight(long SrcID, long ObjID, int BaseOn, int ProcID) { int iReturn = 1; UDS.Components.Database mySQL = new UDS.Components.Database(); try { SqlParameter[] parameters = { mySQL.MakeInParam("@Act_ID", SqlDbType.Int, 4, ProcID), mySQL.MakeInParam("@Based_On", SqlDbType.Int, 4, BaseOn), mySQL.MakeInParam("@Src_ID", SqlDbType.Int, 4, SrcID), mySQL.MakeInParam("@Obj_ID", SqlDbType.Int, 4, ObjID) }; mySQL.RunProc("sp_AddAssignRule", parameters); } catch (Exception e) { Error.Log(e.ToString()); } finally { mySQL.Close(); mySQL = null; } return(iReturn); }
/// <summary> /// 添加权限 /// </summary> /// <param name="SrcID"></param> /// <param name="ObjID"></param> /// <param name="BaseOn"></param> /// <param name="ProcID"></param> /// <returns></returns> public int AddRight(long SrcID,long ObjID,int BaseOn,int ProcID) { int iReturn=1; UDS.Components.Database mySQL = new UDS.Components.Database(); try { SqlParameter[] parameters = { mySQL.MakeInParam("@Act_ID", SqlDbType.Int, 4,ProcID), mySQL.MakeInParam("@Based_On", SqlDbType.Int, 4,BaseOn), mySQL.MakeInParam("@Src_ID", SqlDbType.Int, 4,SrcID), mySQL.MakeInParam("@Obj_ID", SqlDbType.Int, 4,ObjID) }; mySQL.RunProc("sp_AddAssignRule",parameters); } catch(Exception e) { Error.Log(e.ToString()); } finally { mySQL.Close(); mySQL = null; } return iReturn; }
/// <summary> /// ����ĵ���������ĿID /// </summary> /// <param name="DocID">�ĵ�ID</param> public static int GetDocumentProjectID(long DocID) { int iReturn=0; UDS.Components.Database mySQL = new UDS.Components.Database(); SqlParameter[] parameters = { mySQL.MakeInParam("@DocID",SqlDbType.Int ,4,DocID) }; try { iReturn = mySQL.RunProc("sp_Flow_GetDocumentProjectID",parameters); } catch(Exception e) { Error.Log(e.ToString()); throw new Exception("��ù��ĵ���ĿID�����",e); } finally { mySQL.Close(); mySQL = null; } return iReturn; }
/// <summary> /// ȡ��ǩ�� /// </summary> /// <param name="UserName">ǩ����</param> /// <param name="DocID">��ȡ�����ĵ�ID</param> public int CancelSignInDocument(string UserName,long DocID) { int iReturn=-1; UDS.Components.Database mySQL = new UDS.Components.Database(); SqlParameter[] parameters = { mySQL.MakeInParam("@StaffName",SqlDbType.VarChar ,300,UserName), mySQL.MakeInParam("@DocID",SqlDbType.Int,4,DocID) }; try { iReturn = mySQL.RunProc("sp_Flow_CancelSignINDoc",parameters); } catch(Exception e) { Error.Log(e.ToString()); } finally { mySQL.Close(); mySQL = null; } return iReturn; }
/// <summary> /// �õ����������Ϣ /// </summary> /// <param name="FlowID">����ID</param> /// <param name="StepID">����ID</param> /// <param name="dt">���ر��</param> public int GetStep(long FlowID,long StepID,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("@StepID",SqlDbType.Int ,4,StepID) }; try { mySQL.RunProc("sp_Flow_GetStep",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; }
/// <summary> /// ɾ������ /// </summary> public void DelAttachment(string attachmentmd) { UDS.Components.Database data = new UDS.Components.Database (); SqlParameter[] prams = { data.MakeInParam("@replayid", SqlDbType.Int, 4,this.ReplayId), }; SqlDataReader dr = null; data.RunProc ("sp_BBS_GetReplayAttachment",prams,out dr); while(dr.Read()) { System.IO.File.Delete(attachmentmd+"\\"+dr["filename"].ToString()); } data.Close(); SqlParameter[] prams1 = { data.MakeInParam("@replayid", SqlDbType.Int, 4,this.ReplayId), }; data.RunProc("sp_BBS_DelAttachmentToReplay",prams1); }
/// <summary> /// ����ĵ� /// </summary> /// <param name="UserName">�����</param> /// <param name="FlowID">��������ID</param> /// <param name="SQL">��ʽ�����ݵ�SQL���</param> public int AddDocument(string UserName,long FlowID,string SQL) { int iReturn=-1; UDS.Components.Database mySQL = new UDS.Components.Database(); SqlParameter[] parameters = { mySQL.MakeInParam("@DocBuilder",SqlDbType.VarChar,300,UserName), mySQL.MakeInParam("@FlowID",SqlDbType.Int ,4,FlowID), mySQL.MakeInParam("@SQL",SqlDbType.NText,4000,SQL) }; try { iReturn = mySQL.RunProc("sp_Flow_AddDocument",parameters); } catch(Exception e) { Error.Log(e.ToString()); } finally { mySQL.Close(); mySQL = null; } return iReturn; }
/// <summary> /// ������̵ı����ʽ���� /// </summary> /// <param name="DocID">�ĵ�ID</param> /// <param name="dr">���ر��</param> public int GetDocumentInfo(long DocID,out DataTable dt ) { //int iReturn=-1; SqlDataReader dr; UDS.Components.Database mySQL = new UDS.Components.Database(); SqlParameter[] parameters = { mySQL.MakeInParam("@DocID",SqlDbType.Int ,4,DocID) }; try { mySQL.RunProc("sp_Flow_GetDocumentInfo",parameters,out dr); dt =UDS.Components.Tools.ConvertDataReaderToDataTable(dr); } catch(Exception e) { dt = null; Error.Log(e.ToString()); } finally { mySQL.Close(); mySQL = null; } return 0; }
/// <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(); mySQL = null; } return iReturn; }
/// <summary> /// ɾ���Զ���������ϸ���壬һ�ж����ʾһ���ؼ� /// </summary> /// <param name="DescriptionID">�����ϸ����ID</param> public int DeleteStyleDescription(long DescriptionID) { int iReturn=-1; UDS.Components.Database mySQL = new UDS.Components.Database(); SqlParameter[] parameters = { mySQL.MakeInParam("@DescriptionID",SqlDbType.Int,4,DescriptionID) }; try { iReturn = mySQL.RunProc("sp_Flow_DeleteStyle_Description",parameters); } catch(Exception e) { Error.Log(e.ToString()); } finally { mySQL.Close(); mySQL = null; } return iReturn; }
/// <summary> /// �����ע /// </summary> /// <param name="UserName">��ע��</param> /// <param name="DocID">��ע���ĵ�ID</param> /// <param name="PostilType">��ע���ͣ�ͨ�����ܾ������</param> public int AddPostil(string UserName,long DocID,string Postil,int PostilType,long ObjID,long ObjType) { int iReturn=-1; UDS.Components.Database mySQL = new UDS.Components.Database(); SqlParameter[] parameters = { mySQL.MakeInParam("@DocID",SqlDbType.Int ,4,DocID), mySQL.MakeInParam("@Postiler",SqlDbType.VarChar ,300,UserName), mySQL.MakeInParam("@PostilContent",SqlDbType.NText,3000,Postil), mySQL.MakeInParam("@PostilType",SqlDbType.Int ,4,PostilType), mySQL.MakeInParam("@ObjID",SqlDbType.Int ,4,ObjID), mySQL.MakeInParam("@ObjType",SqlDbType.Int ,4,ObjType) }; try { iReturn = mySQL.RunProc("sp_Flow_AddPostil",parameters); } catch(Exception e) { Error.Log(e.ToString()); } finally { mySQL.Close(); mySQL = null; } return iReturn; }
/// <summary> /// ����Ƿ�����Ŀ��תID /// </summary> /// <param name="UserName">�û���</param> /// <param name="DocID">�ĵ�ID</param> public bool IsProject(string UserName,long DocID) { bool iReturn = false; SqlDataReader dr; UDS.Components.Database mySQL = new UDS.Components.Database(); SqlParameter[] parameters = { mySQL.MakeInParam("@StaffName",SqlDbType.VarChar,100,UserName), mySQL.MakeInParam("@DocID",SqlDbType.Int ,4,DocID) }; try { mySQL.RunProc("sp_Flow_GetPrePostInfo",parameters,out dr); if(dr.Read()) { if(dr["Flow_Rule"].ToString()=="2") iReturn = true; } dr.Close(); dr = null; } catch(Exception e) { Error.Log(e.ToString()); throw new Exception("����Ƿ�����Ŀ��ת�����",e); } finally { mySQL.Close(); mySQL = null; } return iReturn; }
/// <summary> /// ͨ�����ID�õ�����ģ���� /// </summary> /// <param name="FlowID">����ID</param> public string GetStyleTemplateEx(long StyleID) { string str=""; UDS.Components.Database mySQL = new UDS.Components.Database(); SqlParameter[] parameters = { mySQL.MakeInParam("@StyleID",SqlDbType.Int ,4,StyleID), mySQL.MakeOutParam("@Template",SqlDbType.VarChar,100) }; try { mySQL.RunProc("sp_Flow_GetStyleTemplateEx",parameters); str = parameters[1].Value.ToString(); } catch(Exception e) { Error.Log(e.ToString()); throw new Exception("��ñ��ģ�����!",e); } finally { mySQL.Close(); mySQL = null; } if(str.Length>0) return @"Template\" + str; else return ""; }
/// <summary�������ͷ��Ϣ /// ��û����Ѿ�������Ա,���ر�� /// </summary> /// <param name="FlowID">����ID</param> /// <param name="dt">���ر��</param> public string GetStyleHeadline(long FlowID) { string str=""; SqlDataReader dr; UDS.Components.Database mySQL = new UDS.Components.Database(); SqlParameter[] parameters = { mySQL.MakeInParam("@FlowID",SqlDbType.Int ,4,FlowID) }; try { mySQL.RunProc("sp_Flow_GetStyleHead",parameters,out dr); if(dr.Read()) { str = dr["Flow_Name"].ToString() + "(��ˮ��:" + string.Format(dr["Times"].ToString(),"03d") + ")"; } } catch(Exception e) { Error.Log(e.ToString()); } finally { mySQL.Close(); mySQL = null; } return str; }
/// <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; }
/// <summary> /// ɾ������ /// </summary> /// <param name="FlowID">��ɾ������ת������ID</param> /// <param name="StepID">��ɾ������ת�IJ���ID</param> /// <param name="Priority">��ɾ������ת�����ȵȼ�</param> public int DeleteJump(long FlowID,long StepID,long Priority) { 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("@Priority",SqlDbType.Int ,4,Priority) }; try { iReturn = mySQL.RunProc("sp_Flow_DeleteJump",parameters); } catch(Exception e) { Error.Log(e.ToString()); } finally { mySQL.Close(); mySQL = null; } return iReturn; }
/// <summary> /// ���ĵ� /// </summary> /// <param name="UpdateSQL">�����ĵ����</param> public int UpdateDocument(string UpdateSQL) { int iReturn=-1; UDS.Components.Database mySQL = new UDS.Components.Database(); SqlParameter[] parameters = { mySQL.MakeInParam("@SQL",SqlDbType.NText,4000,UpdateSQL) }; try { iReturn = mySQL.RunProc("sp_Flow_UpdateDocument",parameters); } catch(Exception e) { Error.Log(e.ToString()); } finally { mySQL.Close(); mySQL = null; } return iReturn; }
/// <summary> /// ɾ���Զ������� /// </summary> /// <param name="StyleID">���ID</param> public int DeleteStyle(long StyleID,string Path) { int iReturn=-1; UDS.Components.Database mySQL = new UDS.Components.Database(); SqlParameter[] parameters = { mySQL.MakeInParam("@StyleID",SqlDbType.Int,4,StyleID) }; try { DeleteTemplate(StyleID,Path); //ɾ��ģ��ʵ�� iReturn = mySQL.RunProc("sp_Flow_DeleteStyle",parameters); } catch(Exception e) { Error.Log(e.ToString()); } finally { mySQL.Close(); mySQL = null; } return iReturn; }
/// <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; }
/// <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; }
/// <summary> /// ����ת /// </summary> /// <param name="FlowID">����ID</param> /// <param name="StepID">����ID</param> /// <param name="Priority">���ȼ�</param> /// <param name="FieldName">�ֶ���</param> /// <param name="Compare">�ȽϷ���</param> /// <param name="CompareValue">�Ƚ�ֵ</param> /// <returns></returns> public int UpdateJump(long FlowID,long StepID,long Priority,string FieldName,string Compare,double CompareValue,long ToStepID) { 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("@Priority",SqlDbType.Int ,4,Priority), mySQL.MakeInParam("@FieldName",SqlDbType.VarChar ,50,FieldName), mySQL.MakeInParam("@Compare",SqlDbType.VarChar,50,Compare), mySQL.MakeInParam("@CompareValue",SqlDbType.Float ,8,CompareValue), mySQL.MakeInParam("@ToStepID",SqlDbType.Float ,8,ToStepID) }; try { iReturn = mySQL.RunProc("sp_Flow_UpdateJump",parameters); } catch (Exception ex) { UDS.Components.Error.Log(ex.ToString()); } finally { mySQL.Close(); mySQL = null; } return iReturn; }
/// <summary> /// �õ��ĵ����������� /// </summary> /// <param name="DocID">�ĵ�ID</param> /// <returns>�ĵ�����������ID</returns> public int GetDocumentFlowID(long DocID) { int iReturn=-1; UDS.Components.Database mySQL = new UDS.Components.Database(); SqlParameter[] parameters = { mySQL.MakeInParam("@DocID",SqlDbType.Int ,4,DocID) }; try { iReturn = mySQL.RunProc("sp_GetDocumentFlowID",parameters); } catch(Exception e) { Error.Log(e.ToString()); } finally { mySQL.Close(); mySQL = null; } return iReturn; }
private void BindPosition() { UDS.Components.Database db = new UDS.Components.Database(); SqlDataReader dr_department = null; try { db.RunProc("sp_GetAllPosition", out dr_department); lstDeparment.DataSource = dr_department; lstDeparment.DataTextField = "Position_Name"; lstDeparment.DataValueField = "Position_ID"; lstDeparment.DataBind(); } finally { db.Close(); dr_department.Close(); } }
/// <summary> /// ɾ������ /// </summary> public void DelAttachment(string attachmentmd) { UDS.Components.Database data = new UDS.Components.Database (); //ɾ�����лظ����� //�õ����лظ� UDS.Components.BBSClass bbs = new UDS.Components.BBSClass(); SqlDataReader dr1 = null; dr1 = bbs.ReadBBSForumItemReplay(this); while(dr1.Read()) { BBSReplay replay = new BBSReplay(); replay.ReplayId = Int32.Parse(dr1["replay_id"].ToString()); replay.DelAttachment(attachmentmd); } //ɾ�����ӱ������ SqlParameter[] prams = { data.MakeInParam("@itemid", SqlDbType.Int, 4,this.ItemID), }; SqlDataReader dr = null; data.RunProc ("sp_BBS_GetItemAttachment",prams,out dr); while(dr.Read()) { System.IO.File.Delete(attachmentmd+"\\"+dr["filename"].ToString()); } data.Close(); SqlParameter[] prams1 = { data.MakeInParam("@itemid", SqlDbType.Int, 4,this.ItemID), }; data.RunProc("sp_BBS_DelAttachmentToItem",prams1); }
public string GetRoleInfo(long RoleID,string FiledName) { UDS.Components.Database db = new UDS.Components.Database(); SqlDataReader dr = null; SqlParameter[] prams = { db.MakeInParam("@RoleID",SqlDbType.Int ,4,RoleID), }; db.RunProc("sp_GetRoleInfo",prams,out dr); try { if(dr.Read()) { try { return dr[FiledName].ToString(); } catch { return ""; } } else return ""; } finally { if (db != null) { db.Close(); } if (dr != null) { dr.Close(); dr.Dispose(); } dr = null; db = null; } }
/// <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; }
/// <summary> /// �õ������� /// </summary> /// <param name="FlowID">����ID</param> public string GetStepTitle(long FlowID,long StepID) { string strReturn=""; SqlDataReader dr; 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 { mySQL.RunProc("sp_Flow_GetStep",parameters,out dr); if(dr.Read()) { strReturn = "<a href='#' title='" + dr["Step_Remark"].ToString() + "'>" + dr["Step_Name"].ToString() + "</a>"; } dr.Close(); } catch(Exception e) { Error.Log(e.ToString()); } finally { mySQL.Close(); mySQL = null; } return strReturn; }
/// <summary> /// ����Զ������� /// </summary> /// <param name="StyleName">�����</param> /// <param name="StyleRemark">���ID</param> /// <param name="Teamplate">ģ��·��</param> public int AddStyle(string StyleName,string StyleRemark,string Teamplate) { int iReturn=-1; UDS.Components.Database mySQL = new UDS.Components.Database(); SqlParameter[] parameters = { mySQL.MakeInParam("@StyleName",SqlDbType.VarChar,100,StyleName), mySQL.MakeInParam("@StyleRemark",SqlDbType.VarChar,100,StyleRemark), mySQL.MakeInParam("@Teamplate",SqlDbType.VarChar,100,Teamplate) }; try { iReturn = mySQL.RunProc("sp_Flow_AddStyle",parameters); } catch(Exception e) { Error.Log(e.ToString()); } finally { mySQL.Close(); mySQL = null; } return iReturn; }
/// <summary> /// ����Զ�������ϸ���� /// </summary> /// <param name="StyleID">�����ID</param> /// <param name="FieldName">�ﶨ�ֶ���</param> /// <param name="FieldDescription">�ֶ�����</param> /// <param name="Judged">�Ƿ���Ϊ�����ж��ֶ�</param> /// <param name="MultiLine">�Ƿ����</param> /// <param name="Height">�ؼ��߶�</param> /// <param name="Width">�ؼ���</param> /// <param name="Position">�ؼ��ڱ���е�λ��</param> /// <param name="Example">���ʾ��</param> public int AddStyleDescription(long StyleID,string FieldName,string FieldDescription,int Judged,int MultiLine,int Height,int Width,int Position,string Example) { int iReturn=-1; UDS.Components.Database mySQL = new UDS.Components.Database(); SqlParameter[] parameters = { mySQL.MakeInParam("@StyleID",SqlDbType.Int,4,StyleID), mySQL.MakeInParam("@FieldName",SqlDbType.VarChar,100,FieldName), mySQL.MakeInParam("@FieldDescription",SqlDbType.VarChar,100,FieldDescription), mySQL.MakeInParam("@Judged",SqlDbType.Int,4,Judged), mySQL.MakeInParam("@MultiLine",SqlDbType.Int,4,MultiLine), mySQL.MakeInParam("@Height",SqlDbType.Int,4,Height), mySQL.MakeInParam("@Width",SqlDbType.Int,4,Width), mySQL.MakeInParam("@Position",SqlDbType.Int,4,Position), mySQL.MakeInParam("@Example",SqlDbType.VarChar,100,Example) }; try { iReturn = mySQL.RunProc("sp_Flow_AddStyle_Description",parameters); } catch(Exception e) { Error.Log(e.ToString()); } finally { mySQL.Close(); mySQL = null; } return iReturn; }
/// <summary> /// ����rolename�õ�roleid /// </summary> /// <param name="rolename">��ɫ����</param> /// <returns>��ɫid</returns> public static int GetRoleIDByName(string rolename) { UDS.Components.Database db = new UDS.Components.Database(); int roleid = 0; SqlDataReader dr = null; SqlParameter[] prams = { db.MakeInParam("@rolename",SqlDbType.VarChar,100,rolename), }; try { db.RunProc("sp_GetRoleIDFromName", prams, out dr); while (dr.Read()) { roleid = Int32.Parse(dr["role_id"].ToString()); } } finally { db.Close(); } return(roleid); }
/// <summary> /// ����û����е���Ŀ /// </summary> /// <param name="UserName">�û���</param> /// <param name="dt">���ر��</param> public int GetProject(string UserName,out DataTable dt ) { //int iReturn=0; SqlDataReader dr; UDS.Components.Database mySQL = new UDS.Components.Database(); SqlParameter[] parameters = { mySQL.MakeInParam("@UserName",SqlDbType.VarChar ,300,UserName) }; try { mySQL.RunProc("sp_GetTaskClass",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; }