Example #1
0
 public clsSupplierInfo CreateData(clsSupplierInfo data)
 {
     data.SupplierName  = txtSupplierName.Text.ToString().Trim();
     data.Phone         = Convert.ToInt32(txtPhone.Text.ToString().Trim());
     data.Address       = txtAddress.Text.ToString().Trim();
     data.ContactPerson = txtContactPerson.Text.ToString().Trim();
     data.ContactNumber = Convert.ToInt32(txtContactNo.Text.ToString().Trim());
     return(data);
 }
Example #2
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            String          strqu = "";
            clsSupplierInfo data  = new clsSupplierInfo();

            data  = CreateData(data);
            strqu = "Insert into tbl_SupplierInfo(SupplierName,Phone,Address,ContactPerson,ContactNumber) values('" + data.SupplierName + "','" + data.Phone + "','" + data.Address + "','" + data.ContactPerson + "','" + data.ContactNumber + "')";
            SqlHelper.ExecuteNonQuery(clsUtil.ConnectionString, CommandType.Text, strqu);
            MessageBox.Show("Save Data Sucessfully .");
            GetAllSupplierInfo();
            ClearAllData();
        }
Example #3
0
        private void btnupdate_Click(object sender, EventArgs e)
        {
            String          strQuery = "";
            clsSupplierInfo data1    = new clsSupplierInfo();

            data1    = UpdateData(data1);
            strQuery = " UPDATE [tbl_SupplierInfo] " +
                       "SET [SupplierName] ='" + data1.SupplierName + "'" +
                       ",[Phone]=' " + data1.Phone + "' " +
                       ",[Address]= '" + data1.Address + "' " +
                       ",[ContactPerson]= '" + data1.ContactPerson + "' " +
                       ",[ContactNumber]= '" + data1.ContactNumber + "' " +
                       "WHERE [SupplierId]=" + data1.SupplierId + " ";
            SqlHelper.ExecuteReader(clsUtil.ConnectionString, CommandType.Text, strQuery);
            MessageBox.Show("Update Data Sucessfully .");
            ClearAllData();
        }