public JsonResult ExtendSelectedCard(ActiveCardCustomViewModel obj) { var isSuccess = false; var cardnumbers = ""; var host = Request.Url.Host; var fee = obj.FeeLevel.Replace(".", "").Replace(",", ""); var dateextend = Convert.ToDateTime(obj.DateExtend).ToString("MM/dd/yyyy"); var dateactive = Convert.ToDateTime(obj.DateActive); fee = !string.IsNullOrWhiteSpace(fee) ? fee : "0"; try { var list = (List <tblCardExtend>)Session[string.Format("{0}_{1}", SessionConfig.CardActiveParkingSession, host)]; if (list != null && list.Any()) { var count = 0; foreach (var item in list) { count++; cardnumbers += string.Format("'{0}'{1}", item.CardNumber, list.Count == count ? "" : ","); } isSuccess = _tblCardService.AQUA_AddCardExpireByListCardNumber(cardnumbers, int.Parse(fee), dateextend, GetCurrentUser.GetUser().Id, obj.isAllowNegativeDays); } else { var result1 = new MessageReport(); result1.Message = FunctionHelper.GetLocalizeDictionary("Home", "notification")["select_card_activate"]; result1.isSuccess = false; return(Json(result1, JsonRequestBehavior.AllowGet)); } if (isSuccess) { var result = new MessageReport(); result.Message = FunctionHelper.GetLocalizeDictionary("Home", "notification")["updateSuccess"]; result.isSuccess = isSuccess; Session[string.Format("{0}_{1}", SessionConfig.CardActiveParkingSession, host)] = new List <tblCardExtend>(); var model = new { result = result, cardnumbers = cardnumbers }; return(Json(model, JsonRequestBehavior.AllowGet)); } else { var result = new MessageReport(); result.Message = FunctionHelper.GetLocalizeDictionary("Home", "notification")["updateFailed"]; result.isSuccess = isSuccess; return(Json(result, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { var result = new MessageReport(); result.Message = ex.Message; result.isSuccess = false; return(Json(result, JsonRequestBehavior.AllowGet)); } }