private void PML_CreatePO_Load(object sender, EventArgs e)
        {
            OrderGridFill();

            lbl_name.Text = PML_Login.chkName;
            priceAmount   = txt_price.Text;

            if (PML_Login.chkType == "Site Manager")
            {
                PML_SideNav_SiteMan sitMan = new PML_SideNav_SiteMan();
                this.pnl_CreatePO_SideNav.Controls.Add(sitMan.pnl_sideNav);
            }

            else if (PML_Login.chkType == "Supervisor")
            {
                PML_SideNav_Supervisor super = new PML_SideNav_Supervisor();
                this.pnl_CreatePO_SideNav.Controls.Add(super.pnl_sideNav);
            }

            else if (PML_Login.chkType == "Admin")
            {
                PML_SideNav_Admin admin = new PML_SideNav_Admin();
                this.pnl_CreatePO_SideNav.Controls.Add(admin.pnl_sideNav);
            }

            else if (PML_Login.chkType == "Accounting Staff")
            {
                PML_SideNav_Account acnt = new PML_SideNav_Account();
                this.pnl_CreatePO_SideNav.Controls.Add(acnt.pnl_sideNav);
            }

            else if (PML_Login.chkType == "Line Manager")
            {
                PML_SideNav_LineMan lineMan = new PML_SideNav_LineMan();
                this.pnl_CreatePO_SideNav.Controls.Add(lineMan.pnl_sideNav);
            }

            else
            {
                PML_SideNav_Other other = new PML_SideNav_Other();
                this.pnl_CreatePO_SideNav.Controls.Add(other.pnl_sideNav);
            }
        }
Exemplo n.º 2
0
        private void PML_PODeliveryStatus_Load(object sender, EventArgs e)
        {
            lbl_name.Text = PML_Login.chkName;

            if (PML_Login.chkType == "Site Manager")
            {
                PML_SideNav_SiteMan sitMan = new PML_SideNav_SiteMan()
                {
                    Dock     = DockStyle.Fill,
                    TopLevel = false,
                    TopMost  = true
                };

                this.pnl_POHistorySideNav.Controls.Add(sitMan);
                sitMan.Show();
            }

            else if (PML_Login.chkType == "Supervisor")
            {
                PML_SideNav_Supervisor super = new PML_SideNav_Supervisor()
                {
                    Dock     = DockStyle.Fill,
                    TopLevel = false,
                    TopMost  = true
                };

                this.pnl_POHistorySideNav.Controls.Add(super);
                super.Show();
            }

            else if (PML_Login.chkType == "Admin")
            {
                PML_SideNav_Admin admin = new PML_SideNav_Admin()
                {
                    Dock     = DockStyle.Fill,
                    TopLevel = false,
                    TopMost  = true
                };

                this.pnl_POHistorySideNav.Controls.Add(admin);
                admin.Show();
            }

            else if (PML_Login.chkType == "Accounting Staff")
            {
                PML_SideNav_Account acnt = new PML_SideNav_Account()
                {
                    Dock     = DockStyle.Fill,
                    TopLevel = false,
                    TopMost  = true
                };

                this.pnl_POHistorySideNav.Controls.Add(acnt);
                acnt.Show();
            }

            else if (PML_Login.chkType == "Line Manager")
            {
                PML_SideNav_LineMan lineMan = new PML_SideNav_LineMan()
                {
                    Dock     = DockStyle.Fill,
                    TopLevel = false,
                    TopMost  = true
                };

                this.pnl_POHistorySideNav.Controls.Add(lineMan);
                lineMan.Show();
            }

            else
            {
                PML_SideNav_Other other = new PML_SideNav_Other()
                {
                    Dock     = DockStyle.Fill,
                    TopLevel = false,
                    TopMost  = true
                };

                this.pnl_POHistorySideNav.Controls.Add(other);
                other.Show();
            }
            dgv_Delivary_status.DataSource = procurement_delivery_status.FillGridByRef();
        }
        private void PML_UserProfile_Load(object sender, EventArgs e)
        {
            lbl_name.Text     = PML_Login.chkName;
            lbl_profName.Text = PML_Login.chkName;
            txt_name.Text     = PML_Login.chkName;

            if (PML_Login.chkType == "Site Manager")
            {
                PML_SideNav_SiteMan sitMan = new PML_SideNav_SiteMan();
                this.pnl_ProfileSideNav.Controls.Add(sitMan.pnl_sideNav);
            }

            else if (PML_Login.chkType == "Supervisor")
            {
                PML_SideNav_Supervisor super = new PML_SideNav_Supervisor();
                this.pnl_ProfileSideNav.Controls.Add(super.pnl_sideNav);
            }

            else if (PML_Login.chkType == "Admin")
            {
                PML_SideNav_Admin admin = new PML_SideNav_Admin();
                this.pnl_ProfileSideNav.Controls.Add(admin.pnl_sideNav);
            }

            else if (PML_Login.chkType == "Accounting Staff")
            {
                PML_SideNav_Account acnt = new PML_SideNav_Account();
                this.pnl_ProfileSideNav.Controls.Add(acnt.pnl_sideNav);
            }

            else if (PML_Login.chkType == "Line Manager")
            {
                PML_SideNav_LineMan lineMan = new PML_SideNav_LineMan();
                this.pnl_ProfileSideNav.Controls.Add(lineMan.pnl_sideNav);
            }

            else
            {
                PML_SideNav_Other other = new PML_SideNav_Other();
                this.pnl_ProfileSideNav.Controls.Add(other.pnl_sideNav);
            }

            using (MySqlConnection mysqlCon = new MySqlConnection(connectionString))
            {
                mysqlCon.Open();
                String          sql  = "SELECT Password FROM pml_user WHERE Username='******'";
                MySqlCommand    mySc = new MySqlCommand(sql, mysqlCon);
                MySqlDataReader myDr = mySc.ExecuteReader();

                while (myDr.Read())
                {
                    txt_pw.Text = myDr.GetValue(0).ToString();
                }
            }

            using (MySqlConnection mysqlCon = new MySqlConnection(connectionString))
            {
                mysqlCon.Open();
                String          sql  = "SELECT Email FROM pml_user WHERE Username='******'";
                MySqlCommand    mySc = new MySqlCommand(sql, mysqlCon);
                MySqlDataReader myDr = mySc.ExecuteReader();

                while (myDr.Read())
                {
                    txt_mail.Text = myDr.GetValue(0).ToString();
                }
            }

            txt_ID.Text = PML_Login.chkID;
        }