public JsonResult AddDesignation(Designation rec) { DesignationServices services = new DesignationServices(); services.AddDesignation(rec); return(Json(new { msg = "save" }, JsonRequestBehavior.AllowGet)); }
public ActionResult DesignationList() { DesignationServices services = new DesignationServices(); var list = services.List(); return(Json(list, JsonRequestBehavior.AllowGet)); }
protected void btnSave_Click(object sender, EventArgs e) { model.DesignationName = txtDesignationName.Text; DesignationServices.Insert(model); Clear(); DataGvProperties(); lblError.Text = "Record Inserted."; }
protected void btnUpdate_Click(object sender, EventArgs e) { model.Id = Convert.ToInt32(txtId.Text); model.DesignationName = txtDesignationName.Text; DesignationServices.Update(model); lblError.Text = "Designation Successfully Updated."; Clear(); DataGvProperties(); }
public ActionResult RemoveDesignation(int id) { DesignationServices services = new DesignationServices(); if (Session["admin"] != null) { services.Remove(id); return(Json(new { msg = "Done" }, JsonRequestBehavior.AllowGet)); } else { return(RedirectToAction("Login", "Home")); } }
void DataGvProperties() { GridViewDesignation.DataSource = DesignationServices.GetAll(); GridViewDesignation.DataBind(); }