private void simpleButton3_Click(object sender, EventArgs e) { bool isvalid = false; if (txtfno.EditValue== null) { txtfno.ErrorText = "Enter File No"; isvalid = true; } if (txtmemno.EditValue == null) { txtmemno.ErrorText = "Enter Member No"; isvalid = true; } if (txtcompname.EditValue == null) { txtcompname.ErrorText = "Enter Company name"; isvalid = true; } if (txtname.EditValue == null) { txtname.ErrorText = "Enter Patient name"; isvalid = true; } if (!isvalid ) { var bl = new BlInsuranceCustomer(); var tb = new DsMaster().INSCUSTOMERS; var dr = (DsMaster.INSCUSTOMERSRow) tb.NewRow(); dr.TID = Tid; dr.FILENO = txtfno.Text; dr.POLICYNO =int.Parse(txtmemno.EditValue.ToString()); dr.CUSTNO = txtcompname.Text; dr.PATNAME = txtname.Text; bl.dr = dr; var msg = bl.DoSave(); if (msg == "1") { if ( XtraMessageBox.Show("Saved do you want to add more", "Patient Details", MessageBoxButtons.YesNo) == DialogResult.Yes) { Tid = 0; txtfno.Text = string.Empty; txtfno.Text = string.Empty; txtmemno.Text = string.Empty; txtcompname.Text = string.Empty; txtname.Text = string.Empty; } else { Custno = txtname.Text; Custpayment = cutomerpayment.EditValue.ToString(); Close(); } } else { XtraMessageBox.Show(msg, "Patient Details", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }