Exemple #1
0
 public static string ShowMxButton(Page page, out ButtonsModel main_bm, string tableName, string IdName, string IdValue, string PD_NOW_SERVERPK_NAME)
 {
     if (HttpContext.Current.Session["User"] == null)
     {
         PageShowText.GoLoginPath_List(page);
         main_bm = null;
         return null;
     }
     string userName = ((UserModel) HttpContext.Current.Session["User"]).UserName;
     main_bm = new ButtonsModel(userName);
     string mainServerPK = "";
     if ((IdValue != null) && (IdValue.Trim() != ""))
     {
         mainServerPK = new TB_PROJECT_Bll().GetServerPK(tableName, IdName, IdValue, PD_NOW_SERVERPK_NAME);
     }
     else
     {
         main_bm.IfSave = true;
         return "新建";
     }
     string str3 = page.Request.Url.ToString();
     int startIndex = str3.LastIndexOf("/") + 1;
     int num2 = str3.LastIndexOf("?");
     string path = (num2 < 0) ? str3.Substring(startIndex) : str3.Substring(startIndex, num2 - startIndex);
     UserModel model = new UserDal();
     DB_OPT dbo = new DB_OPT();
     string showButtonID = "";
     string buttonShowTxt = "";
     string str7 = "";
     string str8 = "";
     model.GetServiceStream(path, userName, mainServerPK, out showButtonID, out buttonShowTxt, out str7, out str8, dbo);
     string str9 = showButtonID.Trim();
     if (str9 != null)
     {
         if (!(str9 == "ibtcontrol_ibtaudit"))
         {
             if (str9 == "ibtcontrol_ibtapply")
             {
                 main_bm.IfApply = true;
                 if (buttonShowTxt != "")
                 {
                     main_bm.IbtApplyText = buttonShowTxt;
                 }
             }
         }
         else
         {
             main_bm.IfAudit = true;
             if (buttonShowTxt != "")
             {
                 main_bm.IbtAuditText = buttonShowTxt;
             }
         }
     }
     if (str8.Trim() != null)
     {
         string[] strArray = str8.Split(new char[] { '_' });
         if ((strArray.Length == 2) && (int.Parse(strArray[0]) == 1))
         {
             main_bm.IfSave = true;
         }
     }
     if (str7 != null)
     {
         string[] strArray2 = str7.Split(new char[] { '_' });
         if (strArray2.Length != 2)
         {
             return buttonShowTxt;
         }
         if (int.Parse(strArray2[0]) == 1)
         {
             main_bm.IfSetBack = true;
         }
         if (int.Parse(strArray2[1]) == 1)
         {
             main_bm.IfRollBack = true;
         }
     }
     return buttonShowTxt;
 }
Exemple #2
0
 public static string ShowBZ_MxButton_IsUP(Page page, out ButtonsModel main_bm, string serverPK, bool isQianShou)
 {
     if (HttpContext.Current.Session["User"] == null)
     {
         PageShowText.GoLoginPath_List(page);
         main_bm = null;
         return null;
     }
     string userName = ((UserModel) HttpContext.Current.Session["User"]).UserName;
     main_bm = new ButtonsModel(userName);
     string str2 = page.Request.Url.ToString();
     int startIndex = str2.LastIndexOf("/") + 1;
     int num2 = str2.LastIndexOf("?");
     string path = (num2 < 0) ? str2.Substring(startIndex) : str2.Substring(startIndex, num2 - startIndex);
     UserModel model = new UserDal();
     DB_OPT dbo = new DB_OPT();
     string showButtonID = "";
     string buttonShowTxt = "";
     string str6 = "";
     string str7 = "";
     model.GetServiceStream(path, userName, serverPK, out showButtonID, out buttonShowTxt, out str6, out str7, dbo);
     if (str7.Trim() != null)
     {
         string[] strArray = str7.Split(new char[] { '_' });
         if ((strArray.Length == 2) && (int.Parse(strArray[0]) == 1))
         {
             main_bm.IfSave = true;
         }
     }
     if (!isQianShou)
     {
         string str8 = showButtonID.Trim();
         if (str8 != null)
         {
             if (!(str8 == "ibtcontrol_ibtaudit"))
             {
                 if (str8 == "ibtcontrol_ibtapply")
                 {
                     main_bm.IfApply = true;
                     if (buttonShowTxt != "")
                     {
                         main_bm.IbtApplyText = buttonShowTxt;
                     }
                     else
                     {
                         buttonShowTxt = main_bm.IbtApplyText;
                     }
                 }
             }
             else
             {
                 main_bm.IfAudit = true;
                 if (buttonShowTxt != "")
                 {
                     main_bm.IbtAuditText = buttonShowTxt;
                 }
                 else
                 {
                     buttonShowTxt = main_bm.IbtAuditText;
                 }
             }
         }
         if (str6 != null)
         {
             string[] strArray2 = str6.Split(new char[] { '_' });
             if (strArray2.Length != 2)
             {
                 return buttonShowTxt;
             }
             if (int.Parse(strArray2[0]) == 1)
             {
                 main_bm.IfSetBack = true;
             }
             if (int.Parse(strArray2[1]) == 1)
             {
                 main_bm.IfRollBack = true;
             }
         }
     }
     return buttonShowTxt;
 }