protected void btnAdd_Click(object sender, EventArgs e) { Employ employ = new Employ(); try { employ.Empno = Convert.ToInt32(txtEmpno.Text); employ.Name = txtname.Text; employ.Department = txtDept.Text; employ.Designation = txtDesig.Text; employ.Basic = Convert.ToInt32(txtbasic.Text); bool status = EmployBLL.UpdateEmployBLL(employ); if (status) { ScriptManager.RegisterStartupScript(this, this.GetType(), "M1", "alert('Employ Details Updated')", true); txtEmpno.Text = ""; txtname.Text = ""; txtDept.Text = ""; txtDesig.Text = ""; txtbasic.Text = ""; } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, this.GetType(), "error1", "alert('" + ex.Message + "')", true); } }
public ActionResult Edit(Employ employ) { bool status = EmployBLL.UpdateEmployBLL(employ); if (status) { return(RedirectToAction("Index", "Employ")); } return(View()); }