示例#1
0
        private void button_login_Click(object sender, EventArgs e)
        {
            string         username        = textBox_username.Text;
            string         password        = textBox_password.Text;
            string         querySelectUser = "******" + username + "' and password='******'";
            SqlDataAdapter adp_selectUser  = new SqlDataAdapter(querySelectUser, conn);
            DataSet        dset            = new DataSet();

            adp_selectUser.Fill(dset, "type");
            int log = dset.Tables[0].Rows.Count;

            if (log > 0)
            {
                if (dset.Tables[0].Rows[0].ItemArray[3].ToString() == "0")
                {
                    listorder L_order = new listorder();
                    L_order.Show();
                }
                else if (dset.Tables[0].Rows[0].ItemArray[3].ToString() == "1")
                {
                    Form_kasir kasir = new Form_kasir();
                    kasir.Show();
                }
                else if (dset.Tables[0].Rows[0].ItemArray[3].ToString() == "2")
                {
                    gudang g = new gudang();
                    g.Show();
                }
            }
            else
            {
                MessageBox.Show("Username atau password tidak terdaftar");
            }
        }
示例#2
0
 public add_stock(gudang frm)
 {
     InitializeComponent();
     conn     = new SqlConnection(connection);
     dgvStock = frm;
 }