Example #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));
     }
 }
Example #2
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));
            }
        }