/// <summary> /// 取消回報 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btn_Cancel_Click(object sender, EventArgs e) { try { Button btn = sender as Button; foreach (GridViewRow row in gv_List.Rows) { Button btnTest = GetCellByName(row, "功能").FindControl("btn_Cancel") as Button; //判斷是否是按下按鈕的那一行 if (btnTest == btn) { issue = new POS_Library.DB.IssueReport(); //傳票 //TempCell = GetCellByName(row, "傳票"); //issue.TicketId = int.Parse(TempCell.Text); //代入參數(2013-0313修改) issue.Id = btnTest.Attributes["ticket"]; if (issue.FlowStatus == (int)EnumData.FlowType.調出 || issue.FlowStatus == (int)EnumData.FlowType.門市進貨)//門市台組退倉 { if (issue.TicketId == null) { lbl_Message.Text = "傳票不可為空!!"; return; } } //取消回報 POS_Library.ShopPos.Storage.SetExportTicket(issue.Id, _areaId); var result = sp.UpdateIssueReportsEnd(issue.Id, account, DateTime.Now, (int)POS_Library.ShopPos.EnumData.FlowType.補貨確認); if (result != null) { lbl_Message.Text = result.Reason; //成功則改狀態 if (result.Result == "1") { btnTest.Visible = false; Button btnTemp = GetCellByName(row, "功能").FindControl("btn_Finish") as Button; btnTemp.Visible = true; GetCellByName(row, "處理狀態").Text = "已處理"; } } } } } catch (Exception ex) { Response.Write("系統發生錯誤 " + ex.Message); } }
/// <summary> /// 傳票數量異常回報(第一次驗貨回報) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btn_Send_Click(object sender, EventArgs e) { try { if (DDL_Reason.SelectedValue == "未選擇") { lbl_Message.Text = "請選擇原因"; return; } var listBoxs = ListBoxProducts(); var ticketId = int.Parse(txt_ticket_id.Text.Trim()); if (listBoxs.Any()) { var flowType = NameToType(lbl_FlowStatus.Text); if (flowType == 0) { lbl_Message.Text = "字形無法解析!請重新回報!"; return; } var issueReportList = new List <POS_Library.DB.IssueReport>(); var shipDa = new POS_Library.ShopPos.ShipInDA(); int store = POS_Library.Public.Utility.GetStore(_areaId); var box = shipDa.GetPosTicketBox(int.Parse(txt_ticket_id.Text.Trim()), _areaId); var comment = "POS:" + DDL_Reason.SelectedValue; //把ListBox中的串成List foreach (var item in listBoxs) { //經由傳票回報所以一定要有傳票資訊 POS_Library.DB.IssueReport iss = new POS_Library.DB.IssueReport(); //填入傳票,建立者,建立日期,產品編號,數量,缺或多件,倉庫類別 iss.TicketId = ticketId; iss.BoxNum = box; iss.CreateAuditor = account; iss.CreateDate = DateTime.Now; iss.ProductId = item.Product; iss.Quantity = item.Quantity; iss.IsQuantity = item.IsLack != true; iss.ShopType = store; iss.FlowStatus = flowType; iss.Comment = comment; issueReportList.Add(iss); } //寫入issueReport result = shipDa.SetDiff(issueReportList); if (result != null) { lbl_Message.Text = result.Reason; //成功清空 if (result.Result == "1") { LB_Product_Id1.Items.Clear(); } } } } catch (Exception ex) { Response.Write("系統發生錯誤 " + ex.Message); } }
/// <summary> /// 結案 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btn_Finish_Click(object sender, EventArgs e) { try { Button btn = sender as Button; foreach (GridViewRow row in gv_List.Rows) { Button btnTest = GetCellByName(row, "功能").FindControl("btn_Finish") as Button; //判斷是否是按下按鈕的那一行 if (btnTest == btn) { issue = new POS_Library.DB.IssueReport(); //傳票 //TempCell = GetCellByName(row, "傳票"); //issue.TicketId = int.Parse(TempCell.Text); //代入參數(2013-0313修改) issue.TicketId = int.Parse(btnTest.Attributes["ticket"]); //帳號 TempCell = GetCellByName(row, "帳號"); issue.Account = (TempCell.Text == "" || TempCell.Text == " ") ? "" : TempCell.Text; //出貨序號 TempCell = GetCellByName(row, "出貨序號"); if (TempCell.Text != "" && TempCell.Text != " ") { issue.ShipOutId = int.Parse(TempCell.Text); } //產品編號 TempCell = GetCellByName(row, "產品編號"); issue.ProductId = TempCell.Text; //數量/多缺 TempCell = GetCellByName(row, "數量"); if (int.Parse(TempCell.Text) > 0) { issue.Quantity = int.Parse(TempCell.Text); issue.IsQuantity = true; } else { issue.Quantity = int.Parse(TempCell.Text) * -1; issue.IsQuantity = false; } //倉庫類別 issue.ShopType = POS_Library.Public.Utility.GetStoreForShop(_areaId); //回報人 TempCell = GetCellByName(row, "回報人"); issue.HandleAuditot = TempCell.Text; //回報日期 TempCell = GetCellByName(row, "回報日期"); issue.HandleDate = DateTime.Parse(TempCell.Text); //處理人 issue.HandleAuditot = account; //處理日期 issue.HandleDate = DateTime.Now; //結案人 TempCell = GetCellByName(row, "結案人"); issue.FinishAuditor = account; //結案日期 TempCell = GetCellByName(row, "結案日期"); issue.FinishDate = DateTime.Now; //類別 TempCell = GetCellByName(row, "類別"); issue.FlowStatus = NameToType(TempCell.Text); //類別 TempCell = GetCellByName(row, "Id"); issue.Id = TempCell.Text; if (issue.FlowStatus == (int)EnumData.FlowType.調出) { if (issue.TicketId == null) { lbl_Message.Text = "調出傳票不可為空!!"; return; } else { //SetDelTicket(issue.TicketId.Value, issue.ProductId); } } //寫入issueReport result = sp.UpdateIssueReportsEnd(issue); lbl_Message.Text = "結案成功!!"; if (result != null) { lbl_Message.Text = result.Reason; //成功則改狀態 if (result.Result == "1") { btnTest.Visible = false; GetCellByName(row, "處理狀態").Text = "已結案"; } } } } } catch (Exception ex) { Response.Write("系統發生錯誤 " + ex.Message); } }