Exemplo n.º 1
0
        public Tb_Order GetOrderByUser(string Uid)
        {
            var cmd    = new DataCommand();
            var cartGo = cmd.Search <Tb_Order>(x => x.UserId.Equals(Uid));

            return(cartGo);
        }
Exemplo n.º 2
0
        public Tb_Goods GetGoodsInfoByCode(string code)
        {
            var cmd    = new DataCommand();
            var result = cmd.Search <Tb_Goods>(x => x.Code.Equals(code));

            return(result);
        }
Exemplo n.º 3
0
        public void StockIn(Tb_Goods goodsIn)
        {
            var cmd    = new DataCommand();
            var findIt = cmd.Search <Tb_Goods>(x => x.Code.Equals(goodsIn.Code));

            if (findIt != null)
            {
                findIt.LastUpDateTime = DateTime.Now;
                findIt.Numbers       += goodsIn.Numbers;
                DataCommand.Update(findIt);
            }
            cmd.Add <Tb_Goods>(goodsIn, false);
            //findIt = cmd.Search<Tb_Goods>(x => x.Code.Equals(goodsIn.Code));
            //var cmd2=new DataCommand("mySql", "InsertGoodsInfo2");
            //cmd2.SetParameters("@GoodsId",$"{ findIt.Id}");
            //cmd2.SetParameters("@SalePrice", $"{goodsIn.InnerPrice}");
            //cmd2.ExeSqlCmd();
        }
Exemplo n.º 4
0
        public void AddStockToCart(Tb_CartGo cartGo)
        {
            var cmd    = new DataCommand();
            var findIt = cmd.Search <Tb_CartGo>(x => x.StockCode.Equals(cartGo.StockCode) && x.UserId.Equals(cartGo.UserId) && x.IsPay != 1);

            if (findIt != null)
            {
                findIt.BuyCnt  += cartGo.BuyCnt;
                findIt.CurPrice = cartGo.CurPrice;
                DataCommand.Update(findIt);
                return;
            }
            cmd = new DataCommand("mySql", "InsertGoodsCartGo");
            cmd.SetParameters("@UserId", cartGo.UserId);
            cmd.SetParameters("@StockCode", cartGo.StockCode);
            cmd.SetParameters("@BuyCnt", $"{cartGo.BuyCnt}");
            cmd.SetParameters("@CurPrice", $"{cartGo.CurPrice}");
            cmd.SetParameters("@TempUser", $"{cartGo.TempUser}");
            cmd.SetParameters("@CreateTime", cartGo.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"));
            cmd.ExeSqlCmd();
        }