private DataTable getDataTableByDisplay小百貨明細(CKGPartOrderDetail[] p_detail) { string[] l_Msg = new string[] { "項次", "單號", "產品編號", "產品名稱", "數量", "金額", "販賣價", "開單人員" }; DataTable l_dt = CTools.getFilledColumnsDataTable(l_Msg); for (int i = 0; i < p_detail.Length; i++) { DataRow l_row = l_dt.NewRow(); l_row["項次"] = "1"; l_row["單號"] = p_detail[i].f_ExchangeID請購單號; l_row["產品編號"] = p_detail[i].f_ProductID產品編號; l_row["產品名稱"] = p_detail[i].f_ProductName產品名稱; l_row["數量"] = p_detail[i].f_Amount選購數量; l_row["金額"] = p_detail[i].f_Cost產品成本價; l_row["販賣價"] = p_detail[i].f_SalePrice販賣價; CKGPartOrder l_order = _context.CFactoryManager.CKGPartOrderFactory. getKGPartOrderBy請購單號(p_detail[i].f_ExchangeID請購單號); try { l_row["開單人員"] = _context.CFactoryManager.CUserFactory.get高都員工檔( l_order.f_AssistantSmid助理員編).f_username姓名; } catch { l_row["開單人員"] = "無此員編(" + l_order.f_AssistantSmid助理員編 + ")"; } l_dt.Rows.Add(l_row); } return(l_dt); }
private void 發送Email(string p_str請購單位, CKGPartOrder p_codes) { CKGPartOrderMail l_mail = new CKGPartOrderMail(_context); l_mail.設定Mail(p_str請購單位, p_codes); l_mail.發送Mail();//發送Mail*********測試期間先拿掉************** }
protected void _btn送出清單_Click(object sender, EventArgs e) { CUser l_user = Session[SealedGlobalPage.SESSIONKEY_LOGIN_USER_DATA] as CUser; if (l_user.f_lvl等級 != 4) { if (!_rbl廠商.SelectedValue.Equals("KG")) { if ("".Equals(iv_txt引擎號碼.Text.Trim())) { string l_str = "alert('引擎號碼不能空白');"; ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "OK", l_str, true); return; } else { CKGPartOrder l_code = _context.CFactoryManager.CKGPartOrderFactory. get顧客姓名ByEngo(iv_txt引擎號碼.Text.Trim()); if (l_code == null) { string l_str = "alert('引擎號碼錯誤,請重新確認 ex:注意大小寫');"; ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "OK", l_str, true); return; } } } } 送出請購清單(); }
private string get列印領料單Html(string p_strEID) { string l_str助理員編 = (Session[SealedGlobalPage.SESSIONKEY_LOGIN_USER_DATA] as CUser).f_userid帳號;//"H9503";// CKGPartOrderFactory l_factory主檔 = _context.CFactoryManager.CKGPartOrderFactory; CKGPartOrder l_code主檔 = l_factory主檔.getKGPartOrderBy請購單號(p_strEID, l_str助理員編); if (l_code主檔 != null) { l_code主檔.明細 = _context.CFactoryManager.CKGPartOrderDetailFactory.get請購明細ByExchangeID(p_strEID); int l_intcount = (l_code主檔.明細.Length / 10); //一頁10筆,總列印頁整數數 if (l_code主檔.明細.Length % 10 != 0) //最後一頁未滿10筆的,要再加1頁 { l_intcount++; } return(組HTML(l_code主檔, l_intcount)); } else { return("<font size=\"5\"><b>查無資料!!</b>"); } }
private void insertTo退貨記錄(string p_str請購單號, string p_str產品編號, int p_int退貨數量) { CKGPartOrderFactory l_factory請購主檔 = _context.CFactoryManager.CKGPartOrderFactory; CKGPartOrder l_code請購主檔 = l_factory請購主檔.getKGPartOrderBy請購單號(p_str請購單號); CKGPartOrderDetailFactory l_factory請購明細 = _context.CFactoryManager.CKGPartOrderDetailFactory; CKGPartOrderDetail l_code請購明細 = l_factory請購明細.get請購單內的單一產品明細(p_str請購單號, p_str產品編號); CKGPartOrderDetailOutFactory l_factroy退貨記錄 = _context.CFactoryManager.CKGPartOrderDetailOutFactory; CKGPartOrderDetailOut l_code退貨記錄 = l_factroy退貨記錄.createCKGPartOrderDetailOut(); CUser l_user = Session[SealedGlobalPage.SESSIONKEY_LOGIN_USER_DATA] as CUser; l_code退貨記錄.f_ExchangeID請購單號 = p_str請購單號; l_code退貨記錄.f_SalesSmid業代員編 = l_code請購主檔.f_SalesSmid業代員編; l_code退貨記錄.f_SalesBranch業代單位 = l_user.f_branchid所別; l_code退貨記錄.f_AssistantSmid退貨助理員編 = l_user.f_userid帳號; //"F9446";// l_code退貨記錄.f_ProductID產品編號 = l_code請購明細.f_ProductID產品編號; l_code退貨記錄.f_ProductName產品名稱 = l_code請購明細.f_ProductName產品名稱; l_code退貨記錄.f_OutAmount退貨數量 = p_int退貨數量; l_code退貨記錄.f_OutDate退貨日期 = DateTime.Today.ToString("yyyy/MM/dd"); l_code退貨記錄.f_Qty產品單位 = l_code請購明細.f_Qty產品單位; l_code退貨記錄.f_Cost產品成本 = l_code請購明細.f_Cost產品成本價; l_code退貨記錄.f_UnitPrice產品單價 = l_code請購明細.f_UnitPrice產品單價; l_code退貨記錄.f_ListPrice建議售價 = l_code請購明細.f_ListPrice建議售價; l_code退貨記錄.f_OutTotal總計退貨價格 = l_code請購明細.f_UnitPrice產品單價 * p_int退貨數量; l_code退貨記錄.f_OutReasons退貨原因 = iv_txt退貨原因.Text.Replace("'", ""); l_code退貨記錄.f_Check管理者確認退貨 = "False"; l_code退貨記錄.f_EditDate編輯日期 = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"); l_factroy退貨記錄.insertCKGPartOrderDetailOut(l_code退貨記錄); }
private void 確認訂購並發送Email(CKGPartOrder p_codes) { if (!"KG".Equals(p_codes.f_Vendor請購廠商))//廠商不是高輊時都要發送Email { 發送Email(p_codes.f_Branchid請購單位, p_codes); } _context.CFactoryManager.CKGPartOrderFactory.update訂購或點收後請購單的狀態(p_codes); }
private DataTable getDataTableByDisplay(CKGPartOrderDetail[] p_detail, CWork[] p_work) { string[] l_Msg = new string[] { "日期", "單號", "產品編號/洗車總類", "產品名稱/引擎號碼", "數量", "金額", "開單人員", "顧客姓名" }; DataTable l_dt = CTools.getFilledColumnsDataTable(l_Msg); if (p_detail != null) { for (int i = 0; i < p_detail.Length; i++) { DataRow l_row = l_dt.NewRow(); l_row["日期"] = p_detail[i].f_EditDate編輯日期; l_row["單號"] = p_detail[i].f_ExchangeID請購單號; l_row["產品編號/洗車總類"] = p_detail[i].f_ProductID產品編號; l_row["產品名稱/引擎號碼"] = p_detail[i].f_ProductName產品名稱; l_row["數量"] = p_detail[i].f_Amount選購數量; l_row["金額"] = p_detail[i].f_UnitPrice產品單價; CKGPartOrder l_order = _context.CFactoryManager.CKGPartOrderFactory. getKGPartOrderBy請購單號(p_detail[i].f_ExchangeID請購單號); try { l_row["開單人員"] = _context.CFactoryManager.CUserFactory.get高都員工檔( l_order.f_AssistantSmid助理員編).f_username姓名; } catch { l_row["開單人員"] = "無此員編(" + l_order.f_AssistantSmid助理員編 + ")"; } l_dt.Rows.Add(l_row); l_row["顧客姓名"] = p_detail[i].顧客姓名; } } if (p_work != null) { for (int i = 0; i < p_work.Length; i++) { CKGPartOrder lCustomerName = _context.CFactoryManager.CKGPartOrderFactory. get顧客姓名ByEngo(p_work[i].f_engo引擎號碼); DataRow l_row = l_dt.NewRow(); l_row["日期"] = p_work[i].f_editdate開單日期; l_row["單號"] = p_work[i].f_workid工單單號; l_row["產品名稱/引擎號碼"] = p_work[i].f_engo引擎號碼; l_row["顧客姓名"] = lCustomerName == null ? "" : lCustomerName.f_customername顧客姓名; l_row["金額"] = p_work[i].f_money金額; l_row["產品編號/洗車總類"] = p_work[i].f_workType洗車種類; l_row["開單人員"] = _context.CFactoryManager.CUserFactory.get高都員工檔( p_work[i].f_edituser開單人員).f_username姓名; l_dt.Rows.Add(l_row); } } return(l_dt); }
private string get退貨單Html(string p_strEID) { CUser l_user = Session[SealedGlobalPage.SESSIONKEY_LOGIN_USER_DATA] as CUser; string l_str助理員編 = l_user.f_userid帳號;// "F9446";// CKGPartOrderDetailOutFactory l_factory退貨 = _context.CFactoryManager. CKGPartOrderDetailOutFactory; CKGPartOrderDetailOut[] l_codes退貨 = l_factory退貨. get退貨資料By請購單號(p_strEID, l_str助理員編); if (l_codes退貨 == null) { return("<font size=\"5\"><b>查無資料!!</b>"); } CKGPartOrder l_code主檔 = _context.CFactoryManager.CKGPartOrderFactory.createCKGPartOrder(); l_code主檔.f_ExchangeID請購單號 = l_codes退貨[0].f_ExchangeID請購單號; l_code主檔.f_SalesSmid業代員編 = l_codes退貨[0].f_SalesSmid業代員編; l_code主檔.f_SalesName業代姓名 = l_codes退貨[0].f_SalesName業代姓名; l_code主檔.f_SalesBranch業代單位 = l_codes退貨[0].f_SalesBranch業代單位; l_code主檔.f_InsertDate請購日期 = l_codes退貨[0].f_OutDate退貨日期; l_code主檔.f_Memo備註說明 = l_codes退貨[0].f_OutReasons退貨原因; l_code主檔.明細 = new CKGPartOrderDetail[l_codes退貨.Length]; int l_int總計價格 = 0; for (int i = 0; i < l_codes退貨.Length; i++) { l_code主檔.明細[i] = _context.CFactoryManager.CKGPartOrderDetailFactory.createCKGPartOrderDetail(); l_code主檔.明細[i].f_ProductID產品編號 = l_codes退貨[i].f_ProductID產品編號; l_code主檔.明細[i].f_ProductName產品名稱 = l_codes退貨[i].f_ProductName產品名稱; l_code主檔.明細[i].f_UnitPrice產品單價 = l_codes退貨[i].f_UnitPrice產品單價; l_code主檔.明細[i].f_Amount選購數量 = l_codes退貨[i].f_OutAmount退貨數量; l_code主檔.明細[i].f_Total總計價格 = l_codes退貨[i].f_OutTotal總計退貨價格; l_int總計價格 += l_codes退貨[i].f_OutTotal總計退貨價格; } l_code主檔.f_TotalPrice總計價格 = l_int總計價格; int l_intcount = (l_code主檔.明細.Length / 10); //一頁10筆,總列印頁整數數 if (l_code主檔.明細.Length % 10 != 0) //最後一頁未滿10筆的,要再加1頁 { l_intcount++; } return(組HTML(l_code主檔, l_intcount)); }
private void 新增應收帳款(CKGPartOrder p_Order) { CInMoney l_InMoney = _context.CFactoryManager.CInMoneyFactory.createCInMoney(); l_InMoney.f_editdate帳款日期 = p_Order.f_InsertDate請購日期; l_InMoney.f_isclose是否關帳 = "N"; l_InMoney.f_memo備註 = ""; l_InMoney.f_moneyid應收單號 = ""; l_InMoney.f_money應收金額 = p_Order.f_TotalPrice總計價格; l_InMoney.f_smid帳款人 = p_Order.f_SalesSmid業代員編; l_InMoney.f_type種類 = "百貨"; l_InMoney.f_workid工單單號 = p_Order.f_ExchangeID請購單號; l_InMoney.f_yesmoney已沖金額 = 0; _context.CFactoryManager.CInMoneyFactory.insert(l_InMoney); }
private void 自動發信() { get請購清單(); if (_CKGPartOrder == null) { return; } if (_CKGPartOrder.Length <= 0) { return; } for (int i = 0; i < _CKGPartOrder.Length; i++) { string l_str請購所別 = dataGridView1.Rows[i].Cells["請購所別"].Value.ToString(); string l_str對象廠商 = dataGridView1.Rows[i].Cells["對象廠商"].Value.ToString(); CKGPartOrderFactory l_factory = _context.CFactoryManager.CKGPartOrderFactory; CKGPartOrder[] l_codes = l_factory.get所別未定購的請購明細(l_str對象廠商, l_str請購所別); ArrayList l_al = new ArrayList(); for (int j = 0; j < l_codes.Length; j++) { //CUser l_user = _context.CFactoryManager.CUserFactory.get高都員工檔(l_codes[j].f_SalesSmid業代員編); //l_codes[j].f_SalesName業代姓名 = l_user.f_username姓名; //string l_str顯示字串 = l_codes[i].f_ExchangeID請購單號 + " " + l_codes[i].f_Branchid請購單位 + " " + l_codes[i].f_SalesName業代姓名; //iv_lbx請購單號.Items.Add(new ListItem(l_str顯示字串, l_codes[i].f_ExchangeID請購單號)); l_al.Add(l_codes[j].f_ExchangeID請購單號); } CKGPartOrder[] l_code選擇 = new CKGPartOrder[l_al.Count]; for (int k = 0; k < l_code選擇.Length; k++) { //try //{ l_code選擇[k] = l_factory.getKGPartOrderBy請購單號((string)l_al[k]); 確認訂購並發送Email(l_code選擇[k]); _txtLog.Text += l_code選擇[k].f_ExchangeID請購單號 + "發送完成!" + DateTime.Now + "\r\n"; //} //catch { _txtLog.Text += l_code選擇[k].f_ExchangeID請購單號 + "發送失敗!" + DateTime.Now + "\r\n"; } } } }
private void 送出訂購單(ArrayList p_al) { string l_Msg = ""; CKGPartOrder[] l_code選擇 = new CKGPartOrder[p_al.Count]; CKGPartOrderFactory l_factory = _context.CFactoryManager.CKGPartOrderFactory; for (int i = 0; i < l_code選擇.Length; i++) { try { l_code選擇[i] = l_factory.getKGPartOrderBy請購單號((string)p_al[i]); 確認訂購並發送Email(l_code選擇[i]); } catch { l_Msg = "alert('訂購作業失敗,訂購單號為: " + l_code選擇[i].f_ExchangeID請購單號 + ",訂購郵件發送失敗!"; ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "OK", l_Msg, true); } } l_Msg = "alert('訂購作業完成,訂購郵件發送成功');"; ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "OK", l_Msg, true); //寫入KGPartInMoney(l_code選擇); }
private DataTable getDataTableByDisplay明細(CWork p_work) { string[] l_Msg = new string[] { "項次", "單號", "金額", "引擎號碼", "顧客姓名", "洗車總類", "開單人員" }; DataTable l_dt = CTools.getFilledColumnsDataTable(l_Msg); //fix by fox CKGPartOrder lCustomerName = _context.CFactoryManager.CKGPartOrderFactory. get顧客姓名ByEngo(p_work.f_engo引擎號碼); DataRow l_row = l_dt.NewRow(); l_row["項次"] = "1"; l_row["單號"] = p_work.f_workid工單單號; l_row["引擎號碼"] = p_work.f_engo引擎號碼; l_row["顧客姓名"] = (lCustomerName == null) ? "" : lCustomerName.f_customername顧客姓名; l_row["金額"] = p_work.f_money金額; l_row["洗車總類"] = p_work.f_workType洗車種類; l_row["開單人員"] = _context.CFactoryManager.CUserFactory.get高都員工檔( p_work.f_edituser開單人員).f_username姓名; l_dt.Rows.Add(l_row); return(l_dt); }
private void 送出請購清單() { DataTable l_dt = (DataTable)Session[SealedGlobalPage.SESSIONKEY_KGPARTORDER_TEMPTABLE]; if (l_dt.Rows.Count == 0) { string l_str = "alert('清單內無任何資料,請加入請購產品至清單內');"; ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "OK", l_str, true); return; } else { CKGPartOrderFactory l_factory主檔 = _context.CFactoryManager.CKGPartOrderFactory; CKGPartOrder l_code主檔 = l_factory主檔.createCKGPartOrder(); string l_str請購單號 = ""; CUser l_User = (Session[SealedGlobalPage.SESSIONKEY_LOGIN_USER_DATA] as CUser); l_str請購單號 = CTools.get訂單號碼(l_User.f_branchid所別); l_code主檔.f_ExchangeID請購單號 = l_str請購單號; l_code主檔.f_EngineNo引擎號碼 = iv_txt引擎號碼.Text.Trim(); l_code主檔.f_Vendor請購廠商 = _rbl廠商.SelectedValue; l_code主檔.f_AssistantSmid助理員編 = l_User.f_userid帳號;//"F9446";// l_code主檔.f_AssistantBranchid助理單位編號 = l_User.f_branchid所別; l_code主檔.f_TotalPrice總計價格 = Convert.ToInt32(_lblTotal.Text); l_code主檔.f_SalesSmid業代員編 = _lblSmid.Text; l_code主檔.f_TotalSale總販賣價 = Convert.ToInt32(_lblSaleTotal.Text); l_code主檔.f_IsSend是否發送 = "False"; l_code主檔.f_Memo備註說明 = _txt備註.Text.Replace("'", ""); l_code主檔.f_InsertDate請購日期 = DateTime.Now.ToString("yyyy/MM/dd"); l_code主檔.f_InsertIP輸入電腦IP = Request.UserHostAddress; l_code主檔.f_EditDate編輯日期 = DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss"); CKGPartOrderDetailFactory l_factory = _context.CFactoryManager.CKGPartOrderDetailFactory; CKGPartOrderDetail[] l_codes明細 = new CKGPartOrderDetail[l_dt.Rows.Count]; int l_int主檔總計成本 = 0; for (int i = 0; i < l_dt.Rows.Count; i++) { l_codes明細[i] = l_factory.createCKGPartOrderDetail(); l_codes明細[i].f_ExchangeID請購單號 = l_str請購單號; l_codes明細[i].f_ProductID產品編號 = l_dt.Rows[i]["產品編號"].ToString(); l_codes明細[i].f_ProductName產品名稱 = l_dt.Rows[i]["產品名稱"].ToString(); l_codes明細[i].f_Amount選購數量 = Convert.ToInt32(l_dt.Rows[i]["數量"].ToString()); l_codes明細[i].f_Qty產品單位 = l_dt.Rows[i]["單位"].ToString(); l_codes明細[i].f_Cost產品成本價 = Convert.ToInt32(l_dt.Rows[i]["成本"].ToString()); l_codes明細[i].f_UnitPrice產品單價 = Convert.ToInt32(l_dt.Rows[i]["業代價"].ToString()); l_codes明細[i].f_SalePrice販賣價 = Convert.ToInt32(l_dt.Rows[i]["販賣價"].ToString()); l_codes明細[i].f_ListPrice建議售價 = Convert.ToInt32(l_dt.Rows[i]["建議售價"].ToString()); CUser l_user = Session[SealedGlobalPage.SESSIONKEY_LOGIN_USER_DATA] as CUser; if (l_user == null) { Session.Remove(SealedGlobalPage.SESSIONKEY_LOGIN_USER_DATA); Response.Redirect("../FrmLogin.aspx"); } if (l_user.f_lvl等級 == 4) { l_codes明細[i].f_Total總計價格 = Convert.ToInt32(l_dt.Rows[i]["總販賣"].ToString()); } else { l_codes明細[i].f_Total總計價格 = Convert.ToInt32(l_dt.Rows[i]["總計"].ToString()); } l_codes明細[i].f_EditDate編輯日期 = l_code主檔.f_EditDate編輯日期; l_int主檔總計成本 += (l_codes明細[i].f_Cost產品成本價 * l_codes明細[i].f_Amount選購數量); } l_code主檔.f_TotalCost總成本價 = l_int主檔總計成本; l_code主檔.明細 = l_codes明細; string l_str = "alert('選購作業完成,請購單號為: " + l_str請購單號 + "');"; ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "OK", l_str, true); l_factory主檔.insertCKGPartOrder(l_code主檔); 新增應收帳款(l_code主檔); 初始化(); } }
private string set頁首資訊(CKGPartOrder p_code) { string l_strTitle = ""; string l_str退請購日期 = ""; if ("Buy".Equals(Request["Type"])) { l_strTitle = "高輊公司小百貨領料單"; l_str退請購日期 = "請購日期"; } else { l_strTitle = "高輊公司小百貨退貨單"; l_str退請購日期 = "退貨日期"; } string l_str = "<body>"; l_str += "<br />"; l_str += "<br />"; l_str += "<br />"; l_str += "<br />"; l_str += "<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" style=\"width: 720px; border-left-width:0px; border-right-width:0px; border-top-width:0px\">"; l_str += " <tr>"; l_str += " <td colspan=\"11\" style=\"border-style:none; border-width:medium; font-size: 24pt; text-align: center\">"; l_str += " " + l_strTitle + "</td>"; l_str += " </tr>"; l_str += " <tr>"; l_str += " <td colspan=\"11\" style=\"border-style:none; border-width:medium; font-size: 14pt; text-align: center\">"; l_str += " </td>"; l_str += " </tr>"; l_str += " <tr>"; l_str += " <td style=\"border-style:none; border-width:medium; font-size: 10pt\" width=\"85\" align=\"center\" bordercolor=\"#000000\">"; l_str += " <font size=\"3\">請購單號:</font></td>"; l_str += " <td style=\"border-style:none; border-width:medium; font-size: 10pt\" width=\"100\" align=\"center\" bordercolor=\"#000000\">"; l_str += " <font size=\"3\">" + p_code.f_ExchangeID請購單號 + "</font></td>"; l_str += " <td style=\"border-style:none; border-width:medium; font-size: 10pt\" width=\"52\" align=\"center\" bordercolor=\"#000000\">"; l_str += " <font size=\"3\">單位:</font></td>"; CUser l_user = _context.CFactoryManager.CUserFactory.get高都員工檔(p_code.f_SalesSmid業代員編); l_str += " <td colspan=\"2\" style=\"border-style:none; border-width:medium; font-size: 10pt\" align=\"center\" bordercolor=\"#000000\">"; l_str += " <font size=\"3\">" + l_user.f_branchid所別 + "</font></td>"; l_str += " <td style=\"border-style:none; border-width:medium; font-size: 10pt\" width=\"82\" align=\"center\" bordercolor=\"#000000\">"; l_str += " <font size=\"3\">業代員編:</font></td>"; l_str += " <td style=\"border-style:none; border-width:medium; font-size: 10pt\" colspan=\"3\" align=\"center\" bordercolor=\"#000000\">"; l_str += " <font size=\"3\">" + p_code.f_SalesSmid業代員編 + "</font></td>"; l_str += " <td style=\"border-style:none; border-width:medium; font-size: 10pt\" width=\"81\" align=\"center\" bordercolor=\"#000000\">"; l_str += " <font size=\"3\">姓名:</font></td>"; l_str += " <td style=\"border-style:none; border-width:medium; font-size: 10pt\" width=\"78\" align=\"center\" bordercolor=\"#000000\">"; l_str += " <font size=\"3\">" + l_user.f_username姓名 + "</font></td>"; l_str += " </tr>"; l_str += " <tr>"; l_str += " <td style=\"font-size: 10pt; border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium\" width=\"85\" align=\"center\" bordercolor=\"#000000\">"; l_str += " <font size=\"3\">引擎號碼:</font></td>"; l_str += " <td style=\"font-size: 10pt; border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium\" width=\"100\" align=\"center\" bordercolor=\"#000000\">"; l_str += " <font size=\"3\">" + 塞空白字串(p_code.f_EngineNo引擎號碼) + "</font></td>"; l_str += " <td style=\"font-size: 10pt; border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium\" width=\"52\" align=\"center\" bordercolor=\"#000000\">"; l_str += " <font size=\"3\">車型:</font></td>"; l_str += " <td style=\"font-size: 10pt; border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium\" width=\"106\" align=\"center\" bordercolor=\"#000000\">"; l_str += " </td>"; l_str += " <td colspan=\"2\" style=\"font-size: 10pt; border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium\" align=\"center\" bordercolor=\"#000000\">"; l_str += " <font size=\"3\">SFX:</font></td>"; l_str += " <td style=\"font-size: 10pt; border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium; border-bottom-style:solid; border-bottom-width:1px\" colspan=\"3\" align=\"center\" bordercolor=\"#000000\">"; l_str += " </td>"; l_str += " <td style=\"font-size: 10pt; border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium\" width=\"81\" align=\"center\" bordercolor=\"#000000\">"; l_str += " <font size=\"3\">" + l_str退請購日期 + ":</font></td>"; l_str += " <td style=\"font-size: 10pt; border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium\" width=\"78\" align=\"center\" bordercolor=\"#000000\">"; l_str += " <font size=\"3\">" + p_code.f_InsertDate請購日期 + "</font></td>"; l_str += " </tr>"; l_str += " <tr>"; l_str += " <td colspan=\"2\" style=\"border-style:solid; border-width:1px; font-size: 10pt\" width=\"182\" align=\"center\" bordercolor=\"#000000\">"; l_str += " <font size=\"3\">產品編號</font></td>"; l_str += " <td colspan=\"4\" style=\"border-style:solid; border-width:1px; font-size: 10pt\" align=\"center\" bordercolor=\"#000000\">"; l_str += " <font size=\"3\">產品名稱</font></td>"; l_str += " <td style=\"border-style:solid; border-width:1px; width: 36px; text-align: center\" bordercolor=\"#000000\">"; l_str += " 單價</td>"; l_str += " <td style=\"border-style:solid; border-width:1px; width: 42px; text-align: center\" bordercolor=\"#000000\">"; l_str += " 數量</td>"; l_str += " <td style=\"border-style:solid; border-width:1px; width: 36px; text-align: center\" bordercolor=\"#000000\">"; l_str += " 金額</td>"; l_str += " <td colspan=\"2\" style=\"border-style:solid; border-width:1px; font-size: 10pt\" align=\"center\" bordercolor=\"#000000\">"; l_str += " <font size=\"3\">備註</font></td>"; l_str += " </tr>"; return(l_str); }
private string 組HTML(CKGPartOrder p_code主檔, int p_int總頁數) { if (p_int總頁數 < 1) { string l_str = set頁首資訊(p_code主檔); for (int i = 0; i < p_code主檔.明細.Length; i++) { if (i == 0) { l_str += 組TR(p_code主檔.明細[i], p_code主檔.f_Memo備註說明); } else { l_str += 組TR(p_code主檔.明細[i], ""); } } //不足一頁10筆資料的剩餘空格用空白補完 for (int i = p_code主檔.明細.Length; i < 10; i++) { l_str += 組TR(new CKGPartOrderDetail(), ""); } l_str += set頁尾資訊(p_code主檔.f_TotalPrice總計價格, p_code主檔.f_TotalSale總販賣價); return(l_str); } else { string l_strSubstring = ""; for (int i = 0; i < p_int總頁數; i++) { string l_str = ""; l_str += set頁首資訊(p_code主檔); //最後一頁 if (i == (p_int總頁數 - 1)) { for (int j = i * 10; j < p_code主檔.明細.Length; j++) { if (j == i * 10) { l_str += 組TR(p_code主檔.明細[j], p_code主檔.f_Memo備註說明); } else { l_str += 組TR(p_code主檔.明細[j], ""); } } //不足一頁10筆資料的剩餘空格用空白補完 for (int a = (p_code主檔.明細.Length % 10); a < 10; a++) { l_str += 組TR(new CKGPartOrderDetail(), ""); } CUser l_user = Session[SealedGlobalPage.SESSIONKEY_LOGIN_USER_DATA] as CUser; if (l_user == null) { Session.Remove(SealedGlobalPage.SESSIONKEY_LOGIN_USER_DATA); Response.Redirect("../FrmLogin.aspx"); } if (l_user.f_lvl等級 == 4) { l_str += set頁尾資訊(p_code主檔.f_TotalPrice總計價格, p_code主檔.f_TotalSale總販賣價); } else { l_str += set頁尾資訊(p_code主檔.f_TotalPrice總計價格, p_code主檔.f_TotalSale總販賣價); } l_str += "<hr>"; l_str += l_str; l_strSubstring += l_str.Substring(0, l_str.LastIndexOf("<hr>")); return(l_strSubstring); } //用總頁數次數來判斷跑到第幾分頁 //k:明細檔的第k筆; i:第i分頁 乘10代表第i分頁的起始到第i分頁的結束(每次範圍都10筆) for (int k = i * 10; k < i * 10 + 10; k++) { if (k == i * 10) { l_str += 組TR(p_code主檔.明細[k], p_code主檔.f_Memo備註說明); } else { l_str += 組TR(p_code主檔.明細[k], ""); } } CUser l_user1 = Session[SealedGlobalPage.SESSIONKEY_LOGIN_USER_DATA] as CUser; if (l_user1 == null) { Session.Remove(SealedGlobalPage.SESSIONKEY_LOGIN_USER_DATA); Response.Redirect("../FrmLogin.aspx"); } if (l_user1.f_lvl等級 == 4) { l_str += set頁尾資訊(p_code主檔.f_TotalPrice總計價格, p_code主檔.f_TotalSale總販賣價); } else { l_str += set頁尾資訊(p_code主檔.f_TotalPrice總計價格, p_code主檔.f_TotalSale總販賣價); } l_str += "<hr>"; l_str += l_str; l_str += "<div><P></P></div>"; l_strSubstring = l_str.Substring(0, l_str.LastIndexOf("<hr>")); } return(l_strSubstring); } }