protected void Page_Load(object sender, EventArgs e) { if (Session["Account"] == null) { Response.Write(" <script> parent.document.location= 'logout.aspx' </script> "); Response.End(); } else { account = Session["Account"].ToString(); if (!IsPostBack) { if (Request["storage"] == null || Request["ticketType"] == null || Request["flowType"] == null || Request["pagekey"] == null || Request["areaId"] == null || Request["importType"] == null) { lbl_Message.Text = "資料錯誤!!"; return; } var shelf = Request["storage"]; var importType = Request["importType"]; var ticketType = Request["ticketType"]; var flowType = int.Parse(Request["flowType"].ToString()); var pagekey = Request["pagekey"]; var areaId = Request["areaId"]; ViewState["flowType"] = flowType; ViewState["pagekey"] = pagekey; ViewState["areaId"] = areaId; ViewState["importType"] = importType; ViewState["ticketType"] = ticketType; lbl_Storage_NO.Text = shelf; if (Session["ProductDatas"] != null) { tempallproduct = Session["ProductDatas"] as List <ImportClass.ProductData>; Session["ProductDatas"] = null; } else { lbl_Message.Text = "時間過長!!請重新動做!!"; return; } //改成function(2014-0425修改) var flowT = FlowType(flowType); if (flowT == 0) { lbl_Message.Text = "無此類型入庫!!"; return; } var shipDa = new POS_Library.ShopPos.ShipInDA(); var ticks = tempallproduct.Select(x => int.Parse(x.Ticket)).Distinct().ToList(); int store = POS_Library.Public.Utility.GetStore(int.Parse(areaId)); var issue = shipDa.GetIssueReports(ticks, store, flowType).Where(x => string.IsNullOrEmpty(x.HandleAuditot)).ToList(); //依驗貨完的傳票尋找是否有回報問題的傳票產品 var diffs = issue.Select(x => new ImportClass.ProductData() { Ticket = x.TicketId.Value.ToString(), Name = x.ProductId, Quantity = x.Quantity, IsQuantity = x.IsQuantity }).ToList(); if (tempallproduct.Count > 0) { lbl_ProductNormal.Text = "內容:<br />"; CompositeListBox(tempallproduct, false); } else { btn_Check.Visible = false; listboxNormal.Visible = false; } if (issue.Any()) { lbl_ProductDiff.Text = "差異:<br />"; CompositeListBox(diffs, true); } else { listboxDiff.Visible = false; } //顯示儲位類型 lbl_Storage_NO_Type.Text = CF.TypeToName(shipDa.CheckStorage(lbl_Storage_NO.Text, int.Parse(areaId))); } } }