public JsonResult SumCardCarshConsumeItems() { ReturnedData data = new ReturnedData(); try { string cardNo = NullHelper.Convert<string>(Request["cardNo"], ""); string itemData = NullHelper.Convert<string>(Request["itemData"], ""); //[{\"itemid\":\"12\",\"itemName\":\"喷漆\",\"itemSum\":\"1\",\"itemSubPrice\":\"150\"}] //JavaScriptSerializer jsonSerializer = new JavaScriptSerializer(); //List<ComsumeItemViewModel> list = (List<ComsumeItemViewModel>)jsonSerializer.Deserialize(itemData,typeof(ComsumeItemViewModel)); if (!string.IsNullOrEmpty(itemData)) { List<ComsumeItemViewModel> list = JsonSerializer(itemData,ConsumeType.ClubCash); ClubCardMgm cardMgm = new ClubCardMgm(); var card = cardMgm.GetClubCardByCardNo(cardNo); var conlist = GetConsumeList(list, card, ConsumeType.ClubCash); ConsumeMgm conMgm = new ConsumeMgm(); var consSerNo = conMgm.ConsumeCash(conlist); data.Success = true; LogHandler.Info(Emp.UserName + "添加会员现金消费,时间:" + DateTime.Now); data.Message = consSerNo + "|" + conlist.FirstOrDefault().CreatedDate.ToString("yyyy/MM/dd HH:mm:ss"); data.Data = cardMgm.GetBalanceByClubCardID(card.ClubCardID); } } catch (Exception ex) { data.Success = false; data.Message = "会员现金消费过程出现异常,请联系维护人员"; data.Error = ex.ToString(); LogHandler.Error(ex.Message.ToString()); } return Json(data, JsonRequestBehavior.AllowGet); }