public JsonResult Add(Form _dpsform) { PortDPSRepository repository; Port_DPS dpsToSave; try { repository = new PortDPSRepository(); if (_dpsform.ID > 0) { //Edit Operation } else { //Add Operation dpsToSave = new Port_DPS(); Mappings.ViewModelToModel(dpsToSave, _dpsform); repository.Add(dpsToSave); } } catch (Exception ex) { } //return _dpsform; return Json(_dpsform, JsonRequestBehavior.AllowGet); }
public JsonResult GetDPSData(int recordid) { PortDPSRepository portDPSRepo = new PortDPSRepository(); var _portDPSData = from _portDPS in portDPSRepo.GetAll().Distinct() where _portDPS.ID == recordid select _portDPS; //return _dpsform; return Json(_portDPSData.SingleOrDefault(), JsonRequestBehavior.AllowGet); }
public ActionResult GetAllDPSRecords() { //Get the View Repository PortDPSRepository portDPSRepo = new PortDPSRepository(); //Get the Report Data var _portDPSData = from portDPS in portDPSRepo.GetAll().Distinct() select portDPS; //return the data return PartialView("_dpsRecords", _portDPSData.ToList()); }