Beispiel #1
0
        public JsonResult LoadReview(Guid incomeId)
        {
            IncomeReviewModel model = null;
            var reviewXml           = DataService.GetIncomeItem(ItemTypeEnum.Review, incomeId);

            if (!string.IsNullOrEmpty(reviewXml))
            {
                model = DeserializeModel <IncomeReviewModel>(reviewXml);
            }
            return(Json(model, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
 public bool SaveReview(IncomeReviewModel model, bool isIncome = false)
 {
     try
     {
         var xmlString = SerializeModel(model);
         if (model.Id != null)
         {
             DataService.UpdateIncomeItem((Guid)model.Id, model.Name, xmlString);
         }
         else
         {
             DataService.ApplyIncomeItem(ItemTypeEnum.Review, (Guid)User.UserId, model.Name, xmlString, model.Id);
         }
         return(true);
     }
     catch (Exception ex)
     {
         // todo
     }
     return(false);
 }