Example #1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string sql = @"select * from UserTable where Id='" + this.txtLoginId.Text + "' and Password='******';";

            this.Ds = this.Da.ExecuteQuery(sql);

            if (this.Ds.Tables[0].Rows.Count == 1)
            {
                if (this.Ds.Tables[0].Rows[0][4].ToString() == "Owner")
                {
                    this.Hide();
                    FrmOwnerProduct ownerProduct = new FrmOwnerProduct(this);
                    ownerProduct.Visible = true;
                }
                else if (this.Ds.Tables[0].Rows[0][4].ToString() == "Employee")
                {
                    this.Hide();
                    FrmEmployeeSelling employeeSelling = new FrmEmployeeSelling(this);
                    employeeSelling.Visible = true;
                }
            }
            else
            {
                MessageBox.Show("Enter valid id and password");
                txtLoginId.Text       = "";
                txtLoginPassword.Text = "";
            }
        }
Example #2
0
 public Form1(FrmEmployeeSelling employeeSelling) : this()
 {
     this.EmployeeSelling = employeeSelling;
 }