Example #1
0
        private void btnDeleteAccount_Click(object sender, EventArgs e)
        {
            int rowsAffected = dataAccess.Delete("Customers", "User_Id", id.ToString());

            if (rowsAffected > 0)
            {
                rowsAffected = dataAccess.Delete("Users", "Id", id.ToString());
                if (rowsAffected > 0)
                {
                    MessageBox.Show("Account Deleted Successfully");
                    DataTable   customersTable = dataAccess.GetData <Customers>($"where Is_verified = '{false}'");
                    EmpShowForm es             = new EmpShowForm(usersTable, customersTable, (int)Entities.Show.EmployeeShow.varifyCustomers);
                    es.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Something Went Wrong!!!");
                }
            }
            else
            {
                MessageBox.Show("Something Went Wrong!!!");
            }
        }
Example #2
0
        private void lblBack_Click(object sender, EventArgs e)
        {
            DataTable   unverifiedCustomersTable = dataAccess.GetData <Customers>($"where Is_verified = '{false}'");
            EmpShowForm sh = new EmpShowForm(usersTable, unverifiedCustomersTable, (int)Entities.Show.EmployeeShow.varifyCustomers);

            sh.Show();
            this.Hide();
        }
Example #3
0
        private void lblServiceHistory_Click(object sender, EventArgs e)
        {
            string      sql           = $"select * from Product where Sending_Manager_id = '{usersTable.Rows[0].Field<int>("Id")}' or Receiving_Manager_id = '{usersTable.Rows[0].Field<int>("Id")}'";
            DataTable   productsTable = dataAccess.Execute(sql);
            EmpShowForm sh            = new EmpShowForm(usersTable, productsTable, (int)Entities.Show.EmployeeShow.serviceHistory);

            sh.Show();
            this.Hide();
        }
Example #4
0
        private void btnVerifiedAccount_Click(object sender, EventArgs e)
        {
            Customers customers    = setCustomers();
            int       rowsAffected = dataAccess.Insert <Customers>(customers, true);

            if (rowsAffected > 0)
            {
                MessageBox.Show("Customer Verified Successfully");
                this.Dispose();
                DataTable   CustomersTable = dataAccess.GetData <Customers>($"where Is_verified = '{false}'");
                EmpShowForm sh             = new EmpShowForm(usersTable, CustomersTable, (int)Entities.Show.EmployeeShow.varifyCustomers);
                sh.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Something Went Wrong!!!");
            }
        }