public Boolean Insert(Pos.EL.Registration.Customer cus) { return(Helper.ExecuteNonQuery ("Insert into tbl_customer (Lastname, Firstname, MiddleInitial, ExtensionName,BirthDate, Age, Address, Tribe, Religion, CivilStatus)" + " Values ('" + cus.LastName1 + "','" + cus.FirstName1 + "','" + cus.MiddleInitial1 + "','" + cus.ExtensionName1 + "','" + cus.BirthDate1 + "','" + cus.Age1 + "','" + cus.Address1 + "','" + cus.Tribe1 + "','" + cus.Religion1 + "','" + cus.CivilStatus1 + "') ")); }
private void Btn_create_Click(object sender, EventArgs e) { Pos.EL.Registration.Customer CustomerInfo = new Pos.EL.Registration.Customer(); CustomerInfo.LastName1 = tb_lastname.Text; CustomerInfo.FirstName1 = tb_firstname.Text; CustomerInfo.MiddleInitial1 = tb_middleinitial.Text; CustomerInfo.Age1 = Convert.ToInt32(tb_age.Text); CustomerInfo.Address1 = tb_address.Text; CustomerInfo.Tribe1 = tb_tribe.Text; CustomerInfo.ExtensionName1 = tb_extensionname.Text; CustomerInfo.Religion1 = tb_religion.Text; CustomerInfo.BirthDate1 = dateTimePicker1.Text; CustomerInfo.CivilStatus1 = tb_civilstatus.Text; Pos.BL.Registration.Customer CustomerBL = new Pos.BL.Registration.Customer(); bool isSuccessfull = CustomerBL.Insert(CustomerInfo); if (isSuccessfull) { MessageBox.Show("Record Successfully Addded!"); } else { MessageBox.Show("Addding Record Failed!"); } }
public bool Insert(Pos.EL.Registration.Customer cus) { Pos.DL.Registration.CustomersRegistration customerDL = new Pos.DL.Registration.CustomersRegistration(); if (customerDL.Insert(cus)) { return(true); } else { return(false); } }