Exemplo n.º 1
0
        public string ProductSubmit()
        {
            int _memid = FormString.IntSafeQ("memid");

            if (_memid == memid)
            {
                int               _productId    = FormString.IntSafeQ("productId");
                int               _classId      = FormString.IntSafeQ("classId");
                int               _classId1     = FormString.IntSafeQ("classId1");
                int               _classId2     = FormString.IntSafeQ("classId2");
                int               _classId3     = FormString.IntSafeQ("classId3");
                string            _adTitle      = FormString.SafeQ("adTitle", 200);
                string            _title        = FormString.SafeQ("title", 200);
                string            _code         = FormString.SafeQ("Code");
                string            _placeorigin  = FormString.SafeQ("placeorigin");
                string            _name         = FormString.SafeQ("name");
                string            _spec1        = FormString.SafeQ("spec1");
                string            _spec2        = FormString.SafeQ("spec2");
                int               _siteid       = FormString.IntSafeQ("siteid");
                decimal           _grossweight  = StringUtils.GetDbDecimal(FormString.SafeQ("grossweight"));
                string            _brandname    = FormString.SafeQ("brandname");
                int               _num          = FormString.IntSafeQ("num");
                decimal           _price        = StringUtils.GetDbDecimal(FormString.SafeQ("price", 200));
                decimal           _tradePrice   = StringUtils.GetDbDecimal(FormString.SafeQ("tradePrice", 200));
                decimal           _marketPrice  = StringUtils.GetDbDecimal(FormString.SafeQ("marketPrice", 200));
                int               _transfeetype = FormString.IntSafeQ("transfeetype");
                decimal           _transfee     = StringUtils.GetDbDecimal(FormString.SafeQ("transfee"));
                int               _unit         = FormString.IntSafeQ("unit");
                ProcProductEntity _entity       = new ProcProductEntity();

                _entity.ClassId  = _classId;
                _entity.ClassId1 = _classId1;
                _entity.ClassId2 = _classId2;
                _entity.ClassId3 = _classId3;
                _entity.Code     = _code;
                _entity.AdTitle  = _adTitle;
                _entity.Title    = _title;
                _entity.SiteId   = _siteid;
                BrandEntity brand = BrandBLL.Instance.GetBrandByName(_brandname);
                if (brand == null || brand.Id == 0)
                {
                    brand.Name = _brandname;
                    brand.Id   = BrandBLL.Instance.AddBrand(brand);
                }
                _entity.BrandId      = brand.Id;
                _entity.BrandName    = _brandname;
                _entity.ProductId    = _productId;
                _entity.TransFee     = _transfee;
                _entity.HasHtml      = 0;
                _entity.TransFeeType = _transfeetype;
                _entity.MarketPrice  = _marketPrice;
                _entity.Num          = _num;
                _entity.GrossWeight  = _grossweight;
                _entity.Name         = _name;
                _entity.Spec1        = _spec1;
                _entity.Spec2        = _spec2;
                _entity.Name         = _name;
                _entity.Unit         = _unit;
                _entity.PlaceOrigin  = _placeorigin;

                _entity.Price       = _price;
                _entity.TradePrice  = _tradePrice;
                _entity.CreateManId = memid;
                int productid = ProductBLL.Instance.AddProductProc(_entity);

                if (productid > 0)
                {
                    return(((int)CommonStatus.Success).ToString());
                }
            }
            return(((int)CommonStatus.Fail).ToString());
        }
Exemplo n.º 2
0
 public int AddProductProc(ProcProductEntity _entity)
 {
     return(ProductDA.Instance.AddProductProc(_entity));
 }