Beispiel #1
0
        protected void btn_Search_Click(object sender, EventArgs e)
        {
            try
            {
                bool isAudit    = false;
                var  selectType = int.Parse(DDL_Type.SelectedValue);
                //門市/福袋、瑕疵退廠調出查詢
                var shipDa     = new POS_Library.ShopPos.ShipOutDA();
                var posTickets = shipDa.PosTickets(selectType, _areaId);
                int si         = 1;
                var temp       = posTickets.OrderByDescending(x => x.TicketDate).Select(x => new
                {
                    序號   = si++,
                    傳票ID = x.TicketId,
                    出貨日期 = x.TicketDate.ToString("yyyy-MM-dd"),
                    印單日期 = x.VerifyDate == null ? "" : x.VerifyDate.Value.ToString("yyyy-MM-dd"),
                    驗貨日期 = x.AuditDate == null ? "" : x.AuditDate.Value.ToString("yyyy-MM-dd"),
                    驗貨者  = x.AuditAccount,
                    功能   = "",
                }).ToList();
                gv_List.DataSource = temp;
                gv_List.DataBind();

                lbl_Count.Text = "總筆數:" + gv_List.Rows.Count;
            }
            catch (Exception ex)
            {
                lbl_Message.Text = ex.Message;
            }
        }
Beispiel #2
0
        public void Search()
        {
            try
            {
                var temp = new List <POS_Library.ShopPos.DataModel.ImportClass.TicketDetailModel>();
                if (!string.IsNullOrEmpty(box))
                {
                    var shipDa = new POS_Library.ShopPos.ShipInDA();
                    temp = shipDa.GetPosBoxDetail(box, areaId);
                }
                else if (ticketId != 0)
                {
                    var shipDa = new POS_Library.ShopPos.ShipOutDA();
                    temp = shipDa.GetTicketDetail(ticketId, areaId, false, true);
                }
                int x     = 1;
                var temp2 = (from i in temp
                             select new
                {
                    序號 = x++,
                    傳票ID = i.TicketId,
                    產品編號 = i.ProductId,
                    數量 = i.Quantity
                }).ToList();

                gv_List.DataSource = temp2;
                gv_List.DataBind();

                var 總筆數 = temp2.Count;
                var 傳票數 = temp2.Select(y => y.傳票ID).Distinct().Count();
                var 總件數 = temp2.Sum(y => y.數量);

                lbl_Count.Text = "總筆數: " + 總筆數 + ", 傳票數: " + 傳票數 + ", 總件數: " + 總件數;
            }
            catch (Exception ex)
            {
                lbl_Count.Text = ex.Message;
            }
        }
Beispiel #3
0
 public void ShipOutDetail(int pickType, int num, string productid, int store)
 {
     try
     {
         var ticketShelfTempList = new List <POS_Library.ShopPos.DataModel.TicketShelfTemp>();
         var shipDa = new POS_Library.ShopPos.ShipOutDA();
         ticketShelfTempList = shipDa.PickDetailCk(num, pickType, store);
         if (!string.IsNullOrEmpty(productid))
         {
             ticketShelfTempList = ticketShelfTempList.Where(x => x.ProductId == productid).ToList();
         }
         ticketShelfTempList = ticketShelfTempList.Select(x => new POS_Library.ShopPos.DataModel.TicketShelfTemp
         {
             Ticket       = x.Ticket,
             ShipId       = x.ShipId,
             Account      = x.Account,
             ShipNo       = x.ShipNo,
             ProductId    = x.ProductId,
             Quantity     = x.Quantity,
             Repository   = x.Repository,
             Division     = x.Division,
             Floor        = x.Floor,
             GuestId      = x.GuestId,
             NowQuantity  = x.NowQuantity,
             LackQuantity = x.LackQuantity
         }).ToList();
         //產生無貨表供勾選
         if (ticketShelfTempList.Count > 0)
         {
             int x      = 1;
             var result = (from i in ticketShelfTempList
                           orderby i.Division
                           select new
             {
                 序號 = x++,
                 傳票號碼 = i.Ticket,
                 訂單編號 = i.GuestId,
                 商品編號 = i.ProductId,
                 別 = i.Repository,
                 儲位名稱 = i.Division,
                 應有數量 = i.NowQuantity,
                 現有數量 = i.NowQuantity,
                 短缺數量 = i.LackQuantity,
                 樓層 = i.Floor,
                 GuestId = i.GuestId,
                 出貨序號 = i.ShipId,
                 貨運單號 = i.ShipNo,
                 帳號 = i.Account,
             }).ToList();
             if (result.Count == 0)
             {
                 lbl_Message.Text = "此無貨撿貨單已全部處理完成!請重新列印撿貨單!!";
             }
             gv_List.DataSource = result;
             gv_List.DataBind();
         }
         else
         {
             lbl_Message.Text = "無資料!";
         }
     }
     catch (Exception ex)
     {
         Response.Write("系統發生錯誤 " + ex.Message);
     }
 }