//''' <summary> //''' 取功能權限字串 //''' </summary> //''' <param name="UsrCde"></param> //''' <param name="MnuCde"></param> //''' <returns></returns> //''' <remarks></remarks> public String GetPow(String UsrCde, String MnuCde) { String tmp = ""; if (UsrCde == "USR00000000000000001") { tmp = "BOW01,BOW02,BOW03,ADD,EDIT,DEL"; } else { IzDataSource IzDataSource = new IzDataSource(); IzDataSource.SelectString = "select * from rlGrpMnu where tbMnuCde=@tbMnuCde and tbGrpCde in (select tbGrpCde from rlUsrGrp where tbUsrCde=@tbUsrCde)"; IzDataSource.ParametersClear(); IzDataSource.ParametersAdd("tbMnuCde", MnuCde); IzDataSource.ParametersAdd("tbUsrCde", UsrCde); System.Data.DataTable tb = IzDataSource.SelectDataTable(); for (int i = 0; i < tb.Rows.Count; i++) { tmp += "" + tb.Rows[i]["tbMnuPow"].ToString().Trim() + ","; } tb.Dispose(); IzDataSource.Dispose(); } return(tmp); }
//''' <summary> //''' 產生下一位數類別編號 //''' </summary> //''' <param name="Tid">前三碼</param> //''' <param name="TidNum">數字位數</param> //''' <returns></returns> //''' <remarks></remarks> public String getTypNexTid(String Tid, int TidNum) { IZCls.StringAccess StringAccess = new IZCls.StringAccess(); String StrTmp = ""; IzDataSource IzDataSource = new IzDataSource(); IzDataSource.SelectString = "select top 1 tbTypTid from tbTyp where left(tbTypTid," + Tid.Length + ")=@tbTypTopCde order by tbTypTid desc"; IzDataSource.ParametersClear(); IzDataSource.ParametersAdd("tbTypTopCde", Tid); System.Data.DataTable tb = IzDataSource.SelectDataTable(); if (tb.Rows.Count > 0) { //String TidTNum = Right("" & tb.Rows(0).Item("tbTypTid"), Len("" & tb.Rows(0).Item("tbTypTid")) - Len(Tid)); String TidTNum = tb.Rows[0]["tbTypTid"].ToString().Substring(tb.Rows[0]["tbTypTid"].ToString().IndexOf(Tid) + Tid.Length); if (StringAccess.IsNum(TidTNum) == true) { StrTmp = Tid + StringAccess.addZeroBfStr(Convert.ToInt32(TidTNum) + 1, TidNum); } else { StrTmp = Tid + StringAccess.addZeroBfStr(1, TidNum); } } else { StrTmp = Tid + StringAccess.addZeroBfStr(1, TidNum); } tb.Dispose(); IzDataSource.Dispose(); return(StrTmp); }
//''' <summary> //''' 取得指定類別的類別名稱組(以逗號分開)忽略啟用 //''' </summary> //''' <param name="TopCdeS">TYP(前置三碼)</param> //''' <param name="TypTidStr">T001,T002,T003(可複選)</param> //''' <returns></returns> //''' <remarks></remarks> public String getTypSubA(String TopCdeS, String TypTidStr) { IZCls.WebFormBase WebFormBase = new IZCls.WebFormBase(); IZCls.DataAccess DataAccess = new IZCls.DataAccess(); TypTidStr = DataAccess.ClsSqlChr(TypTidStr); String TypTidSql = WebFormBase.DotToSqlStr(TypTidStr); IzDataSource IzDataSource = new IzDataSource(); IzDataSource.SelectString = "select tbTypSub from tbTyp where left(tbTypCde,3)=@TopCdeS and tbTypTid in (" + TypTidSql + ")"; IzDataSource.ParametersClear(); IzDataSource.ParametersAdd("TopCdeS", TopCdeS); System.Data.DataTable tb = IzDataSource.SelectDataTable(); String StrTmp = ""; for (int i = 0; i < tb.Rows.Count; i++) { if (StrTmp == "") { StrTmp = tb.Rows[i]["tbTypSub"].ToString(); } else { StrTmp += "," + tb.Rows[i]["tbTypSub"].ToString(); } } tb.Dispose(); IzDataSource.Dispose(); return(StrTmp); }
//''' <summary> //''' 取備註非空值清單 //''' </summary> //''' <param name="TopCdeS"></param> //''' <returns></returns> //''' <remarks></remarks> public System.Data.DataTable getTypLstByHasNot(String TopCdeS) { IzDataSource IzDataSource = new IzDataSource(); IzDataSource.SelectString = "select * from tbTyp where left(tbTypCde,3)=@TopCdeS and not(tbTypNot is null) and not(tbTypNot like '') order by tbTypSrt"; IzDataSource.ParametersClear(); IzDataSource.ParametersAdd("TopCdeS", TopCdeS); System.Data.DataTable tb = IzDataSource.SelectDataTable(); IzDataSource.Dispose(); return(tb); }
//'''類別處理函數############################################################## //''' <summary> //''' 取類別清單 //''' </summary> //''' <param name="TopCdeS">類別編號前三碼</param> //''' <returns></returns> //''' <remarks></remarks> public System.Data.DataTable getTypLst(String TopCdeS) { IzDataSource IzDataSource = new IzDataSource(); IzDataSource.SelectString = "select * from tbTyp where tbTypFlg=1 and left(tbTypCde,3)=@TopCdeS order by tbTypSrt"; IzDataSource.ParametersClear(); IzDataSource.ParametersAdd("TopCdeS", TopCdeS); System.Data.DataTable tb = IzDataSource.SelectDataTable(); IzDataSource.Dispose(); return(tb); }
//''' <summary> //''' 取有權限的選單 //''' </summary> //''' <param name="TopCde"></param> //''' <param name="UsrCde"></param> //''' <returns></returns> //''' <remarks></remarks> public System.Data.DataTable MnuSelectUsrGrp(String TopCde, String UsrCde) { IzDataSource IzDataSource = new IzDataSource(); if (UsrCde == "USR00000000000000001") { if (TopCde == "") { IzDataSource.SelectString = "select * from tbMnu where tbMnuFlg=1 and (tbMnuTopCde is null or tbMnuTopCde='') order by tbMnuSrt"; IzDataSource.ParametersClear(); } else { IzDataSource.SelectString = "select * from tbMnu where tbMnuFlg=1 and tbMnuTopCde=@tbMnuTopCde order by tbMnuSrt"; IzDataSource.ParametersClear(); IzDataSource.ParametersAdd("tbMnuTopCde", TopCde); } IzDataSource.ParametersAdd("tbUsrCde", UsrCde); } else { if (TopCde == "") { IzDataSource.SelectString = "select * from tbMnu where tbMnuFlg=1 and (tbMnuTopCde is null or tbMnuTopCde='') and tbMnuCde in (select tbMnuCde from rlGrpMnu where tbGrpCde in(select tbGrpCde from rlUsrGrp where tbUsrCde=@tbUsrCde)) order by tbMnuSrt"; IzDataSource.ParametersClear(); } else { IzDataSource.SelectString = "select * from tbMnu where tbMnuFlg=1 and tbMnuTopCde=@tbMnuTopCde and tbMnuCde in (select tbMnuCde from rlGrpMnu where tbGrpCde in(select tbGrpCde from rlUsrGrp where tbUsrCde=@tbUsrCde)) order by tbMnuSrt"; IzDataSource.ParametersClear(); IzDataSource.ParametersAdd("tbMnuTopCde", TopCde); } IzDataSource.ParametersAdd("tbUsrCde", UsrCde); } System.Data.DataTable tb = IzDataSource.SelectDataTable(); IzDataSource.Dispose(); return(tb); }
// ''' <summary> //''' 取得選單清單 //''' </summary> //''' <param name="TopCde"></param> //''' <returns></returns> //''' <remarks></remarks> public System.Data.DataTable MnuSelect(String TopCde) { IzDataSource IzDataSource = new IzDataSource(); if (TopCde == "") { IzDataSource.SelectString = "select * from tbMnu where tbMnuFlg=1 and (tbMnuTopCde is null or tbMnuTopCde='') order by tbMnuSrt"; IzDataSource.ParametersClear(); } else { IzDataSource.SelectString = "select * from tbMnu where tbMnuFlg=1 and tbMnuTopCde=@tbMnuTopCde order by tbMnuSrt"; IzDataSource.ParametersClear(); IzDataSource.ParametersAdd("tbMnuTopCde", TopCde); } System.Data.DataTable tb = IzDataSource.SelectDataTable(); IzDataSource.Dispose(); return(tb); }
//''' <summary> //''' 取單筆資料 //''' </summary> //''' <param name="Cde"></param> //''' <returns></returns> //''' <remarks></remarks> public System.Data.DataTable MnuSelectOne(String Cde) { IzDataSource IzDataSource = new IzDataSource(); IzDataSource.SelectString = "select * from tbMnu where tbMnuFlg=1 and tbMnuCde=@tbMnuCde"; IzDataSource.ParametersClear(); IzDataSource.ParametersAdd("tbMnuCde", Cde); System.Data.DataTable tb = IzDataSource.SelectDataTable(); IzDataSource.Dispose(); return(tb); }
//''' <summary> //''' 取單筆使用者群組資料 //''' </summary> //''' <param name="UsrCde"></param> //''' <param name="GrpCde"></param> //''' <returns></returns> //''' <remarks></remarks> public System.Data.DataTable UsrGrpSelectOne(String UsrCde, String GrpCde) { IzDataSource IzDataSource = new IzDataSource(); IzDataSource.SelectString = "select * from rlUsrGrp where tbGrpCde=@tbGrpCde and tbUsrCde=@tbUsrCde"; IzDataSource.ParametersClear(); IzDataSource.ParametersAdd("tbGrpCde", GrpCde); IzDataSource.ParametersAdd("tbUsrCde", UsrCde); System.Data.DataTable tb = IzDataSource.SelectDataTable(); IzDataSource.Dispose(); return(tb); }
//''' <summary> //''' 取上層類別名稱 //''' </summary> //''' <param name="TopCde"></param> //''' <returns></returns> //''' <remarks></remarks> public String getTypTopNme(String TopCde) { String StrTmp = ""; IzDataSource IzDataSource = new IzDataSource(); IzDataSource.SelectString = "select tbTypTopSub from tbTypTop where tbTypTopFlg=1 and tbTypTopCde=@tbTypTopCde "; IzDataSource.ParametersClear(); IzDataSource.ParametersAdd("tbTypTopCde", TopCde); System.Data.DataTable tb = IzDataSource.SelectDataTable(); if (tb.Rows.Count > 0) { StrTmp = tb.Rows[0]["tbTypTopSub"].ToString(); } tb.Dispose(); IzDataSource.Dispose(); return(StrTmp); }
//''' <summary> //''' 取姓名 //''' </summary> //''' <param name="Cde"></param> //''' <returns></returns> //''' <remarks></remarks> public String getUsrNme(String Cde) { String Tmp = ""; IzDataSource IzDataSource = new IzDataSource(); IzDataSource.SelectString = "select tbUsrNme from tbUsr where tbUsrFlg=1 and tbUsrCde=@tbUsrCde"; IzDataSource.ParametersClear(); IzDataSource.ParametersAdd("tbUsrCde", Cde); System.Data.DataTable tb = IzDataSource.SelectDataTable(); if (tb.Rows.Count > 0) { Tmp = "" + tb.Rows[0]["tbUsrNme"].ToString(); } tb.Dispose(); IzDataSource.Dispose(); return(Tmp); }
//''' <summary> //''' 依Tid取得Typ單一欄位資料 //''' </summary> //''' <param name="TopCdeS">前三碼</param> //''' <param name="TypTid">TID</param> //''' <param name="BackFieldNme">傳回的欄位值</param> //''' <returns></returns> //''' <remarks></remarks> public String getTypFeldByTid(String TopCdeS, String TypTid, String BackFieldNme) { IzDataSource IzDataSource = new IzDataSource(); IzDataSource.SelectString = "select * from tbTyp where tbTypFlg=1 and left(tbTypCde,3)=@TopCdeS and tbTypTid=@tbTypTid"; IzDataSource.ParametersClear(); IzDataSource.ParametersAdd("TopCdeS", TopCdeS); IzDataSource.ParametersAdd("tbTypTid", TypTid); System.Data.DataTable tb = IzDataSource.SelectDataTable(); String StrTmp = ""; if (tb.Rows.Count > 0) { StrTmp = tb.Rows[0][BackFieldNme].ToString(); } tb.Dispose(); IzDataSource.Dispose(); return(StrTmp); }