///// <summary> ///// To save or update the record ///// </summary> ///// <param name="Sector">Sector object to save or update</param> ///// <returns>status</returns> //[HttpPost] //public ActionResult Edit(TblSector data) //{ // try // { // if (data == null || !ModelState.IsValid) // validate data // throw new CustomException("Invalid Data", null); // var status = BusinessObject.Save(data); // save data // return Json(status.ToString(), JsonRequestBehavior.AllowGet); // return status of the operation // } // catch (CustomException ex) // { // LogManager.Instance.Error(ex); // return Content(ex.Message); // } // catch (Exception ex) // { // LogManager.Instance.Error(ex); // return Content(Constants.Error); // } //} ///// <summary> ///// To toggle Active state of a record ///// </summary> ///// <param name="ID">ID of the record to toggle</param> ///// <returns>status</returns> //[HttpPost] //public ActionResult ToggleActive(int ID) //{ // try // { // var status = BusinessObject.ToggleActive(ID); // Toggle active / inactive for record // return Content(status.ToString()); // return status of the operation // } // catch (CustomException ex) // { // LogManager.Instance.Error(ex); // return Content(ex.Message); // } // catch (Exception ex) // { // LogManager.Instance.Error(ex); // return Content(Constants.Error); // } //} ///// <summary> ///// To delete a record ///// </summary> ///// <param name="ID">ID of the record to delete</param> ///// <returns>status</returns> //[HttpPost] //public ActionResult Delete(int ID) //{ // try // { // var status = BusinessObject.Delete(ID); // Delete the selected record // return Content(status.ToString()); // return status of the operation // } // catch (CustomException ex) // { // LogManager.Instance.Error(ex); // return Content(ex.Message); // } // catch (Exception ex) // { // LogManager.Instance.Error(ex); // return Content(Constants.Error); // } //} /// <summary> /// To get the data for listing /// </summary> /// <returns></returns> public ActionResult GetListJSON(string TypeID = "") { try { return(Json(_secBuss.GetList(TypeID), JsonRequestBehavior.AllowGet)); // Get the listing (combo) data to call from client side } catch (Exception ex) { return(Content(ex.InnerException.Message)); } }