コード例 #1
0
        /// <summary>
        /// 商品选择器
        /// </summary>
        /// <param name="name"></param>
        /// <param name="mcode"></param>
        /// <param name="CustomerID"></param>
        /// <param name="status"></param>
        /// <param name="p"></param>
        /// <returns></returns>
        public ActionResult GoodsSelect(string name, string mcode, int CustomerID = -1, int status = -1, int p = 1)
        {
            List <GoodsEntity> mList = null;

            int count = GoodsService.GetGoodsCount(name, mcode, CustomerID, status);

            PagerInfo pager = new PagerInfo();

            pager.PageIndex = p;
            pager.PageSize  = PAGESIZE;
            pager.SumCount  = count;
            pager.URL       = "GoodsSelect";

            //客户信息
            ViewBag.Customer   = CustomerService.GetCustomerByRule("", 1);//只显示使用中的数据
            ViewBag.GoodsModel = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "GoodsCode" && t.Status == 1).ToList();
            if (!string.IsNullOrEmpty(name) || CustomerID > -1 || status > -1 || !string.IsNullOrEmpty(mcode))
            {
                mList = GoodsService.GetGoodsInfoByRule(name, mcode, CustomerID, status, pager);
            }
            else
            {
                mList = GoodsService.GetGoodsInfoPager(pager);
            }

            ViewBag.Name        = name ?? "";
            ViewBag.Status      = status;
            ViewBag.Description = mcode;
            ViewBag.CustomerID  = CustomerID;
            ViewBag.Goods       = mList;
            ViewBag.Pager       = pager;
            return(View());
        }
コード例 #2
0
        /// <summary>
        /// get specified order by order code.
        /// </summary>
        /// <param name="orderCode">order id</param>
        /// <returns></returns>
        public async Task <(bool Succeed, OrderItemResult Order, string ErrorMessage)> GetOrder(int userId,
                                                                                                string orderCode)
        {
            var order = await Dapper.QueryFirstOrDefaultAsync <OrderItemResult>(
                "select OrderCode,OrderStatus,PayStatus,CreatedOn,Result from `Order` where OrderCode=@orderCode and UserId=@userId",
                new { orderCode, userId });

            if (order == null)
            {
                return(false, null, "order not exists");
            }
            var lstDetail = await Dapper.QueryAsync <NewOrderDetail>(
                "select OrderCode,GoodsId,Count,Price from OrderDetail where OrderCode=@orderCode", new { orderCode });

            var lstGoodsId = lstDetail.Select(i => i.GoodsId).ToList();
            var lstGoods   = await GoodsService.GoodsInfos(lstGoodsId);

            order.GoodsInfos = new List <GoodsInfoObj>();
            lstDetail.ForEach(j =>
            {
                var srcGoods = lstGoods.FirstOrDefault(k => k.Id == j.GoodsId);
                order.GoodsInfos.Add(new GoodsInfoObj
                {
                    Count   = j.Count,
                    GoodsId = j.GoodsId,
                    Price   = j.Price,
                    Pic     = srcGoods?.Pic,
                    Title   = srcGoods?.Title
                });
            });
            order.Amount = order.GoodsInfos.Sum(k => k.Count * k.Price);
            return(true, order, "");
        }
コード例 #3
0
        public GameStoreViewModel(IDispatcherService dispatcherService, string functionTag,
                                  IDialogService dialogService, ScoreInfoService scoreInfoService, GoodsService goodsService) : base(dispatcherService, functionTag)
        {
            _dialogService    = dialogService;
            _scoreInfoService = scoreInfoService;
            _goodsService     = goodsService;

            DataGridItemChanged = new RelayCommand <DataGridItemChangedEventArgs>(OnDataGridItemChanged);

            RefreshList = new RelayCommand(PrivateRefreshList);

            RemoveItem = new RelayCommand(() =>
            {
                if (_dialogService.ShowOKCancel("确定删除选中数据吗?"))
                {
                    _ = _goodsService.RemoveAsync(SelectedItem);
                    GoodsItems.Remove(SelectedItem);
                }
            }, () => { return(SelectedItem != null); });

            RemoveAll = new RelayCommand(() =>
            {
                if (_dialogService.ShowOKCancel("确定删除所有数据吗?"))
                {
                    _          = _goodsService.RemoveAllAsync();
                    GoodsItems = null;
                }
            }, () => { return(GoodsItems != null); });

            AddData = new RelayCommand(() =>
            {
                if (string.IsNullOrEmpty(BuyCmd))
                {
                    _dialogService.ShowInformation("购买命令不能为空");
                    return;
                }
                if (GoodsItems.FirstOrDefault(p => p.BuyCmd == BuyCmd) != null)
                {
                    _dialogService.ShowInformation("购买命令重复");
                    return;
                }

                var dto = new GoodsDto()
                {
                    GoodsName = GoodsName,
                    BuyCmd    = BuyCmd,
                    Content   = Content,
                    Amount    = Amount,
                    Quality   = Quality,
                    Price     = Price,
                    GoodsType = GoodsType
                };
                _ = _goodsService.AddAsync(dto);
                GoodsItems.Add(dto);
            });

            AddAvailableVariables();

            PrivateRefreshList();
        }
コード例 #4
0
        public void GetAllByCode_ShouldReturnNeededGoods_WhenCodeSend()
        {
            string testCode = "2233AGN";

            var goods = new List <Good>()
            {
                new Good()
                {
                    ID = 1, Code = testCode
                },
                new Good()
                {
                    ID = 2, Code = "2222AGN"
                },
                new Good()
                {
                    ID = 3, Code = testCode
                }
            }.AsQueryable();

            var repositoryMock = new Mock <IExternalDbRepository <Good> >();

            repositoryMock.Setup(x => x.All()).Returns(() => goods);

            GoodsService service = new GoodsService(repositoryMock.Object);

            List <Good> response = service.GetAllByCode(testCode).ToList();

            Assert.AreEqual(response.Count, 2);
            Assert.AreEqual(response[0].Code, testCode);
            Assert.AreEqual(response[1].Code, testCode);

            repositoryMock.VerifyAll();
        }
コード例 #5
0
        public ActionResult Edit(string cid)
        {
            //默认承运商
            ViewBag.Carrier = CarrierService.GetCarrierByRule("", 1);    //只显示使用中的数据
            //默认仓库
            ViewBag.Storage = StorageService.GetStorageByRule("", 1);    //只显示使用中的数据
            //门店
            ViewBag.Goods = GoodsService.GetGoodsByRule("", 1);          //只显示使用中的数据
            //客户信息
            ViewBag.Customer = CustomerService.GetCustomerByRule("", 1); //只显示使用中的数据
            //温度
            ViewBag.TemList = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "TM00" && t.Status == 1).ToList();
            //收货方类型
            ViewBag.ReceiverList = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "Reveiver00" && t.Status == 1).ToList();
            //收货方
            ViewBag.DeliverList = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "DeliverModel00" && t.Status == 1).ToList();
            if (!string.IsNullOrEmpty(cid))
            {
                ViewBag.PriceSet = PriceSetService.GetPriceSetEntityById(cid.ToLong(0));
            }
            else
            {
                ViewBag.PriceSet = new PriceSetEntity();
            }

            return(View());
        }
コード例 #6
0
        protected void SaveGoods_Click(object sender, EventArgs e)
        {
            string str     = this.goodsimg.Src.Trim();
            int    goodsId = -1;


            string goodsIdStr = this.GoodsId.Text.Trim();

            try
            {
                goodsId = Convert.ToInt32(goodsIdStr);
            }
            catch (Exception ee)
            {
                Console.WriteLine(ee.ToString());
                GoodsService.GetInstance().createGoods(this.GoodsName.Text.Trim(), this.GoodsPrice.Text.Trim(),
                                                       this.GoodsNumber.Text.Trim(), this.goodsimg.Src.Trim(), this.GoodsRemarks.Text.Trim());
                return;
            }

            if (goodsId < 0)
            {
                GoodsService.GetInstance().createGoods(this.GoodsName.Text.Trim(), this.GoodsPrice.Text.Trim(),
                                                       this.GoodsNumber.Text.Trim(), this.goodsimg.Src.Trim(), this.GoodsRemarks.Text.Trim());
            }
            else
            {
                Console.WriteLine(this.goodsimg.Src);
                GoodsService.GetInstance().modifyGoods(goodsId, this.GoodsName.Text.Trim(), this.GoodsPrice.Text.Trim(),
                                                       this.GoodsNumber.Text.Trim(), this.goodsimg.Src.Trim(), this.GoodsRemarks.Text.Trim());
            }
        }
コード例 #7
0
        public async Task <List <GoodsDetailDto> > GetAllGoodDetails()
        {
            using (var goodDetail = new GoodDetailService())
            {
                var goodDetailList = await goodDetail.GetAllAsync().Select(m => new GoodsDetailDto()
                {
                    Id        = m.Id,
                    ImgUrl    = m.ImgUrl,
                    Update    = m.CreateTime,
                    IsRemoved = m.IsRemoved,
                    GoodsId   = m.GoodsId
                }).ToListAsync();

                using (IGoodsService goodSev = new GoodsService())
                {
                    foreach (var goodsDetailDto in goodDetailList)
                    {
                        var goods = await goodSev.GetOneByIdAsync(goodsDetailDto.GoodsId);

                        goodsDetailDto.GoodsName = goods.Name;
                    }
                    return(goodDetailList);
                }
            }
        }
コード例 #8
0
        public void GetTaoBaoGoods()
        {
            NickSessionService nsDal = new NickSessionService();
            IList <Model.TopNickSessionInfo> list = nsDal.GetAllNickSession(new[] { TopTaoBaoService.Temporary, TopTaoBaoService.YingXiaoJueCe });

            GoodsService goodsDal = new GoodsService();

            for (int i = 0; i < list.Count; i++)
            {
                string shopId = TaoBaoAPI.GetShopInfo(list[i].Nick, list[i].Session);
                list[i].ShopId = shopId;
                nsDal.UpdateNickShop(list[i].Nick, shopId);
            }

            foreach (Model.TopNickSessionInfo info in list)
            {
                List <GoodsInfo> goodsList = TaoBaoAPIService.GetGoodsInfoListByNick(info.Nick, info.Session, info.ServiceId);

                List <GoodsInfo> allGoods = goodsDal.GetAllGoods(info.Nick);

                foreach (GoodsInfo ginfo in goodsList)
                {
                    if (allGoods.Contains(ginfo))
                    {
                        goodsDal.UpdateGoodsInfo(ginfo);
                    }
                    else
                    {
                        goodsDal.InsertGoods(ginfo, info.Nick);
                    }
                }
            }
        }
コード例 #9
0
    protected void Btn_UpdateGoods_Click(object sender, EventArgs e)
    {
        string nick    = "";
        string session = "";

        if (Request.Cookies["nick"] != null)
        {
            nick    = HttpUtility.UrlDecode(Request.Cookies["nick"].Value); //"nick";
            session = Request.Cookies["nicksession"].Value;
        }
        else
        {
            nick    = Session["snick"].ToString();
            session = Session["ssession"].ToString();
        }
        if (nick == "" || session == "")
        {
            Response.Write("请重新登录");
            return;
        }

        GoodsService goodsDal = new GoodsService();

        goodsDal.DeleteGoodsByNick(nick);

        IList <TaoBaoGoodsInfo> list = TopAPI.GetGoodsInfoListByNick(nick, session);

        foreach (TaoBaoGoodsInfo info in list)
        {
            goodsDal.InsertGoodsInfo(info, nick);
        }
        Response.Redirect("UserAddAds.aspx");
    }
コード例 #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            KeyWordService      kyDal    = new KeyWordService();
            GoodsService        goodsDal = new GoodsService();
            string              nick     = HttpUtility.UrlDecode(Request.Cookies["nick"].Value);
            IList <KeyWordInfo> list     = kyDal.GetKeyWords(nick);

            IList <TaoBaoAPIHelper.GoodsInfo> goodsList = goodsDal.GetAllGoods(nick);
            Dictionary <string, List <TaoBaoAPIHelper.GoodsInfo> > dic = new Dictionary <string, List <TaoBaoAPIHelper.GoodsInfo> >();
            foreach (KeyWordInfo info in list)
            {
                dic.Add(info.KeyWord, new List <TaoBaoAPIHelper.GoodsInfo>());

                List <TaoBaoAPIHelper.GoodsInfo> sgoods = TaoBaoAPIHelper.TaoBaoAPI.SearchGoods(info.KeyWord);

                foreach (TaoBaoAPIHelper.GoodsInfo ginfo in new List <TaoBaoAPIHelper.GoodsInfo>(goodsList))
                {
                    for (int i = 0; i < sgoods.Count; i++)
                    {
                        if (nick == sgoods[i].nick && ginfo.num_iid == sgoods[i].num_iid)
                        {
                            ginfo.Collection = i + 1;//此处当作排名使用
                            dic[info.KeyWord].Add(ginfo);
                        }
                    }
                }
            }
            Rpt_KeyWords.DataSource = dic;
            Rpt_KeyWords.DataBind();
        }
    }
コード例 #11
0
        public static byte[] GetGoodsCheckStock()
        {
            byte[] objRet = null;
            IList <GoodsCheckStock> goodsCheckStockList = GoodsService.GetInstance().GetGoodsCheckStock();

            if (goodsCheckStockList != null && goodsCheckStockList.Count > 0)
            {
                //获取成功
                string json     = JsonConvert.SerializeObject(goodsCheckStockList);
                byte[] jsonByte = Encoding.UTF8.GetBytes(json);

                int transCount = BasicTypeLength.INT32 + BasicTypeLength.INT32 + jsonByte.Length;
                objRet = new byte[transCount];
                Array.Copy(BitConverter.GetBytes((int)RET_VALUE.SUCCEEDED), 0, objRet, 0, BasicTypeLength.INT32);
                Array.Copy(BitConverter.GetBytes(transCount), 0, objRet, BasicTypeLength.INT32, BasicTypeLength.INT32);
                Array.Copy(jsonByte, 0, objRet, 2 * BasicTypeLength.INT32, jsonByte.Length);
            }
            else
            {
                //数据库操作失败
                objRet = new byte[ParamFieldLength.PACKAGE_HEAD];
                Array.Copy(BitConverter.GetBytes((int)RET_VALUE.ERROR_DB), 0, objRet, 0, BasicTypeLength.INT32);
                Array.Copy(BitConverter.GetBytes(ParamFieldLength.PACKAGE_HEAD), 0, objRet, BasicTypeLength.INT32, BasicTypeLength.INT32);
            }
            return(objRet);
        }
コード例 #12
0
        public HomeController()
        {
            DefaultContext db = DBInitialization.InitializeDB();

            _ordersService = new OrdersService(db);
            _goodsService  = new GoodsService(db);
        }
コード例 #13
0
        private static InventoryDetailEntity TranslateInventoryDetailEntity(InventoryDetailInfo info)
        {
            InventoryDetailEntity entity = new InventoryDetailEntity();

            if (info != null)
            {
                entity.GoodsID       = info.GoodsID;
                entity.StorageID     = info.StorageID;
                entity.Quantity      = info.Quantity;
                entity.CustomerID    = info.CustomerID;
                entity.InventoryType = info.InventoryType;

                entity.BatchNumber   = info.BatchNumber;
                entity.ProductDate   = info.ProductDate;
                entity.InventoryDate = info.InventoryDate;
                entity.UnitPrice     = info.UnitPrice;
                entity.Remark        = info.Remark;

                entity.OrderNo           = info.OrderNo;
                entity.OrderType         = info.OrderType;
                entity.OrderTypeDesc     = StringHelper.getOrderType(info.OrderType);
                entity.OperatorID        = info.OperatorID;
                entity.CreateDate        = info.CreateDate;
                entity.ChangeDate        = info.ChangeDate;
                entity.InventoryDetailID = info.InventoryDetailID;
                entity.InventoryID       = info.InventoryID;
                entity.goods             = GoodsService.GetGoodsEntityById(info.GoodsID);
                entity.customer          = CustomerService.GetCustomerEntityById(info.CustomerID);
                entity.storages          = StorageService.GetStorageEntityById(info.StorageID);
            }

            return(entity);
        }
コード例 #14
0
        /// <summary>
        /// 商品选择器
        /// </summary>
        /// <param name="name"></param>
        /// <param name="mcode"></param>
        /// <param name="CustomerID"></param>
        /// <param name="status"></param>
        /// <param name="p"></param>
        /// <returns></returns>
        /// 商品选择器 从商品中筛选
        public ActionResult OrderGoodsSelect(string type = "", string name = "", string goodsType = "", int carrierid = 0, int storageID = 0, int customerid = 0, int status = -1, int p = 1)
        {
            List <GoodsEntity>     goodsList     = null;
            List <InventoryEntity> inventoryList = null;
            PagerInfo pager = new PagerInfo();

            //运输订单A  运输订单B 从订单表中获取数据
            if (!string.IsNullOrEmpty(type) && type.Equals("YSDDA") || type.Equals("YSDDB"))
            {
                int count = GoodsService.GetGoodsCount(name, "", customerid, status);
                pager.PageIndex = p;
                pager.PageSize  = PAGESIZE;
                pager.SumCount  = count;
                pager.URL       = "OrderGoodsSelect";
                //客户信息
                ViewBag.Customer   = CustomerService.GetCustomerByRule("", 1);//只显示使用中的数据
                ViewBag.GoodsModel = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "GoodsCode" && t.Status == 1).ToList();
                if (!string.IsNullOrEmpty(name) || storageID > 0 || customerid > 0 || carrierid > 0)
                {
                    goodsList = GoodsService.GetGoodsInfoByRule(name, "", customerid, status, pager);
                }
                else
                {
                    goodsList = GoodsService.GetGoodsInfoPager(pager);
                }
            }
            else
            {
                //仓配订单 调拨订单从库存表中获取数据
                int count = InventoryService.GetInventoryCount(name, "", storageID, customerid);

                pager.PageIndex = p;
                pager.PageSize  = PAGESIZE;
                pager.SumCount  = count;
                pager.URL       = "OrderGoodsSelect";

                //客户信息
                ViewBag.Customer   = CustomerService.GetCustomerByRule("", 1);//只显示使用中的数据
                ViewBag.GoodsModel = BaseDataService.GetBaseDataAll().Where(t => t.PCode == "GoodsCode" && t.Status == 1).ToList();
                if (!string.IsNullOrEmpty(name) || storageID > 0)
                {
                    inventoryList = InventoryService.GetInventoryInfoByRule(name, "", storageID, customerid, pager);
                }
                else
                {
                    inventoryList = InventoryService.GetInventoryInfoPager(pager);
                }
            }

            ViewBag.StorageID     = storageID;
            ViewBag.Name          = name ?? "";
            ViewBag.Status        = status;
            ViewBag.GoodsType     = goodsType;
            ViewBag.CustomerID    = customerid;
            ViewBag.GoodsList     = goodsList;
            ViewBag.InventoryList = inventoryList;
            ViewBag.Pager         = pager;
            ViewBag.TYPE          = type;//运输订单A:YSDDA  运输订单B:YSDDB  仓配订单:CPDD 调拨订单:DBDD
            return(View());
        }
コード例 #15
0
ファイル: GoodsManager.cs プロジェクト: Steveluy/eShopWeb
        public async Task <List <DTO.GoodsDTO> > GetAllGoods()
        {
            using (IDAL.IGoodsService goodService = new GoodsService())
            {
                var goodsDtos = await goodService.GetAllAsync().Select(m => new GoodsDTO()
                {
                    id        = m.Id,
                    name      = m.Name,
                    imgUrl    = m.ImgUrl,
                    price     = m.Price,
                    price_old = m.Price_old
                }).ToListAsync();

                using (IGoodDetailService goodDetailService = new GoodDetailService())
                {
                    foreach (var goodsDto in goodsDtos)
                    {
                        goodsDto.imgsUrl = new List <string>();
                        var goodDetails = goodDetailService.GetAllAsync().Where(m => m.GoodsId == goodsDto.id).ToList();
                        foreach (var goodDetail in goodDetails)
                        {
                            goodsDto.imgsUrl.Add(goodDetail.ImgUrl);
                        }
                        ;
                    }
                }
                return(goodsDtos);
            }
        }
コード例 #16
0
        public ResultModel getAllLogisticsInfo()
        {
            ResultModel res = new ResultModel();

            res.status = "200";
            res.insert("logisticsInfo", GoodsService.getAllLogisticsInfo());
            return(res);
        }
コード例 #17
0
        public ResultModel getAllApplyInfo()
        {
            ResultModel res = new ResultModel();

            res.status = "200";
            res.insert("applyInfo", GoodsService.getAllApplyInfo());
            return(res);
        }
コード例 #18
0
        public ResultModel getAllGoods()
        {
            ResultModel res = new ResultModel();

            res.status = "200";
            res.insert("goodsInfo", GoodsService.GetAllGoods());
            return(res);
        }
コード例 #19
0
ファイル: UpdateGoods.aspx.cs プロジェクト: mike442144/FBS
        protected void BT_AddGoods_Click(object sender, EventArgs e)
        {
            GoodsService mygoodsservice = new GoodsService();

            if (FU_Pic.HasFile)
            {
                bool fileOk = false;
                if (C_BeginTime.SelectedDate > C_EndTime.SelectedDate)
                {
                    Response.Write("<script>alert('开始日期不能大于结束日期!!')</script>");
                }
                else
                {
                    string fileExtension = System.IO.Path.GetExtension(FU_Pic.FileName).ToLower();
                    //限定只能上传jpg和gif图片
                    string[] allowExtension = { ".jpg", ".gif", ".bmp", ".png", ".jpeg" };
                    //对上传的文件的类型进行一个个匹对
                    for (int i = 0; i < allowExtension.Length; i++)
                    {
                        if (fileExtension == allowExtension[i])
                        {
                            fileOk = true;
                            break;
                        }
                    }

                    if (fileOk)
                    {
                        Guid   aid      = Guid.NewGuid();
                        string filePath = "../../../images/Groupon/Upload/" + aid.ToString() + fileExtension;
                        FU_Pic.SaveAs(MapPath(filePath));//把文件上传到服务器的绝对路径上
                        GoodsDspModel model = new GoodsDspModel()
                        {
                            GoodsID             = new Guid(Label1.Text.ToString().Trim()),
                            GoodsBeginTime      = C_BeginTime.SelectedDate,
                            GoodsBuyCount       = 0,
                            GoodsDetailsContent = editor1.InnerText,
                            GoodsEndTime        = C_EndTime.SelectedDate,
                            GoodsIsOn           = false,
                            GoodsName           = TB_GoodsName.Text.ToString().Trim(),
                            GoodsNowPrice       = float.Parse(TB_NowPrice.Text.ToString().Trim()),
                            GoodsOldPrice       = float.Parse(TB_OldPrice.Text.ToString().Trim()),
                            GoodsPicURL         = filePath
                        };
                        mygoodsservice.UpdateGoods(model);
                        Response.Write("<script>alert('修改成功')</script>");
                    }
                    else
                    {
                        Response.Write("<script>alert('文件格式错误!')</script>");
                    }
                }
            }
            else
            {
                Response.Write("<script>alert('请您选择上传的文件!!')</script>");
            }
        }
コード例 #20
0
 public void Modify(GoodsEntity goods)
 {
     if (goods != null)
     {
         goods.OperatorID = CurrentUser.UserID;
     }
     GoodsService.ModifyGoods(goods);
     Response.Redirect("/Goods/Index?" + goods.Url);
 }
コード例 #21
0
        private void Txt_GoodsId_EditValueChanged(object sender, EventArgs e)
        {
            Goods good = new GoodsService().GetByGoodsId(Txt_GoodsId.Text);

            if (good != null)
            {
                lblBookName.Text = good.FullName;
            }
        }
コード例 #22
0
        /// <summary>
        /// 订单出库  查询未出库订单
        /// </summary>
        /// <param name="carrierid"></param>
        /// <param name="storageid"></param>
        /// <param name="customerid"></param>
        /// <param name="status"></param>
        /// <param name="p"></param>
        /// <returns></returns>
        public ActionResult OrderOut(int carrierid    = 0, int storageid   = 0, int customerid = 0, int status     = -1, string orderno = "",
                                     string begindate = "", string enddate = "", string orderOutStatus = "", int p = 1, int pageSize    = 20)
        {
            List <OrderEntity> mList = null;

            orderOutStatus = !string.IsNullOrEmpty(orderOutStatus) ? orderOutStatus : "F";//默认未出库订单

            // 默认当月
            if (string.IsNullOrEmpty(begindate) || string.IsNullOrEmpty(enddate))
            {
                DateTime dt = DateTime.Now;
                begindate = dt.Year + "-" + dt.Month + "-" + "01";
                enddate   = DateTime.Now.ToString("yyyy-MM-dd");
            }
            //查询未出库 已安排运输计划订单
            int count = OrderService.GetOrderCount("", carrierid, storageid, customerid, status, -1, -1, "", orderno, begindate, enddate, -1, "", "", orderOutStatus, "T", " AND OrderType!='YSDDB'");

            PagerInfo pager = new PagerInfo();

            pager.PageIndex = p;
            pager.PageSize  = pageSize;
            pager.SumCount  = count;
            pager.URL       = "OrderOut";


            //if (status > -1 || carrierid > 0 || storageid > 0 || customerid > 0 || !string.IsNullOrEmpty(orderno) || !string.IsNullOrEmpty(begindate) || !string.IsNullOrEmpty(enddate))
            //{
            mList = OrderService.GetOrderInfoByRule(pager, "", carrierid, storageid, customerid, status, -1, -1, "", orderno, begindate, enddate, -1, "", "", orderOutStatus, "T", " AND OrderType!='YSDDB'");
            //}
            //else
            //{
            //    mList = OrderService.GetOrderInfoPager(pager);
            //}
            //默认承运商
            ViewBag.Carrier = CarrierService.GetCarrierByRule("", 1);    //只显示使用中的数据
            //默认仓库
            ViewBag.Storage = StorageService.GetStorageByRule("", 1);    //只显示使用中的数据
            //门店
            ViewBag.Goods = GoodsService.GetGoodsByRule("", 1);          //只显示使用中的数据
            //客户信息
            ViewBag.Customer = CustomerService.GetCustomerByRule("", 1); //只显示使用中的数据

            ViewBag.UserID         = CurrentUser != null?CurrentUser.UserID:-1;
            ViewBag.Status         = status;
            ViewBag.carrierid      = carrierid;
            ViewBag.customerid     = customerid;
            ViewBag.storageid      = storageid;
            ViewBag.OrderList      = mList;
            ViewBag.PageSize       = pageSize;
            ViewBag.BeginDate      = begindate;
            ViewBag.OrderNo        = orderno;
            ViewBag.EndDate        = enddate;
            ViewBag.orderOutStatus = orderOutStatus;
            ViewBag.Pager          = pager;
            return(View());
        }
コード例 #23
0
        public MainPresenter(Form view, IUnitOfWork unit)
        {
            _goodsService     = new GoodsService(unit);
            _warehouseService = new WarehouseService(unit);
            _staffService     = new StaffService(unit);
            _orderService     = new OrderService(unit);

            _view = (MainMenuView)view;
            SubscribeOnViewEvents();
        }
コード例 #24
0
ファイル: BookListForm.cs プロジェクト: khanhnguyen18/tvqlLib
        private void FrmBookList_Load(object sender, EventArgs e)
        {
            //this.booksTableAdapter_0.SqlConnection_0.ConnectionString = Class7.string_6;
            this.Text = "Danh mục s\x00e1ch trong thư viện";

            GoodsService goodsSer = new GoodsService();

            this.gridControl1.DataSource = goodsSer.GetListBook().Tables[0];

            this.gridView1.BestFitColumns();
        }
コード例 #25
0
ファイル: BO.cs プロジェクト: SergeyKononovich/EpamTraining
        public BO(IDAO dao)
        {
            if (dao == null) throw new ArgumentNullException(nameof(dao));

            DAO = dao;
            ClientService = new ClientService(dao.ClientRepository);
            GoodsService = new GoodsService(dao.GoodsRepository);
            ManagerService = new ManagerService(dao.ManagerRepository);
            SaleService = new SaleService(dao.SaleRepository);
            Log.Trace("BO created.");
        }
コード例 #26
0
        public IActionResult Index()
        {
            //input 1
            //var receipt = new GoodsService().GetReceipt(InputData.GetGoodsInput());
            //input 2
            var receipt = new GoodsService().GetReceipt(InputData.GetImportedGoodsInput());

            ViewBag.Receipt = receipt;

            return(View());
        }
コード例 #27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["istongji"]))
            {
                CacheCollection.RemoveCacheByKey(CacheCollection.KEY_ALLBUYNINFO);
                string nick    = Request.QueryString["nick"];
                string session = Request.QueryString["session"];
                if (Request.Cookies["nick"] == null)
                {
                    IList <TaoBaoGoodsClassInfo> classList = TopAPI.GetGoodsClassInfoList(nick, session);

                    if (classList != null)
                    {
                        TaoBaoGoodsClassService tbgcDal = new TaoBaoGoodsClassService();

                        foreach (TaoBaoGoodsClassInfo cinfo in classList)
                        {
                            tbgcDal.InsertGoodsClass(cinfo, nick);
                        }
                    }

                    GoodsService            goodsDal = new GoodsService();
                    IList <TaoBaoGoodsInfo> list     = TopAPI.GetGoodsInfoListByNick(nick, session);

                    foreach (TaoBaoGoodsInfo info in list)
                    {
                        goodsDal.InsertGoodsInfo(info, nick);
                    }
                }

                HttpCookie cookie      = new HttpCookie("nick", HttpUtility.UrlEncode(nick));
                HttpCookie cooksession = new HttpCookie("nicksession", session);
                cookie.Expires      = DateTime.Now.AddDays(1);
                cooksession.Expires = DateTime.Now.AddDays(1);

                Response.Cookies.Add(cookie);
                LogInfo.Add("添加了cookie", nick);

                Session["snick"]    = nick;
                Session["ssession"] = session;

                Response.Cookies.Add(cooksession);

                HttpCookie tongji = new HttpCookie("istongji", Request.QueryString["istongji"]);
                tongji.Expires = DateTime.Now.AddDays(1);
                Response.Cookies.Add(tongji);

                Response.Redirect("http://www.7fshop.com/top/index.html");
            }
        }
    }
コード例 #28
0
 public OrderController(OrderService orderService,
                        UserService userService,
                        GoodsService goodsService,
                        UserManager <WebUser> userManager,
                        ILogger <OrderController> logger)
 {
     _orderService = orderService;
     _userService  = userService;
     _goodsService = goodsService;
     _userManager  = userManager;
     _logger       = logger;
 }
コード例 #29
0
        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            GridView1.PageIndex = e.NewPageIndex;
            GoodsService.GetInstance().findGoodsList();
            DataSet dataset = GoodsService.GetInstance().findGoodsList();

            if ((dataset != null) && (dataset.Tables[0].Rows.Count > 0))
            {
                GridView1.DataSource = dataset;
                GridView1.DataBind();
            }
        }
コード例 #30
0
ファイル: UpdateGoods.aspx.cs プロジェクト: mike442144/FBS
        public void BindMyPage()
        {
            GoodsDetailsModel model = new GoodsService().GetOneGoodsContentByID(new Guid(GoodsID));

            TB_GoodsName.Text        = model.GoodsName;
            TB_NowPrice.Text         = model.GoodsNowPrice.ToString();
            TB_OldPrice.Text         = model.GoodsOldPrice.ToString();
            C_BeginTime.SelectedDate = model.GoodsBeginTime;
            C_EndTime.SelectedDate   = model.GoodsEndTime;
            //FU_Pic.= model.GoodsPicURL;
            editor1.InnerText = model.GoodsDetailsContent;
        }
コード例 #31
0
ファイル: GoodsManager.cs プロジェクト: Steveluy/eShopWeb
        public async Task EditGoods(Guid id, string name, string imgUrl, double price, double price_old)
        {
            using (IDAL.IGoodsService goodsService = new GoodsService())
            {
                var good = await goodsService.GetOneByIdAsync(id);

                good.Name      = name;
                good.ImgUrl    = imgUrl;
                good.Price     = price;
                good.Price_old = price_old;
                await goodsService.EditAsync(good);
            }
        }