public ActionResult LoadCertificationGrid(int?employeeId, string module, int page, int rows) { try { CertificationDetailsDAL dal = new CertificationDetailsDAL(); CertificationDetailsViewModel model = new CertificationDetailsViewModel(); int totalCount; model.CertificationsList = dal.GetEmpCertificateDetailAndHistory(page, rows, employeeId.GetValueOrDefault(), out totalCount, module); if ((model.CertificationsList == null || model.CertificationsList.Count <= 0) && page - 1 > 0) { page = page - 1; model.CertificationsList = dal.GetEmployeeCertificationHistoryDetails(page, rows, employeeId.GetValueOrDefault(), out totalCount); } var jsonData = new { total = (int)Math.Ceiling((double)totalCount / (double)rows), page = page, records = totalCount, rows = model.CertificationsList }; return(Json(jsonData)); } catch (Exception) { return(RedirectToAction("Index", "Error", new { errorCode = "There are some errors." })); } }
public ActionResult SaveCertificateDetailStatus(List <CertificationDetails> model, string CertHrComment) { try { CertificationDetailsDAL dal = new CertificationDetailsDAL(); var saveStatus = dal.SaveCertificationMatrixHistory(model, CertHrComment); return(Json(new { status = saveStatus }, JsonRequestBehavior.AllowGet)); } catch (Exception) { return(Json(new { status = "Error" }, JsonRequestBehavior.AllowGet)); } }