Пример #1
0
        private void btn_shelf_back_Click(object sender, EventArgs e)
        {
            ManagerLanding Objmanagerlanding = new ManagerLanding();

            this.Hide();
            Objmanagerlanding.Show();
        }
        private void btn_Login_Click(object sender, EventArgs e)
        {
            Name        = txt_username.Text;
            Designation = cmb_designation.Text;
            string query = "SELECT * FROM USER_TABLE WHERE USER_NAME= '" + txt_username.Text.Trim() + "' and PASSWORD='******' and DESIGNATION='" + cmb_designation.Text.ToString() + "' ";

            adp = new SqlDataAdapter(query, con);
            dt  = new DataTable();
            adp.Fill(dt);
            if (dt.Rows.Count == 1)
            {
                if (cmb_designation.Text == "ADMIN")
                {
                    AdminLanding objadminlanding = new AdminLanding();
                    this.Hide();
                    objadminlanding.Show();
                }
                else if (cmb_designation.Text == "MANAGER")
                {
                    ManagerLanding objmanagerlanding = new ManagerLanding();
                    this.Hide();
                    objmanagerlanding.Show();
                    String designation = cmb_designation.Text;
                }
                else if (cmb_designation.Text == "SALESMAN")
                {
                    SalesmanLanding objsalesmanlanding = new SalesmanLanding();
                    this.Hide();
                    objsalesmanlanding.Show();
                    objsalesmanlanding.ab(Name.ToString());
                }
                else
                {
                    MessageBox.Show("Select designation");
                }
            }
            else
            {
                MessageBox.Show("Data is incorrect");
            }
        }