Пример #1
0
 public ActionResult GetCemeteryById(Guid cemeteryId)
 {
     try
     {
         var record = CemeteryService.QueryCemeteryById(cemeteryId);
         return(Json(record, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(Json(ex.Message, JsonRequestBehavior.AllowGet));
     }
 }
Пример #2
0
 public ActionResult GetCemeteriesByName(string searchText)
 {
     try
     {
         var records = CemeteryService.QueryCemeteriesByName(searchText);
         return(Json(records, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(Json(ex.Message, JsonRequestBehavior.AllowGet));
     }
 }
Пример #3
0
 public ActionResult GetActiveCemeteries(int pageNumber, int listType)
 {
     try
     {
         var records = CemeteryService.QueryActiveCemeteries(pageNumber, listType);
         return(Json(records, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(Json(ex.Message, JsonRequestBehavior.AllowGet));
     }
 }
Пример #4
0
        public ActionResult AddCemetery(List <KeyValue> cemetery)
        {
            try
            {
                cemetery.Add(new KeyValue()
                {
                    Key   = "Id",
                    Value = Guid.NewGuid().ToString()
                });
                var returnObject = CemeteryService.InsertCemetery(cemetery);
                if (returnObject.State == "success")
                {
                    var newMortuary = CemeteryService.QueryCemeteryById(Guid.Parse(returnObject.Id));
                    return(Json(new { state = "success", cemetery = newMortuary }, JsonRequestBehavior.AllowGet));
                }

                return(Json(new { state = "error", hospital = "" }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(ex.Message, JsonRequestBehavior.AllowGet));
            }
        }