コード例 #1
0
 public ActionResult AddFuneralBoughtItem(List <KeyValue> funeralBoughtItem)
 {
     try
     {
         funeralBoughtItem.Add(new KeyValue()
         {
             Key   = "Id",
             Value = Guid.NewGuid().ToString()
         });
         var returnObject = FuneralBoughtItemService.InsertFuneralBoughtItem(funeralBoughtItem);
         if (returnObject.State == "success")
         {
             var newFuneralBoughtItem = HospitalService.QueryHospitalById(Guid.Parse(returnObject.Id));
             return(Json(new { state = "success", funeralBoughtItem = newFuneralBoughtItem }, JsonRequestBehavior.AllowGet));
         }
         return(Json(new { state = "error", hospital = "" }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(Json(ex.Message, JsonRequestBehavior.AllowGet));
     }
 }
コード例 #2
0
        public ActionResult GetFuneralBoughtItemsByFuneralId(Guid funeralId)
        {
            var records = FuneralBoughtItemService.QueryFuneralBoughtItemsByFuneralId(funeralId);

            return(Json(records, JsonRequestBehavior.AllowGet));
        }