Ejemplo n.º 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!");
            }
        }
Ejemplo n.º 2
0
 public bool Insert(pos.EL.Registrations.Customers cus)
 {
     pos.DL.Registrations.Customers customerDL = new pos.DL.Registrations.Customers();
     if (customerDL.Insert(cus))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 3
0
 public Boolean Delete(pos.EL.Registrations.Customers cus)
 {
     pos.DL.Registrations.Customers customerDL = new pos.DL.Registrations.Customers();
     if (customerDL.Delete(cus))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 4
0
 public System.Data.DataTable List(pos.EL.Registrations.Customers cus)
 {
     String sQuery = "Select * from customers where 1=1 ";
     if (cus.Lastname != null)
     {
         sQuery = sQuery + " and lastname like '" + cus.Lastname.Trim() + "%'";
     }
     if (cus.Firstname != null)
     {
         sQuery = sQuery + " and lastname like '" + cus.Firstname.Trim() + "%'";
     }
     return Helper.executeQuery(sQuery);
 }
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Are you sure you want to delete?", "Message", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         CustomerInfo.Customerid = Convert.ToInt32(txtCustomerID.Text);
         bool isSuccessfull = CustomerBL.Delete(CustomerInfo);
         if (isSuccessfull)
         {
             MessageBox.Show("Record Successfully Updeted!");
             CustomerInfo           = new pos.EL.Registrations.Customers();
             dtCustomers.DataSource = CustomerBL.List(CustomerInfo);
         }
         else
         {
             MessageBox.Show("Addding Record Failed!");
         }
     }
 }
Ejemplo n.º 6
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!");
            }
        }
Ejemplo n.º 7
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!");
            }
        }
Ejemplo n.º 8
0
        public pos.EL.Registrations.Customers Select(pos.EL.Registrations.Customers cus)
        {

            String sQuery = "Select * from customers where 1=1 ";
            if (cus.Customerid > 0)
            {
                sQuery = sQuery + "and customerid=" + cus.Customerid;
            }

            System.Data.DataTable dt = Helper.executeQuery(sQuery);
            if (dt.Rows.Count >= 1)
            {
                cus.Customerid = Convert.ToInt32(dt.Rows[0]["customerid"].ToString());
                cus.Lastname = dt.Rows[0]["lastname"].ToString();
                cus.Firstname = dt.Rows[0]["firstname"].ToString();
                cus.Middleinitial = dt.Rows[0]["middleinitial"].ToString();
                cus.Age = Convert.ToInt32(Convert.ToInt32(dt.Rows[0]["age"].ToString()));
                cus.Tribe = dt.Rows[0]["tribe"].ToString();
                cus.Address = dt.Rows[0]["address"].ToString();
            }
            return null;
        }
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            CustomerInfo.Customerid    = Convert.ToInt32(txtCustomerID.Text);
            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;

            bool isSuccessfull = CustomerBL.Update(CustomerInfo);

            if (isSuccessfull)
            {
                MessageBox.Show("Record Successfully Updeted!");
                CustomerInfo           = new pos.EL.Registrations.Customers();
                dtCustomers.DataSource = CustomerBL.List(CustomerInfo);
            }
            else
            {
                MessageBox.Show("Addding Record Failed!");
            }
        }
Ejemplo n.º 10
0
 public pos.EL.Registrations.Customers Select(pos.EL.Registrations.Customers cus)
 {
     pos.DL.Registrations.Customers customerDL = new pos.DL.Registrations.Customers();
     return(customerDL.Select(cus));
 }
Ejemplo n.º 11
0
 public System.Data.DataTable List(pos.EL.Registrations.Customers cus)
 {
     pos.DL.Registrations.Customers customerDL = new pos.DL.Registrations.Customers();
     return(customerDL.List(cus));
 }
Ejemplo n.º 12
0
 public Boolean Insert(pos.EL.Registrations.Customers cus)
 {
     
     return Helper.executeNonQuery("insert into customers (lastname, firstname, middleinitial, age, address, tribe) values ('" + cus.Lastname + "', '" + cus.Firstname + "', '" + cus.Middleinitial + "', '" + cus.Age + "', '" + cus.Address + "', '" + cus.Tribe + "')");
 }
Ejemplo n.º 13
0
 public Boolean Delete(pos.EL.Registrations.Customers cus)
 {
     return Helper.executeNonQuery("delete from customers where customerid = '" + cus.Customerid + "'");
 }
Ejemplo n.º 14
0
 public Boolean Update(pos.EL.Registrations.Customers cus)
 {
     return Helper.executeNonQuery("update customers set lastname = '" + cus.Lastname + "',firstname = '" + cus.Firstname + "', middleinitial = '" + cus.Middleinitial + "', age = '" + cus.Age + "', address = '" + cus.Address + "', tribe = '" + cus.Tribe + "' where customerid = '" + cus.Customerid + "'");
 }
Ejemplo n.º 15
0
 private void frmCustomers_Load(object sender, EventArgs e)
 {
     CustomerInfo           = new pos.EL.Registrations.Customers();
     dtCustomers.DataSource = CustomerBL.List(CustomerInfo);
 }
Ejemplo n.º 16
0
 private void loaddata()
 {
     CustomerInfo           = new pos.EL.Registrations.Customers();
     dtCustomers.DataSource = CustomerBL.List(CustomerInfo);
 }