public ActionResult AddProduct() { string ProductNum = WebUtil.GetFormValue <string>("SnNum", string.Empty); string BarCode = WebUtil.GetFormValue <string>("BarCode", string.Empty); string ProductName = WebUtil.GetFormValue <string>("ProductName", string.Empty); string BatchNum = WebUtil.GetFormValue <string>("ProductBatch", string.Empty); string LocalNum = WebUtil.GetFormValue <string>("LocalNum", string.Empty); string Size = WebUtil.GetFormValue <string>("Size", string.Empty); string Color = WebUtil.GetFormValue <string>("Color", string.Empty); string Count = WebUtil.GetFormValue <string>("Count", string.Empty); double LocalQty = WebUtil.GetFormValue <double>("LocalQty", 0); double Num = WebUtil.GetFormValue <double>("Num", 0); double InPrice = WebUtil.GetFormValue <double>("Price", 0); double Cl = WebUtil.GetFormValue <double>("Cl", 0); double Ca = WebUtil.GetFormValue <double>("Ca", 0); double Cb = WebUtil.GetFormValue <double>("Cb", 0); InStorDetailEntity entity = new InStorDetailEntity(); entity.SnNum = SequenceProvider.GetSequence(typeof(InStorDetailEntity)); entity.OrderNum = string.Empty; entity.ProductName = ProductName; entity.BarCode = BarCode; entity.ProductNum = ProductNum; entity.Color = Color; entity.Count = Count; entity.Size = Size; entity.Num = Num; entity.IsPick = (int)EBool.No; entity.RealNum = 0; entity.InPrice = InPrice; entity.CreateTime = DateTime.Now; entity.LocalNum = LocalNum; entity.Cl = Cl; entity.Ca = Ca; entity.Cb = Cb; entity.RGB = ColorHelper.GetRgb16Color(LabRgb.LabToRgb(new double[] { Cl, Ca, Cb })); LocationEntity localtion = new LocationProvider().GetSingleByNumCache(LocalNum); if (localtion != null) { entity.LocalName = new LocationProvider().GetSingleByNumCache(LocalNum).LocalName; } else { entity.LocalName = ""; } entity.Amount = entity.InPrice * entity.Num; entity.StorageNum = this.DefaultPStore; entity.BatchNum = BatchNum; entity.TotalPrice = entity.Num * entity.InPrice; List <InStorDetailEntity> list = Session[CacheKey.TEMPDATA_CACHE_INSTORDETAIL] as List <InStorDetailEntity>; list = list.IsNull() ? new List <InStorDetailEntity>() : list; list.Add(entity); Session[CacheKey.TEMPDATA_CACHE_INSTORDETAIL] = list; return(Content(string.Empty)); }