예제 #1
0
        private void btnReg_Click(object sender, EventArgs e)
        {
            //Register Button
            this.Visible = false;
            //using deligates
            dgVisible    visibility = new dgVisible(Visibility_Changing);
            RegisterForm rfTemp     = new RegisterForm(visibility);

            rfTemp.Visible = true;
        }
예제 #2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            EmployeeRepository repTemp = new EmployeeRepository();

            //repTemp.Populate();
            this.Ds = repTemp.SearchLoginData(this.txtLoginID.Text, this.txtLoginPass.Text);

            // Needs to add password and title to employee table

            if (this.Ds.Tables[0].Rows.Count == 1)
            {
                string id       = this.Ds.Tables[0].Rows[0]["EmpId"].ToString();
                string name     = this.Ds.Tables[0].Rows[0]["EmpName"].ToString();
                string email    = this.Ds.Tables[0].Rows[0]["EmpEmail"].ToString();
                string address  = this.Ds.Tables[0].Rows[0]["EmpAddress"].ToString();
                string contact  = this.Ds.Tables[0].Rows[0]["EmpContactNumber"].ToString();
                string jobTitle = this.Ds.Tables[0].Rows[0]["EmpJobTitle"].ToString();

                if (this.Ds.Tables[0].Rows[0]["EmpJobTitle"].ToString() == "Manager")
                {
                    this.Visible = false;
                    dgVisible   visibility = new dgVisible(Visibility_Changing);
                    ManagerForm mgrTemp    = new ManagerForm(id, name, email, address, contact, visibility);
                    mgrTemp.Visible = true;
                }
                else
                {
                    this.Visible = false;
                    dgVisible    visibility = new dgVisible(Visibility_Changing);
                    WProfileForm wpTemp     = new WProfileForm(id, name, email, address, contact, jobTitle, visibility);
                    wpTemp.Visible = true;
                }
            }
            else
            {
                MessageBox.Show("Invalid User Name or Password!");
            }

            /*this.Visible = false;
             * dgVisible visibility = new dgVisible(Visibility_Changing);
             * /*WProfileForm wpTemp = new WProfileForm(visibility);
             * wpTemp.Visible = true;
             * ManagerForm mgrTemp = new ManagerForm(visibility);
             * mgrTemp.Visible = true;*/
        }
예제 #3
0
 public WProfileForm(string id, string name, string email, string address, string contact, string jobTitle, dgVisible temp)
 {
     InitializeComponent();
     this.WkName          = name;
     this.Email           = email;
     this.Address         = address;
     this.ID              = id;
     this.Contact         = contact;
     this.JobTitle        = jobTitle;
     this.LoginVisibility = temp;
 }
예제 #4
0
 public ManagerForm(string id, string name, string email, string address, string contact, dgVisible temp)
 {
     InitializeComponent();
     this.MngrName        = name;
     this.Email           = email;
     this.Address         = address;
     this.ID              = id;
     this.Contact         = contact;
     this.LoginVisibility = temp;
 }
예제 #5
0
 public RegisterForm(dgVisible temp)
 {
     InitializeComponent();
     this.LoginVisibility = temp;
 }