public bool add_cus() { string cname = txtCusName.Text; string cemail = txtEmail.Text; if (ck.checkstringnull(cname)) { if (ck.checkstringnull(cemail)) { if (ck.checkEmail(cemail)) { if (ck.checkstring(cemail, 100)) { if (ck.checkstring(cname, 50)) { int n = cl.checkCus(cname, cemail); if (n == -1) { c = new customer_detail(); c.cus_name = cname; c.email = cemail; cl.AddCustomer(c); } else { c = cl.getCusbyID(n); } return(true); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Name exceeds the required length')", true); return(false); } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Email exceeds the required length')", true); return(false); } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Your Email Is Incorrect')", true); return(false); } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Please Type Your Email')", true); return(false); } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Please Type Your Name')", true); return(false); } }