示例#1
0
 private void btnUpdateEmp_Click(object sender, EventArgs e)
 {
     if (gvEmp.SelectedCells[0].Value != null)
     {
         id = Convert.ToInt32(gvEmp.SelectedCells[0].Value.ToString());
         InventoryManagement.updateEmp();
     }
 }
示例#2
0
        private void btnCancelEmp_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("Are you sure?", "Confirm", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

            if (dr == DialogResult.Yes)
            {
                InventoryManagement.empBtnClicked();
            }
        }
示例#3
0
 private void btnUpdateProduct_Click(object sender, EventArgs e)
 {
     if (gridProducts.SelectedCells[0].Value != null)
     {
         id = Convert.ToInt32(gridProducts.SelectedCells[0].Value.ToString());
         InventoryManagement.updatePro();
     }
     else
     {
         lblError.Text = "Select a product first.";
     }
 }
示例#4
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            inventoryDataContext idc = new inventoryDataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\09\OneDrive\C#\InventoryManagement\InventoryManagement\inventory_management.mdf;Integrated Security=True");

            int id = 0;

            if (!tbUser.Text.ToString().Equals(""))
            {
                id = Convert.ToInt32(tbUser.Text.ToString());
            }

            string pass = tbPass.Text.ToString();

            var row       = idc.logins.SingleOrDefault(r => r.user_id == id);
            var user_pass = row != null ? row.user_pass : String.Empty;
            var user_type = row != null ? row.user_type : String.Empty;

            if (id != 0 && !pass.Equals(""))
            {
                if (user_pass.ToString().Equals(pass))
                {
                    if (user_type.ToString().Equals("admin"))
                    {
                        InventoryManagement.adminLoginButtonClicked();
                    }
                    else
                    {
                        InventoryManagement.UserBtnClicked();
                    }
                }
                else
                {
                    MessageBox.Show("Password or username incorrect!");
                }
            }
            else
            {
                if (id == 0)
                {
                    MessageBox.Show("Username incorrect!!");
                }
                else
                {
                    MessageBox.Show("Username and Password field required!");
                }
            }
        }
示例#5
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            inventoryDataContext idc = new inventoryDataContext(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\FASHAKINALEALEXANDER\Documents\FProjects\InventoryManagementSystem-master\InventoryManagement\InventoryManagement\inventory_management.mdf;Integrated Security=True");

            if (!tbUser.Text.Equals("") || !tbPass.Text.Equals(""))
            {
                if (tbUser.Text.Equals("admin") || tbPass.Text.Equals("1"))
                {
                    InventoryManagement.adminLoginButtonClicked();
                }
                else if (tbUser.Text.Equals("user") || tbPass.Text.Equals("2"))
                {
                    InventoryManagement.UserBtnClicked();
                }
                else
                {
                    MessageBox.Show("Password or username incorrect");
                }
            }
            else
            {
                MessageBox.Show("Please fill in the details");
            }

            /* //int id = 0;
             * if(!tbUser.Text.ToString().Equals(""))
             *
             *
             * {
             * if(!tbUser.Text.Equals(""))
             * id = Convert.ToInt32(tbUser.Text.ToString());
             * }
             *
             * string pass = tbPass.Text.ToString();
             *
             * var row = idc.logins.SingleOrDefault(r => r.user_id == id);
             * var user_pass = row != null ? row.user_pass : String.Empty;
             * var user_type = row != null ? row.user_type : String.Empty;
             *
             * if(id != 0 && !pass.Equals(""))
             * {
             *  if(user_pass.ToString().Equals(pass))
             *  {
             *      if(user_type.ToString().Equals("admin"))
             *      {
             *          InventoryManagement.adminLoginButtonClicked();
             *      }
             *      else
             *      {
             *          InventoryManagement.UserBtnClicked();
             *      }
             *  }
             *  else
             *  {
             *      MessageBox.Show("Password or username incorrect!");
             *  }
             * }
             * else
             * {
             *  if(id == 0)
             *  {
             *      MessageBox.Show("Username incorrect!!");
             *  }
             *  else
             *  {
             *      MessageBox.Show("Username and Password field required!");
             *  }
             * }
             */
        }
示例#6
0
 private void btnSales_Click(object sender, EventArgs e)
 {
     InventoryManagement.UserBtnClicked();
 }
示例#7
0
 private void btnInventory_Click(object sender, EventArgs e)
 {
     InventoryManagement.inventoryButtonClicked();
 }
示例#8
0
 private void btnEmp_Click(object sender, EventArgs e)
 {
     InventoryManagement.empBtnClicked();
 }
示例#9
0
 private void btnLogout_Click(object sender, EventArgs e)
 {
     InventoryManagement.logout();
 }
示例#10
0
 private void btnAddEmp_Click(object sender, EventArgs e)
 {
     InventoryManagement.addEmp();
 }
示例#11
0
 private void btnAddProduct_Click(object sender, EventArgs e)
 {
     InventoryManagement.addPro();
 }
示例#12
0
 private void btnUEdit_Click(object sender, EventArgs e)
 {
     InventoryManagement.updateEmp();
 }
示例#13
0
 private void btnBrands_Click(object sender, EventArgs e)
 {
     InventoryManagement.brandsBtnClicked();
 }
示例#14
0
 private void btnCategorie_Click(object sender, EventArgs e)
 {
     InventoryManagement.catsBtnClicked();
 }
示例#15
0
 private void btnProduct_Click(object sender, EventArgs e)
 {
     InventoryManagement.productBtnClicked();
 }
示例#16
0
 private void btnBack_Click(object sender, EventArgs e)
 {
     InventoryManagement.adminLoginButtonClicked();
 }