protected void Page_Load(object sender, EventArgs e)
 {
     if (UserAcc.UserExpired())
     {
         SetBodyEventOnLoad(SystemFunction.PopupLogin());
     }
     else
     {
         if (!IsPostBack)
         {
             PTTGC_EPIEntities db  = new PTTGC_EPIEntities();
             string            str = Request.QueryString["strid"];
             if (!string.IsNullOrEmpty(str))
             {
                 int nFacID = SystemFunction.GetIntNullToZero(STCrypt.Decrypt(str));
                 hdfFacID.Value = str;
                 ltrCreate.Text = "<a class=\"btn btn-primary btn-sm btn-block\" href=\"admin_asset_update.aspx?strid=" + HttpUtility.UrlEncode(str) + "\"><i class=\"fa fa-plus\"></i>&nbsp;Create Sub-facility</a>";
                 var itemHeader = db.mTFacility.FirstOrDefault(w => w.ID == nFacID);
                 if (itemHeader != null)
                 {
                     var itemCompany = db.mTCompany.FirstOrDefault(w => w.ID == itemHeader.CompanyID);
                     ltrHeader.Text = "<a href='admin_company_lst.aspx' style='color:white'>Organization</a> >  <a style='color:white' href='admin_facility_lst.aspx?strid=" + HttpUtility.UrlEncode(STCrypt.Encrypt(itemCompany.ID + "")) + "'> " + itemCompany.Name + "</a> > " + itemHeader.Name;//กำหนด Header
                 }
             }
             SystemFunction.BindDropdownPageSize(ddlPageSize, null);
         }
     }
 }
    private void BindDDL()
    {
        SystemFunction.ListYearsDESC(ddlYear, "", "en-US", "th-TH", short.Parse(System.Configuration.ConfigurationSettings.AppSettings["startYear"].ToString()));
        SystemFunction.BindDropdownPageSize(ddlPageSize, null);

        ddlGroupIndicator.DataSource     = db.mTIndicator.OrderBy(o => o.nOrder).ToList();
        ddlGroupIndicator.DataValueField = "ID";
        ddlGroupIndicator.DataTextField  = "Indicator";
        ddlGroupIndicator.DataBind();
        ddlGroupIndicator.Items.Insert(0, new ListItem("- Select Indicator -", ""));

        int[] arrWFStatus = new int[] { 28, 29, 30, 32, 33, 34 };
        ddlStatus.DataSource     = db.TStatus_Workflow.Where(w => arrWFStatus.Contains(w.nStatustID) && w.cTypeUse == "TNF" && w.cActive == "Y").OrderBy(o => o.sShorttStatus).ToList();
        ddlStatus.DataValueField = "nStatustID";
        ddlStatus.DataTextField  = "sShorttStatus";
        ddlStatus.DataBind();
        ddlStatus.Items.Insert(0, new ListItem("- Select Status -", ""));
        ddlStatus.Items.Insert(1, new ListItem("Waiting Transfer", "0"));

        ddlFacility.DataSource = (from fptt in db.mTFacility.Where(w => w.cDel == "N" && w.cActive == "Y" && w.nLevel == 0 && w.CompanyID == 1)
                                  from fgc in db.mTFacility.Where(w => w.cDel == "N" && w.cActive == "Y" && w.nHeaderID == fptt.ID)
                                  select new
        {
            fgc.ID,
            fgc.Name
        }).OrderBy(o => o.Name).ToList();
        ddlFacility.DataTextField  = "Name";
        ddlFacility.DataValueField = "ID";
        ddlFacility.DataBind();
        ddlFacility.Items.Insert(0, new ListItem("- Select Facility -", ""));
    }
Example #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (UserAcc.UserExpired())
        {
            SetBodyEventOnLoad(SystemFunction.PopupLogin());
        }
        else
        {
            if (!IsPostBack)
            {
                int Prms = SystemFunction.GetPermissionMenu(34);
                hdfPrmsMenu.Value = Prms + "";
                IsView            = Prms == 1;
                if (IsView)
                {
                    ckbAll.Visible    = false;
                    btnDel.Visible    = false;
                    btnCreate.Visible = false;
                }

                SystemFunction.BindDropdownPageSize(ddlPageSize, null);
                BlindDDL();
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (UserAcc.UserExpired())
        {
            SetBodyEventOnLoad(SystemFunction.PopupLogin());
        }
        else
        {
            if (!IsPostBack)
            {
                SystemFunction.BindDropdownPageSize(ddlPageSize, null);
                GETDDL();

                int Prms = SystemFunction.GetPermissionMenu(36);
                //hdfPrmsMenu.Value = Prms + "";
                //bool isView = Prms == 1;
                //if (isView)
                //{
                //    DivCreate_Workflow.Visible = false;
                //    ckbAll.Visible = false;
                //    btnDel.Visible = false;
                //}
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (UserAcc.UserExpired())
        {
            SetBodyEventOnLoad(SystemFunction.PopupLogin());
        }
        else
        {
            if (!IsPostBack)
            {
                SystemFunction.BindDropdownPageSize(ddlPageSize, null);

                int nRole = UserAcc.GetObjUser().nRoleID;
                if (nRole == 3 || nRole == 4)
                {
                    hdfPrmsMenu.Value = "2";
                }
                else
                {
                    hdfPrmsMenu.Value = "0";
                }

                BindDDL();
            }
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (UserAcc.UserExpired())
     {
         SetBodyEventOnLoad(SystemFunction.PopupLogin());
     }
     else
     {
         if (!IsPostBack)
         {
             SystemFunction.BindDropdownPageSize(ddlPageSize, null);
         }
     }
 }
Example #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         SystemFunction.BindDropdownPageSize(ddlPageSize, null);
         SystemFunction.BindDropdownPageSize(ddlPageSizeGC, null);
         if (!UserAcc.UserExpired())
         {
             string str = Request.QueryString["strid"];
             if (!string.IsNullOrEmpty(str))
             {
                 if (SystemFunction.GetIntNullToZero(STCrypt.Decrypt(str)) != 1)
                 {
                     SetBodyEventOnLoad("$('div[id$=divContentGC]').show();$('div[id$=divContent]').hide()");
                 }
                 else
                 {
                     SetBodyEventOnLoad("$('div[id$=divContentGC]').hide();$('div[id$=divContent]').show()");
                 }
                 PTTGC_EPIEntities db = new PTTGC_EPIEntities();
                 int nComID           = SystemFunction.GetIntNullToZero(STCrypt.Decrypt(str));
                 hdfComID.Value = STCrypt.Encrypt(nComID + "");
                 var itemCompany = db.mTCompany.FirstOrDefault(w => w.ID == nComID && w.cDel == "N");
                 if (itemCompany != null)
                 {
                     ltrHeader.Text = "<a href='admin_company_lst.aspx' style='color:white'>Organization</a> > " + itemCompany.Name;//กำหนด Header
                 }
                 ltrCreateGC.Text = "<a class=\"btn btn-primary btn-sm btn-block\" href=\"admin_facility_update.aspx?strid=" + HttpUtility.UrlEncode(STCrypt.Encrypt(nComID + "")) + "\"><i class=\"fa fa-plus\"></i>&nbsp;Create Facility</a>";
                 ltrCreate.Text   = "<a class=\"btn btn-primary btn-sm btn-block\" href=\"admin_facility_update.aspx?strid=" + HttpUtility.UrlEncode(STCrypt.Encrypt(nComID + "")) + "\"><i class=\"fa fa-plus\"></i>&nbsp;Create Facility</a>";
             }
             else
             {
                 SetBodyEventOnLoad(SystemFunction.DialogWarningRedirect(SystemFunction.Msg_HeadWarning, "Invalid Data", "admin_company_lst.aspx"));// กรณีเข้ามาด้วย link ที่ไม่มี Querystring
             }
         }
         else
         {
             SetBodyEventOnLoad(SystemFunction.PopupLogin());
         }
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (UserAcc.UserExpired())
     {
         SetBodyEventOnLoad(SystemFunction.PopupLogin());
     }
     else
     {
         if (!IsPostBack)
         {
             SystemFunction.BindDropdownPageSize(ddlPageSize, null);
             string OperationID = Request.QueryString["strid"];
             if (!string.IsNullOrEmpty(OperationID))
             {
                 int nID = int.Parse(STCrypt.Decrypt(OperationID));
                 hdfEncryptOperationID.Value = OperationID;
                 hdfOperationID.Value        = STCrypt.Decrypt(hdfEncryptOperationID.Value);
                 SETDATA(nID);
             }
         }
     }
 }