Example #1
0
 public static void ShowListButton(Page page, out ButtonsModel model, string PD_PROJECT_CODE)
 {
     if (HttpContext.Current.Session["User"] == null)
     {
         PageShowText.GoLoginPath_List(page);
         model = null;
     }
     else
     {
         string userName = ((UserModel) HttpContext.Current.Session["User"]).UserName;
         model = 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 model2 = new UserDal();
         DB_OPT dbo = new DB_OPT();
         int isShow = 0;
         string showtxt = "";
         model2.GetServiceCode("ibtcontrol_ibtadd", path, userName, out isShow, out showtxt, dbo);
         if (isShow == 1)
         {
             model.IfAdd = true;
             if (showtxt != "")
             {
                 model.IbtAddText = showtxt;
             }
         }
         model2.GetServiceCode("ibtcontrol_ibtdo", path, userName, out isShow, out showtxt, dbo);
         if (isShow == 1)
         {
             model.IfDo = true;
             if (showtxt != "")
             {
                 model.IbtDoText = showtxt;
             }
         }
         model2.GetServiceCode("ibtcontrol_ibtdelete", path, userName, out isShow, out showtxt, dbo);
         if (isShow == 1)
         {
             model.IfDelete = true;
             if (showtxt != "")
             {
                 model.IbtDeleteText = showtxt;
             }
         }
     }
 }