Ejemplo n.º 1
0
 public int AddGoods(List <SupplyInfo> list)
 {
     if (null == list)
     {
         return(0);
     }
     return(service.AddGoods(list));
 }
Ejemplo n.º 2
0
        public int Save(Goods goods, int?supplierId)
        {
            int cnt = 0;

            if (null == goods)
            {
                return(0);
            }
            if (null != supplierId)
            {
                int rslt = 0;
                int?gId  = service.GenGoodsId();
                if (null == custService)
                {
                    custService = base.CreateService(typeof(CustomerService), ConnectorId) as CustomerService;
                }
                if (null == gId)
                {
                    gId = goods.__baseId;
                }
                goods.GID__PK = gId;
                rslt         += service.Save(goods);
                SupplyInfo spInfo = new SupplyInfo();
                spInfo.CustID = supplierId;
                spInfo.GID    = goods.GID__PK;
                spInfo.St     = ST.VALID;
                rslt         += custService.AddGoods(new List <SupplyInfo>()
                {
                    spInfo
                });
                if (rslt > 1)
                {
                    cnt = 1;
                }
            }
            else
            {
                cnt += service.Save(goods);
            }
            return(cnt);
        }