public bool sellFlatTo(ClientManager cl) { SqlParameter[] sp = new SqlParameter[4]; sp[0] = new SqlParameter("@FlatID", cl.FlatID); sp[1] = new SqlParameter("@ClientName", cl.ClientName); sp[2] = new SqlParameter("@ContactNo", cl.ContactNo); sp[3] = new SqlParameter("@DepositAmout", cl.DepositAmount); return datalayer.Execute_NonQuery("sp_SellFlat", CommandType.StoredProcedure, sp); }
private void btnSell_Click(object sender, EventArgs e) { ClientManager cm = new ClientManager(); cm.FlatID = FlatID; cm.ClientName = txtClientName.Text; cm.ContactNo = txtContactNo.Text; cm.DepositAmount = Convert.ToInt64(txtDownpayment.Text); bool res = cm.sellFlatTo(cm); if (res) { MessageBox.Show("Flat Sold"); } else { MessageBox.Show("Error"); } }