public ActionResult ExcelBatchStrageCheck() { var _key = "sess_excel_inpor_instorage_11"; var dat = SessionAccess.Get(_key) as List <List <string> >; Dictionary <string, string> dic = new Dictionary <string, string>(); if (dat != null && dat.Any()) { foreach (var li in dat) { var te = li[0]; Guid guid = Guid.NewGuid(); var key = guid.ToString(); dic.Add(key, te); } } BatchInputStorageCheck(dic, true); var scanValidKey = "ScanValid"; var scanInvalidKey = "ScanInvalid"; List <Product_Model> validModels = SessionAccess.Get(scanValidKey) as List <Product_Model>; List <Product_Model> inValidModels = SessionAccess.Get(scanInvalidKey) as List <Product_Model>; OperationResult resul = new OperationResult(OperationResultType.Success); resul.Other = new { validCoun = validModels.Count, inValidCoun = inValidModels.Count }; SessionAccess.Remove(_key); return(Json(resul)); }
public void UnloadCurPage() { string _validSessionKey = "1102_validsessionkey_09"; string _invaliSessionKey = "1102_invalidsessionkey_03"; SessionAccess.Remove(_validSessionKey); SessionAccess.Remove(_invaliSessionKey); }
public JsonResult BathcProductCreate(int?[] ids, ProductDiscountDto dto) { OperationResult resul = new OperationResult(OperationResultType.Error); #region 添加前校验 if (!string.IsNullOrEmpty(dto.DiscountName)) { bool exis = _productDiscountContract.ProductDiscounts.Any( c => c.DiscountName == dto.DiscountName && !c.IsDeleted && c.IsEnabled); if (exis) { resul.Message = "已存在同名的折扣方案"; return(Json(resul)); } } #endregion string _validSessionKey = "1102_validsessionkey_09"; string _invaliSessionKey = "1102_invalidsessionkey_03"; if (ids.Any(c => c != null)) { if (dto.DiscountType == 1) { dto.BigNumbers = string.Join(",", ids); } resul = _productDiscountContract.Insert(dto); } else { var discountvalids = SessionAccess.Get(_validSessionKey) as List <DiscountValidSession>; if (discountvalids != null) { resul = _productDiscountContract.Insert(dto); } else { resul = new OperationResult(OperationResultType.ValidError); } } if (resul.ResultType == OperationResultType.Success) { SessionAccess.Remove(_validSessionKey); SessionAccess.Remove(_invaliSessionKey); } return(Json(resul)); }