示例#1
0
        private void BtnEdit_Click(object sender, EventArgs e)
        {
            pos.EL.Registrations.Customers CustomerInfo = new pos.EL.Registrations.Customers();
            CustomerInfo.Customerid    = Convert.ToInt32(txtCustomersID.Text);
            CustomerInfo.Lastname      = txtLastName.Text;
            CustomerInfo.Firstname     = txtLastName.Text;
            CustomerInfo.Middleinitial = txtMiddleInitial.Text;
            CustomerInfo.Age           = Convert.ToInt32(txtAge.Text);
            CustomerInfo.Address       = txtAddress.Text;
            CustomerInfo.Tribe         = txtTribe.Text;


            pos.BL.Registrations.Customers CustomerBL = new pos.BL.Registrations.Customers();
            bool isSuccessfull = CustomerBL.Update(CustomerInfo);

            if (isSuccessfull)
            {
                MessageBox.Show("Record Successfully Updated!");
                loaddata();
            }
            else
            {
                MessageBox.Show("Updating Record Failed!");
            }
        }
示例#2
0
        private void BtnDelete_Click(object sender, EventArgs e)
        {
            pos.EL.Registrations.Customers CustomerInfo = new pos.EL.Registrations.Customers();
            CustomerInfo.Customerid = Convert.ToInt32(txtCustomersID.Text);

            pos.BL.Registrations.Customers CustomerBL = new pos.BL.Registrations.Customers();
            bool isSuccessfull = CustomerBL.Delete(CustomerInfo);

            if (isSuccessfull)
            {
                MessageBox.Show("Record Successfully Deleted!");
                loaddata();
            }
            else
            {
                MessageBox.Show("Deleting Record Failed!");
            }
        }
示例#3
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            pos.EL.Registrations.Customers CustomerInfo = new pos.EL.Registrations.Customers();
            CustomerInfo.Lastname      = txtLastName.Text;
            CustomerInfo.Firstname     = txtFirstName.Text;
            CustomerInfo.Middleinitial = txtMIddleName.Text;
            CustomerInfo.Age           = Convert.ToInt32(txtAge.Text);
            CustomerInfo.Address       = txtAddress.Text;
            CustomerInfo.Tribe         = txtTribe.Text;
            pos.BL.Registrations.Customers CustomerBL = new pos.BL.Registrations.Customers();
            bool isSuccessfull = CustomerBL.Insert(CustomerInfo);

            if (isSuccessfull)
            {
                MessageBox.Show("Record Successfully Addded!");
            }
            else
            {
                MessageBox.Show("Addding Record Failed!");
            }
        }