protected void save_Data(object sender, EventArgs e) { string company_id = Request.QueryString["company_id"]; if ((!string.IsNullOrEmpty(company_id.Trim())) && (!company_id.Trim().Equals("0"))) { string company_name = txt_company_name.Value; string password = txt_password.Value; string phoneNumber = txt_phoneNumber.Value; bool Confirm = (companyConfirm.Checked) ? true : false; if ((string.IsNullOrWhiteSpace(company_name)) || (string.IsNullOrWhiteSpace(password)) || (string.IsNullOrWhiteSpace(phoneNumber))) { ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('All fields required.');", true); return; } if (CompanyRepos.updateCompanyInfo(new tbl_company { company_id = int.Parse(company_id), password = password.Trim(), company_name = company_name.Trim(), phoneNumber = phoneNumber.Trim(), isConfirmed = Confirm })) { ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('Updated Successfully.');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('Something went wrong.');", true); } } else { ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('Something went wrong.');", true); } }