using System; using CoreSavingLibrary; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Xml.Linq; using CoreSavingLibrary.WcfNCommon; using CoreSavingLibrary.WcfNShrlon; using CoreSavingLibrary.WcfNDeposit; // new deposit using System.Globalization; using Sybase.DataWindow; using DataLibrary; using System.Drawing; namespace Saving.Applications.shrlon { public partial class w_sheet_sl_print_book2 : PageWebSheet, WebSheet { private DwThDate tDwMain; private n_shrlonClient shrlonService; private n_commonClient commonService; //protected string jsPostmember; CultureInfo th = System.Globalization.CultureInfo.GetCultureInfo("th-TH"); //*******ประกาศตัวเกี่ยวกับ Javascript********// protected String jsGetMemberInfo; protected String jsClickLoancontract; protected String DeleteRowDetail; protected String InsertRowDetail; protected String postAccountNo; protected String jsPostPrintNewBook; protected String jsPostPrintNewBookin; protected String jsPostPrintNewBookout; protected String postAccountNo1; protected String jsPrintLnconNo; protected String jsPostUpBookno; protected String jsPostPrintBookin; protected String postPrintBook; protected String JsPrinBook_Kong; protected String JsPrinBook_Kong_Ireport; protected String JsPrinBook_Card; protected String jsPrinHeaderbook; protected String jsPostPrintLnColl; protected String jsPrintslip; protected String jsPostbookcard; protected String jsPrintBookCard2; protected String jsPostcovercard; protected String JsPrinBook_Card_head; protected String JsPrinBook_Card_details; protected String JsPrinBook_Card_BF; private string coop_id_SSK = "000301"; private n_depositClient ndept; //new deposit private n_commonClient ncommon; //new common protected String statement_all; Sta ta; String pbl = "sl_member_detail.pbl"; //String pbl_1 = "sl_member_detail.pbl"; public void InitJsPostBack() { statement_all = WebUtil.JsPostBack(this, "statement_all"); jsGetMemberInfo = WebUtil.JsPostBack(this, "jsGetMemberInfo"); jsClickLoancontract = WebUtil.JsPostBack(this, "jsClickLoancontract"); // jsPostmember = WebUtil.JsPostBack(this, "jsPostmember"); DeleteRowDetail = WebUtil.JsPostBack(this, "DeleteRowDetail"); InsertRowDetail = WebUtil.JsPostBack(this, "InsertRowDetail"); postAccountNo = WebUtil.JsPostBack(this, "postAccountNo"); postPrintBook = WebUtil.JsPostBack(this, "postPrintBook"); jsPostPrintNewBook = WebUtil.JsPostBack(this, "jsPostPrintNewBook"); jsPostPrintNewBookin = WebUtil.JsPostBack(this, "jsPostPrintNewBookin"); postAccountNo1 = WebUtil.JsPostBack(this, "postAccountNo1"); jsPrintLnconNo = WebUtil.JsPostBack(this, "jsPrintLnconNo"); jsPostUpBookno = WebUtil.JsPostBack(this, "jsPostUpBookno"); jsPostPrintBookin = WebUtil.JsPostBack(this, "jsPostPrintBookin"); jsPostPrintLnColl = WebUtil.JsPostBack(this, "jsPostPrintLnColl"); jsPostPrintNewBookout = WebUtil.JsPostBack(this, "jsPostPrintNewBookout"); JsPrinBook_Kong = WebUtil.JsPostBack(this, "JsPrinBook_Kong"); JsPrinBook_Kong_Ireport = WebUtil.JsPostBack(this, "JsPrinBook_Kong_Ireport"); jsPrinHeaderbook = WebUtil.JsPostBack(this, "jsPrinHeaderbook"); jsPrintslip = WebUtil.JsPostBack(this, "jsPrintslip"); jsPostbookcard = WebUtil.JsPostBack(this, "jsPostbookcard"); JsPrinBook_Card = WebUtil.JsPostBack(this, "JsPrinBook_Card"); JsPrinBook_Card_head = WebUtil.JsPostBack(this, "JsPrinBook_Card_head"); JsPrinBook_Card_details = WebUtil.JsPostBack(this, "JsPrinBook_Card_details"); JsPrinBook_Card_BF = WebUtil.JsPostBack(this, "JsPrinBook_Card_BF"); jsPrintBookCard2 = WebUtil.JsPostBack(this, "jsPrintBookCard2"); jsPostcovercard = WebUtil.JsPostBack(this, "jsPostcovercard"); } public void WebSheetLoadBegin() { try { shrlonService = wcf.NShrlon; commonService = wcf.NCommon; } catch { LtServerMessage.Text = WebUtil.ErrorMessage("ติดต่อ Web Service ไม่ได้"); return; } ndept = wcf.NDeposit; this.ConnectSQLCA(); ta = new Sta(sqlca.ConnectionString); sqlca = new DwTrans(); sqlca.Connect(); if (IsPostBack) { this.RestoreContextDw(dw_data_1); this.RestoreContextDw(dw_data_2); this.RestoreContextDw(DwPrintPrompt); this.RestoreContextDw(DwPrintPrompt2); this.RestoreContextDw(DwPeriod); this.RestoreContextDw(DwPeriod_myl); } if (dw_main.RowCount < 1) { dw_main.InsertRow(1); dw_data_1.InsertRow(1); dw_list.InsertRow(1); dw_data_2.InsertRow(1); DwPeriod.InsertRow(1); DwPeriod_myl.InsertRow(1); if (state.SsCoopId == "000101")//ตรอน { // tss1.Style["display"] = "none"; DwPrintPrompt2.Style["display"] = "none"; Bookout.Style["display"] = "none"; Button2.Style["display"] = "none"; bookin2.Style["display"] = "none"; Headerbook.Style["display"] = "none"; Bookin.Style["display"] = "none"; cover_card.Style["display"] = "none"; Bookin.Style["display"] = "none"; book_card.Style["display"] = "none"; //cover_card.Style["display"] = "none"; //tss1.Attributes.Add("style", "display:none"); } else if (state.SsCoopId == "000501")//แม่จัน { // tss1.Style["display"] = "none"; Bookout.Style["display"] = "none"; // Button2.Style["display"] = "none"; bookin2.Style["display"] = "none"; Headerbook.Style["display"] = "none"; Bookin.Style["display"] = "none"; book_card.Style["display"] = "none"; //cover_card.Style["display"] = "none"; //tss1.Attributes.Add("style", "display:none"); } else if (state.SsCoopId == "000301" || state.SsCoopId == "500001")//สีเกด { // tss1.Style["display"] = "none"; DwPrintPrompt2.Style["display"] = "none"; cover_card.Style["display"] = "none"; Button2.Style["display"] = "none"; ShifF5.Style["display"] = "none"; ShifF8.Style["display"] = "none"; //Bookin.Style["display"] = "none"; cover_card.Style["display"] = "none"; // Bookin.Style["display"] = "none"; // book_card.Style["display"] = "none"; } } } public String selectMemNo(String member_no) { String member = "", sqlStr2=""; if (Sta.IS_MYSQL_MODE) { sqlStr2 = @"select member_no from mbmembmaster where mbmembmaster.coop_id = {0} and mbmembmaster.member_no like '%" + member_no + "' order by member_no desc limit 1 "; sqlStr2 = WebUtil.SQLFormat(sqlStr2, state.SsCoopControl); } else { sqlStr2 = @"select member_no from mbmembmaster where mbmembmaster.coop_id = {0} and mbmembmaster.member_no like '%" + member_no + "' and ROWNUM <= 1 order by member_no desc"; sqlStr2 = WebUtil.SQLFormat(sqlStr2, state.SsCoopControl); } Sdt dt121 = WebUtil.QuerySdt(sqlStr2); if (dt121.Next()) { member = dt121.GetString("member_no"); } return member; } /// /// Check PostBack Javascript /// /// public void CheckJsPostBack(string eventArg) { if (eventArg == "jsGetMemberInfo") { // clear_periodpayment(); JsPostmember(); } else if (eventArg == "jsPostcovercard") { string memno = dw_data_1.GetItemString(1, "loancontract_no"); // string coopid = state.SsCoopControl; Printing.PrintHeadCardLoan(this, memno, state.SsCoopControl); } else if (eventArg == "jsPrintBookCard2") { // clear_periodpayment();.......3 try { Int16 seq = Convert.ToInt16(DwPrintPrompt2.GetItemDecimal(1, "lastrec_no_card")); Int16 page = Convert.ToInt16(DwPrintPrompt2.GetItemDecimal(1, "lastpage_no_card")); Int16 line = Convert.ToInt16(DwPrintPrompt2.GetItemDecimal(1, "lastline_no_card")); String as_loan_no = dw_data_1.GetItemString(1, "loancontract_no"); //XmlConfigService xml = new XmlConfigService(); int ai_status = 1;// xml.DepositPrintMode; String as_xml_return = ""; String as_return = ""; string printset = state.SsPrinterSet; //ndept.of_printloanbook_card(state.SsWsPass, as_loan_no, seq, page, line, true, ref as_xml_return, ref as_return); String[] re = as_return.Split('@'); int rePage = int.Parse(re[0]); int reReq = int.Parse(re[1]); // WebUtil.QuerySdt("update lncontmaster set lastrec_no_card = " + DwPrintPrompt.GetItemDecimal(1, "last_stm_no") + " where loancontract_no='" + as_loan_no + "' and coop_id = '" + state.SsCoopControl + "' "); Printing.PrintApplet(this, "loan_bookcard", as_xml_return); // Printing.PrintApplet(this, "loan_printbook", as_xml_return); Retrivess(); Sdt d = WebUtil.QuerySdt("select lastpage_no_card,lastrec_no_card,lastline_no_card from lncontmaster where loancontract_no = '" + as_loan_no + "'"); if (d.Next()) { DwPrintPrompt2.SetItemDecimal(1, "lastpage_no_card", d.GetDecimal("lastpage_no_card")); DwPrintPrompt2.SetItemDecimal(1, "lastrec_no_card", d.GetDecimal("lastrec_no_card")); DwPrintPrompt2.SetItemDecimal(1, "lastline_no_card", d.GetDecimal("lastline_no_card")); } if (rePage > 0) { DwPrintPrompt2.SetItemDecimal(1, "lastrec_no_card", reReq); DwPrintPrompt2.SetItemDecimal(1, "lastline_no_card", 1); WebUtil.QuerySdt("update lncontmaster set lastline_no_card = 1 where loancontract_no='" + as_loan_no + "' and coop_id = '" + state.SsCoopControl + "' "); Page.ClientScript.RegisterStartupScript(this.GetType(), "rePrintBookCard", "rePrintBookCard('" + as_loan_no + "')", true); } } catch (Exception ex) { LtServerMessage.Text = WebUtil.ErrorMessage(ex); } } else if (eventArg == "postPrintBook") { try { Int16 seq = Convert.ToInt16(DwPrintPrompt.GetItemDecimal(1, "lastrec_no")); Int16 page = Convert.ToInt16(DwPrintPrompt.GetItemDecimal(1, "lastpage_no")); Int16 line = Convert.ToInt16(DwPrintPrompt.GetItemDecimal(1, "lastline_no")); String as_loan_no = dw_data_1.GetItemString(1, "loancontract_no"); //XmlConfigService xml = new XmlConfigService(); int ai_status = 1;// xml.DepositPrintMode; String as_xml_return = ""; String as_return = ""; string printset = state.SsPrinterSet; ndept.of_print_bookloan(state.SsWsPass, as_loan_no, seq, page, line, true, ref as_xml_return, ref as_return); String[] re = as_return.Split('@'); int rePage = int.Parse(re[0]); int reReq = int.Parse(re[1]); // WebUtil.QuerySdt("update lncontmaster set lastrec_no = " + DwPrintPrompt.GetItemDecimal(1, "last_stm_no") + " where loancontract_no='" + as_loan_no + "' and coop_id = '" + state.SsCoopControl + "' "); Sdt d = WebUtil.QuerySdt("select lastpage_no,lastrec_no,lastline_no from lncontmaster where loancontract_no = '" + as_loan_no + "'"); if (d.Next()) { DwPrintPrompt.SetItemDecimal(1, "lastpage_no", d.GetDecimal("lastpage_no")); DwPrintPrompt.SetItemDecimal(1, "lastrec_no", d.GetDecimal("lastrec_no")); DwPrintPrompt.SetItemDecimal(1, "lastline_no", d.GetDecimal("lastline_no")); } if (rePage > 0) { DwPrintPrompt.SetItemDecimal(1, "lastrec_no", reReq); DwPrintPrompt.SetItemDecimal(1, "lastline_no",1); WebUtil.QuerySdt("update lncontmaster set lastline_no = 1 where loancontract_no='" + as_loan_no + "' and coop_id = '" + state.SsCoopControl + "' "); Page.ClientScript.RegisterStartupScript(this.GetType(), "rePrintBook", "rePrintBook('" + as_loan_no + "')", true); } //HdIsZeroPage.Value = rePage == 0 ? "true" : "false"; //HdIsNewBook.Value = rePage == 1 ? "true" : "false"; //เพิ่มเพื่อรับค่าจาก pb srv ว่าขึ้นเล่มใหม่ //HdIsNewBook.Value = "true"; //if (ai_status == 1) //{ // Printing.Print(this, "Slip/ap_deposit/PrintBook.aspx", as_xml_return, 25); //} //else if (ai_status == 2) //{ Printing.LoanPrintBook(this, as_xml_return); //Printing.PrintApplet(this, "loan_printbook", as_xml_return); Retrivess(); //} } catch (Exception ex) { LtServerMessage.Text = WebUtil.ErrorMessage(ex); } } else if (eventArg == "jsClickLoancontract") { String row = HDcolumnnumber.Value; int rows = Convert.ToInt32(row); String member_no = ""; member_no = HdMemberNo.Value; member_no = selectMemNo(member_no); String loancontract = dw_list.GetItemString(rows, "loancontract_no"); DwUtil.RetrieveDataWindow(dw_data_1, "LOANCONTRACT_NO", null, loancontract); DwUtil.RetrieveDataWindow(dw_data_2, "LOANCONTRACT_NO", null, loancontract); DwUtil.RetrieveDataWindow(dw_list, "member_no", null, member_no); DwUtil.RetrieveDataWindow(DwPrintPrompt, "sl_contack.pbl", null, state.SsCoopControl, loancontract); DwUtil.RetrieveDataWindow(DwPrintPrompt2, "sl_print_book.pbl", null, state.SsCoopControl, loancontract); if (Sta.IS_MYSQL_MODE) { DwUtil.RetrieveDataWindow(DwPeriod_myl, "sl_print_book.pbl", null, state.SsCoopControl, loancontract); } else { DwUtil.RetrieveDataWindow(DwPeriod, "sl_print_book.pbl", null, state.SsCoopControl, loancontract); } dw_list.SelectRow(0, false); dw_list.SelectRow(rows, true); dw_list.SetRow(rows); } else if (eventArg == "statement_all") { statement_all_sub(Hdloancontract_no.Value); } else if (eventArg == "postAccountNo") { JsPostAccountNo(); } else if (eventArg == "JsPrinBook_Card_BF") { PrinBook_Card_BF(Hdloancontract_no.Value); } else if (eventArg == "jsPostbookcard") { try { bookcard(dw_data_1.GetItemString(1, "loancontract_no")); } catch { bookcard(dw_main.GetItemString(1, "loancontract_no")); } //JsPrinBook_Card } else if (eventArg == "JsPrinBook_Card") { Prin_ireport_bookCard(Hdloancontract_no.Value); } else if (eventArg == "JsPrinBook_Card_head") { Prin_ireport_bookCard_head(Hdloancontract_no.Value); } else if (eventArg == "JsPrinBook_Card_details") { Prin_ireport_bookCard_details(Hdloancontract_no.Value); } else if (eventArg == "jsPrintslip") { string memno = dw_main.GetItemString(1, "member_no"); // string coopid = state.SsCoopControl; iReportBuider report = new iReportBuider(this, ""); string report_name2 = ""; report_name2 = "sl_slip_buyshare"; iReportArgument args = new iReportArgument(); args.Add("memno", iReportArgumentType.String, memno); args.Add("coopid", iReportArgumentType.String, state.SsCoopControl); report.AddCriteria("book_coll", "พิมพ์สมุดจำนอง", ReportType.pdf, args); report.AutoOpenPDF = true; report.Retrieve(); } else if (eventArg == "JsPrinBook_Kong_Ireport") { PrinBookIreport_Kong(); } else if (eventArg == "jsPostPrintNewBook") { PostPrintNewBook(); } else if (eventArg == "jsPostPrintNewBookin") { PostPrintNewBookin(); } else if (eventArg == "jsPrinHeaderbook") { PrinHeaderbook(); } else if (eventArg == "jsPostPrintNewBookout") { PostPrintNewBookout(); } else if (eventArg == "jsPostPrintBookin") { PostPrintBookin(); } else if (eventArg == "postAccountNo1") { JsPostAccountNo1(); } else if (eventArg == "jsPrintLnconNo") { PostPrintLnconNo(); } else if (eventArg == "JsPrinBook_Kong") { CallFuntion_PrintBook(); } else if (eventArg == "jsPostUpBookno") { PostUpBookno(); } } private void Retrivess() { String row = HDcolumnnumber.Value; int rows = Convert.ToInt32(row); String member_no = ""; member_no = HdMemberNo.Value; member_no = selectMemNo(member_no); String loancontract = dw_list.GetItemString(rows, "loancontract_no"); DwUtil.RetrieveDataWindow(dw_data_1, "LOANCONTRACT_NO", null, loancontract); DwUtil.RetrieveDataWindow(dw_data_2, "LOANCONTRACT_NO", null, loancontract); DwUtil.RetrieveDataWindow(dw_list, "member_no", null, member_no); DwUtil.RetrieveDataWindow(DwPrintPrompt, "sl_contack.pbl", null, state.SsCoopControl, loancontract); DwUtil.RetrieveDataWindow(DwPrintPrompt2, "sl_print_book.pbl", null, state.SsCoopControl, loancontract); if (Sta.IS_MYSQL_MODE) { DwUtil.RetrieveDataWindow(DwPeriod_myl, "sl_print_book.pbl", null, state.SsCoopControl, loancontract); } else { DwUtil.RetrieveDataWindow(DwPeriod, "sl_print_book.pbl", null, state.SsCoopControl, loancontract); } dw_list.SelectRow(0, false); dw_list.SelectRow(rows, true); dw_list.SetRow(rows); } public void statement_all_sub(string loancontract_no) // ปริ้น statement ทั้งหมด { iReportArgument args3 = new iReportArgument(); string report_name3 = "", report_label3 = ""; try { string sqlselect = @"select * from report_master where ireport_id ='Book_card_details._stament' and coop_id={0}"; sqlselect = WebUtil.SQLFormat(sqlselect, state.SsCoopId); Sdt Greport = WebUtil.QuerySdt(sqlselect); if (Greport.Next()) { report_name3 = Greport.GetString("ireport_name"); // ปริ้น statement ทั้งหมด } } catch { } report_label3 = "รายการเคลื่อนไหวทั้วหมด"; args3.Add("loancontract_no", iReportArgumentType.String, Hdloancontract_no.Value); args3.Add("coop_id", iReportArgumentType.String, state.SsCoopId); iReportBuider report = new iReportBuider(this, ""); report.AddCriteria(report_name3, report_label3, ReportType.pdf, args3); report.AutoOpenPDF = true; report.Retrieve(); } public void JsPostmember() { try { String member_no = ""; member_no = HdMemberNo.Value; // member_no = Dw_main.GetItemString(1, "member_no"); int dtMember = getMember(); if (dtMember <= 1) { member_no = selectMemNo(member_no); DwUtil.RetrieveDataWindow(dw_main, "member_no", null, member_no); // DwUtil.RetrieveDDDW(dw_main, "member_no", member_no); DwUtil.RetrieveDataWindow(dw_list, "member_no", null, member_no); } else { // HdMemno.Value = dsMain.DATA[0].MEMBER_NO; Page.ClientScript.RegisterStartupScript(this.GetType(), "CheckCountMemberNo", "CheckCountMemberNo(" + member_no + ")", true); } // } catch { } } public int getMember() { string memberno = HdMemberNo.Value; //dsMain.DATA[0].MEMBER_NO; int rows = 0; // string memberno = dw_main.GetItemString(1, "member_no"); if (memberno.Length <= 5) { memberno = Convert.ToDecimal(memberno).ToString("00000"); dw_main.SetItemString(1, "member_no",memberno); } string sql = "select count( member_no) as member_no from mbmembmaster where member_no Like '%" + memberno + "'"; Sdt d = WebUtil.QuerySdt(sql); if (d.Next()) { rows = d.GetInt32("member_no"); } return rows; } public void SaveWebSheet() { // throw new NotImplementedException(); } private void PostUpBookno() { try { LtServerMessage.Text = WebUtil.CompleteMessage("บันทึกข้อมูลสำเร็จ"); } catch (Exception ex) { LtServerMessage.Text = WebUtil.ErrorMessage("บันทึกข้อมูลไม่สำเร็จ" + ex); } } public void PrinBook_Card_BF(string loancontract_no) { iReportArgument args3 = new iReportArgument(); string report_name3 = "", report_label3 = ""; try { string sqlselect = @"select * from report_master where ireport_id ='PrintBookCard_BF' and coop_id={0}"; sqlselect = WebUtil.SQLFormat(sqlselect, state.SsCoopId); Sdt Greport = WebUtil.QuerySdt(sqlselect); if (Greport.Next()) { report_name3 = Greport.GetString("ireport_name"); // พิมพ์สมุดจ่ายเงินกู้ พร้อม หัวสมุด } } catch { } report_label3 = "ต้นยกมาสิ้นปี"; args3.Add("loancontract_no", iReportArgumentType.String, Hdloancontract_no.Value); args3.Add("coop_id", iReportArgumentType.String, state.SsCoopId); iReportBuider report = new iReportBuider(this, ""); report.AddCriteria(report_name3, report_label3, ReportType.pdf, args3); report.AutoOpenPDF = true; report.Retrieve(); } public void Prin_ireport_bookCard(string loancontract_no) { iReportArgument args3 = new iReportArgument(); string report_name3 = "", report_label3 = ""; try { string sqlselect = @"select * from report_master where ireport_id ='print_book_card' and coop_id={0}"; sqlselect = WebUtil.SQLFormat(sqlselect, state.SsCoopId); Sdt Greport = WebUtil.QuerySdt(sqlselect); if (Greport.Next()) { report_name3 = Greport.GetString("ireport_name"); // พิมพ์สมุดจ่ายเงินกู้ พร้อม หัวสมุด } } catch { } report_label3 = "ปริ้นสมุดการ์ด"; args3.Add("loancontract_no", iReportArgumentType.String, Hdloancontract_no.Value); args3.Add("coop_id", iReportArgumentType.String, state.SsCoopId); iReportBuider report = new iReportBuider(this, ""); report.AddCriteria(report_name3, report_label3, ReportType.pdf, args3); report.AutoOpenPDF = true; report.Retrieve(); } public void Prin_ireport_bookCard_head(string loancontract_no) { iReportArgument args3 = new iReportArgument(); string report_name3 = "", report_label3 = ""; try { string sqlselect = @"select * from report_master where ireport_id ='print_book_card_head' and coop_id={0}"; sqlselect = WebUtil.SQLFormat(sqlselect, state.SsCoopId); Sdt Greport = WebUtil.QuerySdt(sqlselect); if (Greport.Next()) { report_name3 = Greport.GetString("ireport_name"); // พิมพ์สมุดจ่ายเงินกู้ พร้อม หัวสมุด report_label3 = Greport.GetString("ireport_description"); } } catch { } args3.Add("loancontract_no", iReportArgumentType.String, Hdloancontract_no.Value); args3.Add("coop_id", iReportArgumentType.String, state.SsCoopId); iReportBuider report = new iReportBuider(this, ""); report.AddCriteria(report_name3, report_label3, ReportType.pdf, args3); report.AutoOpenPDF = true; report.Retrieve(); } public void Prin_ireport_bookCard_details(string loancontract_no) { iReportArgument args3 = new iReportArgument(); string report_name3 = "", report_label3 = ""; try { string sqlselect = @"select * from report_master where ireport_id ='print_book_card_details' and coop_id={0}"; sqlselect = WebUtil.SQLFormat(sqlselect, state.SsCoopId); Sdt Greport = WebUtil.QuerySdt(sqlselect); if (Greport.Next()) { report_name3 = Greport.GetString("ireport_name"); // พิมพ์สมุดจ่ายเงินกู้ พร้อม หัวสมุด report_label3 = Greport.GetString("ireport_description"); } } catch { } args3.Add("loancontract_no", iReportArgumentType.String, Hdloancontract_no.Value); args3.Add("coop_id", iReportArgumentType.String, state.SsCoopId); iReportBuider report = new iReportBuider(this, ""); report.AddCriteria(report_name3, report_label3, ReportType.pdf, args3); report.AutoOpenPDF = true; report.Retrieve(); } public void WebSheetLoadEnd() { } public void bookcard(string loancontract_no) { decimal principal_period = 0; decimal principal_payment = 0; decimal intreest_period = 0; decimal interest_payment = 0; decimal fine_period = 0; decimal fine_payment = 0; decimal bfprincipal_arrear = 0; decimal forward_principal = 0; decimal principal_payment2 = 0; decimal principal_payment3 = 0; decimal pn_arr = 0; DateTime slip_date = state.SsWorkDate; string entry_id = ""; string loanitemtype_code = ""; decimal fineyear_arrear = 0, intarr_payment = 0; decimal bffineyear_amt = 0; decimal bfintyeararr_amt = 0; try { string statement = @"select * from lncontstatement where loancontract_no={0} and coop_id={1} and item_status = 1"; statement = WebUtil.SQLFormat(statement, loancontract_no, state.SsCoopId); Sdt dt1 = WebUtil.QuerySdt(statement); try { string delete_report_book_statement = @"delete from report_book_statement where coop_id={0}"; delete_report_book_statement = WebUtil.SQLFormat(delete_report_book_statement, state.SsCoopId); WebUtil.QuerySdt(delete_report_book_statement); } catch { } while (dt1.Next()) { loanitemtype_code = dt1.GetString("loanitemtype_code"); bfprincipal_arrear = dt1.GetDecimal("bfprincipal_arrear"); intreest_period = dt1.GetDecimal("bfint_preiod"); interest_payment = dt1.GetDecimal("interest_period"); slip_date = dt1.GetDate("slip_date"); entry_id = dt1.GetString("entry_id"); fine_period = dt1.GetDecimal("bffine_preiod"); fine_payment = dt1.GetDecimal("fine_period"); principal_period = dt1.GetDecimal("principalpay_period"); principal_payment = dt1.GetDecimal("principal_payment"); principal_payment2 = dt1.GetDecimal("principal_payment"); fineyear_arrear = dt1.GetDecimal("fineyear_arrear"); intarr_payment = dt1.GetDecimal("intarr_payment"); decimal seq_no = dt1.GetDecimal("seq_no"); bffineyear_amt = dt1.GetDecimal("bffineyear_amt"); bfintyeararr_amt = dt1.GetDecimal("bfintyeararr_amt"); principal_payment3 = dt1.GetDecimal("principal_payment"); if (seq_no == 11) { seq_no = 11; } if (loanitemtype_code != "LRC" && loanitemtype_code != "B/F") { //pn_balance if ((principal_payment - principal_period) <= 0) { if ((bfprincipal_arrear - principal_payment) >= 0) { principal_payment = 0; } else { principal_payment -= bfprincipal_arrear; } } else { if ((bfprincipal_arrear - principal_period) > 0) { principal_payment = bfprincipal_arrear - principal_period; } else { principal_payment = principal_period; } } // pn_arr /* ( ( $F{LOANITEMTYPE_CODE} == "LPN" || $F{LOANITEMTYPE_CODE} == "LPX" && $F{BFPRINCIPAL_ARREAR} > $F{PRINCIPAL_PAYMENT} ? $F{PRINCIPAL_PAYMENT} :$F{BFPRINCIPAL_ARREAR})) */ if (bfprincipal_arrear > principal_payment2) { pn_arr = principal_payment2; } else { pn_arr = bfprincipal_arrear; } //คำนวณต้นล่วงหน้า //( ( $F{LOANITEMTYPE_CODE} == "LPN" || // $F{LOANITEMTYPE_CODE} == "LPX" && // $F{PRINCIPAL_PAYMENT} - ($V{pn_arr}+$V{pn_balance}) > 0 ? // $F{PRINCIPAL_PAYMENT} - ($V{pn_arr}+$V{pn_balance}):0 // ) //) if (principal_payment2 - (pn_arr + principal_payment) > 0) { forward_principal = principal_payment2 - (pn_arr + principal_payment); } else { forward_principal = 0; } // -------> เงินต้น ลด ใช้ filed principal_arrear //ต้นค้าง if (bfprincipal_arrear > 0 && loanitemtype_code != "LTA" && principal_payment3 > 0) { string insert_principal_arrear = @"insert into report_book_statement(coop_id ,loancontract_no,slip_date,principal_arrear,fine_period,fine_payment,interest_period,interest_payment,entry_id,description,principal_period,forward_principal,loanitemtype_code,fineyear_arrear,intyear_arrear,seq_no,principal_payment,balance) values({0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17})"; insert_principal_arrear = WebUtil.SQLFormat(insert_principal_arrear, state.SsCoopId, loancontract_no, slip_date, 0, 0, 0, 0, 0, entry_id, "ชำระต้นค้าง", bfprincipal_arrear, 0, loanitemtype_code, 0, 0, 8, 0, 0); WebUtil.QuerySdt(insert_principal_arrear); } //ต้นปกติ if (principal_payment > 0) { string insert_principal_arrear = @"insert into report_book_statement(coop_id ,loancontract_no,slip_date,principal_arrear,fine_period,fine_payment,interest_period,interest_payment,entry_id,description,principal_period,forward_principal,loanitemtype_code,fineyear_arrear,intyear_arrear,seq_no,principal_payment,balance) values({0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17})"; insert_principal_arrear = WebUtil.SQLFormat(insert_principal_arrear, state.SsCoopId, loancontract_no, slip_date, 0, 0, 0, 0, 0, entry_id, "ชำระต้นพึงชำระ", principal_payment, 0, loanitemtype_code, 0, 0, 9, 0, 0); WebUtil.QuerySdt(insert_principal_arrear); } //ต้นล่วงหน้า if (forward_principal > 0) { string insert_principal_arrear = @"insert into report_book_statement(coop_id ,loancontract_no,slip_date,principal_arrear,fine_period,fine_payment,interest_period,interest_payment,entry_id,description,principal_period,forward_principal,loanitemtype_code,fineyear_arrear,intyear_arrear,seq_no,principal_payment,balance) values({0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17})"; insert_principal_arrear = WebUtil.SQLFormat(insert_principal_arrear, state.SsCoopId, loancontract_no, slip_date, 0, 0, 0, 0, 0, entry_id, "ชำระต้นก่อนกำหนด", forward_principal, 0, loanitemtype_code, 0, 0, 10, 0, 0); WebUtil.QuerySdt(insert_principal_arrear); } //ต้นปกติ //if (principal_payment > 0) //{ // string insert_principal_arrear = @"insert into report_book_statement(coop_id ,loancontract_no,slip_date,principal_arrear,fine_period,fine_payment,interest_period,interest_payment,entry_id,description,principal_period,forward_principal,loanitemtype_code,fineyear_arrear,intyear_arrear,seq_no,principal_payment,balance) values({0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17})"; // insert_principal_arrear = WebUtil.SQLFormat(insert_principal_arrear, state.SsCoopId, loancontract_no, slip_date, 0, 0, 0, 0, 0, entry_id, "ชำระต้นพึงชำระ", principal_payment, 0, loanitemtype_code, 0, 0, 9, 0); // WebUtil.QuerySdt(insert_principal_arrear); //} //ต้นล่วงหน้า //if (forward_principal > 0) //{ // string insert_principal_arrear = @"insert into report_book_statement(coop_id ,loancontract_no,slip_date,principal_arrear,fine_period,fine_payment,interest_period,interest_payment,entry_id,description,principal_period,forward_principal,loanitemtype_code,fineyear_arrear,intyear_arrear,seq_no,principal_payment,balance) values({0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17})"; // insert_principal_arrear = WebUtil.SQLFormat(insert_principal_arrear, state.SsCoopId, loancontract_no, slip_date, 0, 0, 0, 0, 0, entry_id, "ชำระต้นก่อนกำหนด", 0, forward_principal, loanitemtype_code, 0, 0, 10, 0); // WebUtil.QuerySdt(insert_principal_arrear); //} // ดอกเบี้ยเพิ่ม ใช้ filed interest_period //ดิกเบี้ยพึง if (intreest_period > 0) { string insert_principal_arrear = @"insert into report_book_statement(coop_id ,loancontract_no,slip_date,principal_arrear,fine_period,fine_payment,interest_period,interest_payment,entry_id,description,principal_period,forward_principal,loanitemtype_code,fineyear_arrear,intyear_arrear,seq_no,principal_payment,balance) values({0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17})"; insert_principal_arrear = WebUtil.SQLFormat(insert_principal_arrear, state.SsCoopId, loancontract_no, slip_date, 0, 0, 0, intreest_period, 0, entry_id, "ดอกเบี้ยพึงชำระ", 0, 0, loanitemtype_code, 0, 0, 2, 0, intreest_period); WebUtil.QuerySdt(insert_principal_arrear); } // ดอกเบี้ยลดใช้ field interest_payment //ดอกเบี้ยใหม่ if (interest_payment > 0) { string insert_principal_arrear = @"insert into report_book_statement(coop_id ,loancontract_no,slip_date,principal_arrear,fine_period,fine_payment,interest_period,interest_payment,entry_id,description,principal_period,forward_principal,loanitemtype_code,fineyear_arrear,intyear_arrear,seq_no,principal_payment,balance) values({0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17})"; insert_principal_arrear = WebUtil.SQLFormat(insert_principal_arrear, state.SsCoopId, loancontract_no, slip_date, 0, 0, 0, 0, interest_payment, entry_id, "ชำระดอกเบี้ยพึงชำระ", 0, 0, loanitemtype_code, 0, 0, 3, 0, intreest_period - interest_payment); WebUtil.QuerySdt(insert_principal_arrear); } // ดอกเบี้ยเพิ่ม ใช้ filed fine_period //ด่าปรับพึง if (fine_period > 0) { string insert_principal_arrear = @"insert into report_book_statement(coop_id ,loancontract_no,slip_date,principal_arrear,fine_period,fine_payment,interest_period,interest_payment,entry_id,description,principal_period,forward_principal,loanitemtype_code,fineyear_arrear,intyear_arrear,seq_no,principal_payment,balance) values({0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17})"; insert_principal_arrear = WebUtil.SQLFormat(insert_principal_arrear, state.SsCoopId, loancontract_no, slip_date, 0, fine_period, 0, 0, 0, entry_id, "ด่าปรับพึง", 0, 0, loanitemtype_code, 0, 0, 4, 0, fine_period); WebUtil.QuerySdt(insert_principal_arrear); } // ด่าปรับพึงลดใช้ field fine_payment if (fine_payment > 0) { string insert_principal_arrear = @"insert into report_book_statement(coop_id ,loancontract_no,slip_date,principal_arrear,fine_period,fine_payment,interest_period,interest_payment,entry_id,description,principal_period,forward_principal,loanitemtype_code,fineyear_arrear,intyear_arrear,seq_no,principal_payment,balance) values({0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17})"; insert_principal_arrear = WebUtil.SQLFormat(insert_principal_arrear, state.SsCoopId, loancontract_no, slip_date, 0, 0, fine_payment, 0, 0, entry_id, "ชำระด่าปรับพึงชำระ", 0, 0, loanitemtype_code, 0, 0, 5, 0, fine_period - fine_payment); WebUtil.QuerySdt(insert_principal_arrear); } // ปรับค้างปี if (fineyear_arrear > 0) { string insert_principal_arrear = @"insert into report_book_statement(coop_id ,loancontract_no,slip_date,principal_arrear,fine_period,fine_payment,interest_period,interest_payment,entry_id,description,principal_period,forward_principal,loanitemtype_code,fineyear_arrear,intyear_arrear,seq_no,principal_payment,balance) values({0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17})"; insert_principal_arrear = WebUtil.SQLFormat(insert_principal_arrear, state.SsCoopId, loancontract_no, slip_date, 0, 0, fineyear_arrear, 0, 0, entry_id, "ชำระด่าปรับพึงชำระ", 0, 0, loanitemtype_code, fine_payment, 0, 7, 0, bffineyear_amt - fineyear_arrear); WebUtil.QuerySdt(insert_principal_arrear); } // ดอกเบี้ยค้าง if (intarr_payment > 0) { string insert_principal_arrear = @"insert into report_book_statement(coop_id ,loancontract_no,slip_date,principal_arrear,fine_period,fine_payment,interest_period,interest_payment,entry_id,description,principal_period,forward_principal,loanitemtype_code,fineyear_arrear,intyear_arrear,seq_no,principal_payment,balance) values({0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17})"; insert_principal_arrear = WebUtil.SQLFormat(insert_principal_arrear, state.SsCoopId, loancontract_no, slip_date, 0, 0, 0, 0, intarr_payment, entry_id, "ชำระด่าปรับค้างปี", 0, 0, loanitemtype_code, 0, 0, 6, 0, bfintyeararr_amt - intarr_payment); WebUtil.QuerySdt(insert_principal_arrear); } } else { // เงินเพิ่มใช้ principal_payment if (loanitemtype_code == "B/F") // ต้นยกมา { string insert_principal_arrear = @"insert into report_book_statement(coop_id ,loancontract_no,slip_date,principal_arrear,fine_period,fine_payment,interest_period,interest_payment,entry_id,description,principal_period,forward_principal,loanitemtype_code,fineyear_arrear,intyear_arrear,seq_no,principal_payment,balance) values({0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17})"; insert_principal_arrear = WebUtil.SQLFormat(insert_principal_arrear, state.SsCoopId, loancontract_no, slip_date, 0, dt1.GetDecimal("bffineyear_amt"), 0, dt1.GetDecimal("bfintyeararr_amt"), 0, entry_id, "ยอดยกมา ค้าง", 0, 0, loanitemtype_code, 0, 0, 1, principal_payment, principal_payment); WebUtil.QuerySdt(insert_principal_arrear); } else { //จ่ายเงินกู้ string insert_principal_arrear = @"insert into report_book_statement(coop_id ,loancontract_no,slip_date,principal_arrear,fine_period,fine_payment,interest_period,interest_payment,entry_id,description,principal_period,forward_principal,loanitemtype_code,fineyear_arrear,intyear_arrear,seq_no,principal_payment,balance) values({0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17})"; insert_principal_arrear = WebUtil.SQLFormat(insert_principal_arrear, state.SsCoopId, loancontract_no, slip_date, 0, 0, 0, 0, 0, entry_id, "จ่ายเงินกู้", 0, 0, loanitemtype_code, 0, 0, 1, principal_payment, principal_payment); WebUtil.QuerySdt(insert_principal_arrear); } } } } catch { } Page.ClientScript.RegisterStartupScript(this.GetType(), "Print_Card", "Print_Card('" + loancontract_no + "')", true); } public void JsPostAccountNo() { String loancontract_no = dw_main.GetItemString(1, "loancontract_no"); String sql1 = @"select loanpassbook_no,loanpassbook_no from lncontmaster where loancontract_no = '" + loancontract_no + "'"; Sdt dt1 = WebUtil.QuerySdt(sql1); if (dt1.Next()) { DwUtil.RetrieveDataWindow(dw_main, pbl, null, state.SsCoopControl, loancontract_no); if (Sta.IS_MYSQL_MODE) { DwUtil.RetrieveDataWindow(DwPeriod_myl, pbl, null, state.SsCoopControl, loancontract_no); } else { DwUtil.RetrieveDataWindow(DwPeriod, pbl, null, state.SsCoopControl, loancontract_no); } DwUtil.RetrieveDataWindow(dw_data_2, pbl, null, state.SsCoopControl, loancontract_no); dw_main.SetItemString(1, "check_no", dt1.GetString("loanpassbook_no")); } } public void PrinBookIreport_Kong() { iReportBuider report = new iReportBuider(this, ""); iReportArgument args3 = new iReportArgument(); string report_name3 = "", report_label3 = ""; report_name3 = "Book_ RepaymentMain"; try { string sqlselect = @"select * from report_master where ireport_id ='printbook_repayment' and coop_id={0}"; sqlselect = WebUtil.SQLFormat(sqlselect, state.SsCoopId); Sdt Greport = WebUtil.QuerySdt(sqlselect); if (Greport.Next()) { report_name3 = Greport.GetString("ireport_name"); // พิมพ์สมุดจ่ายเงินกู้ พร้อม หัวสมุด } } catch { } report_label3 = "ปริ้นสมุดชำระหนี้"; args3.Add("Loancontract_no", iReportArgumentType.String, Hdloancontract_no.Value); args3.Add("coop_id", iReportArgumentType.String, state.SsCoopId); iReportBuider report3 = new iReportBuider(this, ""); report.AddCriteria(report_name3, report_label3, ReportType.pdf, args3); report.AutoOpenPDF = true; report.Retrieve(); } public void JsPostAccountNo1() { String check_no = dw_main.GetItemString(1, "check_no"); String sql = @"select loancontract_no,loanpassbook_no from lncontmaster where loanpassbook_no = '" + check_no + "'"; Sdt dt = WebUtil.QuerySdt(sql); if (dt.Next()) { if (Sta.IS_MYSQL_MODE) { DwUtil.RetrieveDataWindow(DwPeriod_myl, pbl, null, state.SsCoopControl, dt.GetString("loancontract_no")); } else { DwUtil.RetrieveDataWindow(DwPeriod, pbl, null, state.SsCoopControl, dt.GetString("loancontract_no")); } // DwUtil.RetrieveDataWindow(DwPeriod, pbl, null, state.SsCoopControl, dt.GetString("loancontract_no")); DwUtil.RetrieveDataWindow(dw_main, pbl, null, state.SsCoopControl, dt.GetString("loancontract_no")); DwUtil.RetrieveDataWindow(dw_data_2, pbl, null, state.SsCoopControl, dt.GetString("loancontract_no")); dw_main.SetItemString(1, "check_no", dt.GetString("loanpassbook_no")); } } private void PostPrintNewBook() { try { //string as_loan_no = dw_data_1.GetItemString(1, "loancontract_no"); //DateTime adtm_date = state.SsWorkDate; //String as_xml_return = ""; //String as_entryid = ""; ////short ai_reprint = 0 ; //String as_newpassbook_no = ""; //String as_reson = ""; //int result = ndept.of_print_bookloan_firstpage(state.SsWsPass, as_loan_no, state.SsWorkDate, as_entryid, ref as_xml_return, 0, as_newpassbook_no, as_reson); string as_loan_no = dw_main.GetItemString(1, "member_no"); DateTime adtm_date = state.SsWorkDate; String as_xml_return = ""; String as_entryid = ""; //short ai_reprint = 0 ; String as_newpassbook_no = ""; String as_reson = ""; // int result = ndept.of_print_bookloan_firstpage(state.SsWsPass, as_loan_no, state.SsWorkDate, as_entryid, ref as_xml_return, 0, as_newpassbook_no, as_reson); int result = ndept.of_print_bookshare_firstpage(state.SsWsPass, as_loan_no, state.SsWorkDate, as_entryid, ref as_xml_return, 0, as_newpassbook_no, as_reson); //Printing.Loanprintbookfristpage(this, as_xml_return); Printing.PrintApplet(this, "loan_printbookfirst", as_xml_return); } catch (Exception ex) { LtServerMessage.Text = WebUtil.ErrorMessage(ex); } } private void PostPrintNewBookin() { try { if (state.SsCoopId == "000401" || state.SsCoopId == "000301" || state.SsCoopId == "500001") { iReportBuider report = new iReportBuider(this, ""); string report_label3 = "พิมพ์หัวสมุดชำระหนี้"; iReportArgument args3 = new iReportArgument(); args3.Add("loancontract_no", iReportArgumentType.String, dw_data_1.GetItemString(1, "loancontract_no")); report.AddCriteria("Book_cover_SSK", report_label3, ReportType.pdf, args3); report.AutoOpenPDF = true; report.Retrieve(); } } catch { } } private void PrinHeaderbook() { try { try { string ireport_type = ""; string Book_cover2 = "Book_cover2"; try { string sqlselect = @"select * from report_master where ireport_id ='Book_cover2' and coop_id={0}"; sqlselect = WebUtil.SQLFormat(sqlselect, state.SsCoopId); Sdt Greport = WebUtil.QuerySdt(sqlselect); if (Greport.Next()) { Book_cover2 = Greport.GetString("ireport_name"); // พิมพ์สมุดจ่ายเงินกู้ พร้อม หัวสมุด ireport_type = Greport.GetString("ireport_type"); } } catch { } if (ireport_type == "2") { Printing.ShrPrintBookHead(this, dw_data_1.GetItemString(1, "loancontract_no")); } else { iReportBuider report = new iReportBuider(this, ""); string report_label3 = "พิมพ์หัวสมุดชำระหนี้"; iReportArgument args3 = new iReportArgument(); args3.Add("loancontract_no", iReportArgumentType.String, dw_data_1.GetItemString(1, "loancontract_no")); report.AddCriteria(Book_cover2, report_label3, ReportType.pdf, args3); report.AutoOpenPDF = true; report.Retrieve(); } //} //else //{ //// DwUtil.RetrieveDataWindow(dw_head, "sl_print_book.pbl", null, dw_data_1.GetItemString(1, "loancontract_no")); //// string str = dw_head.Describe("DataWindow.Data.XML"); // Printing.PrintHead_SKMUA(this,dw_data_1.GetItemString(1, "loancontract_no"),state.SsCoopControl); //} } catch { } } catch { } } private void PostPrintNewBookout() { try { // string as_loan_no = dw_data_1.GetItemString(1, "loancontract_no"); string as_loan_no = dw_main.GetItemString(1, "member_no"); DateTime adtm_date = state.SsWorkDate; String as_xml_return = ""; String as_entryid = ""; //short ai_reprint = 0 ; String as_newpassbook_no = ""; String as_reson = ""; // int result = ndept.of_print_bookloan_firstpage(state.SsWsPass, as_loan_no, state.SsWorkDate, as_entryid, ref as_xml_return, 0, as_newpassbook_no, as_reson); int result = ndept.of_print_bookshare_firstpage(state.SsWsPass, as_loan_no, state.SsWorkDate, as_entryid, ref as_xml_return, 0, as_newpassbook_no, as_reson); //Printing.Loanprintbookfristpage(this, as_xml_return); Printing.PrintApplet(this, "loan_printbookout", as_xml_return); //if (state.SsCoopId == "000401" || state.SsCoopId == coop_id_SSK) //{ // string bookout = "bookout"; // try // { // string sqlselect = @"select * from report_master where ireport_id ='bookout' and coop_id={0}"; // sqlselect = WebUtil.SQLFormat(sqlselect, state.SsCoopId); // Sdt Greport = WebUtil.QuerySdt(sqlselect); // if (Greport.Next()) // { // bookout = Greport.GetString("ireport_name"); // พิมพ์สมุดจ่ายเงินกู้ พร้อม หัวสมุด // } // } // catch { } // iReportBuider report = new iReportBuider(this, ""); // string report_label3 = "พิมพ์ปกนอก"; // iReportArgument args3 = new iReportArgument(); // args3.Add("member_no", iReportArgumentType.String, dw_main.GetItemString(1, "member_no")); // report.AddCriteria(bookout, report_label3, ReportType.pdf, args3); // report.AutoOpenPDF = true; // report.Retrieve(); //} } catch { } } private void PostPrintBookin() { // string as_loan_no = dw_data_1.GetItemString(1, "loancontract_no"); string as_loan_no = dw_main.GetItemString(1, "member_no"); DateTime adtm_date = state.SsWorkDate; String as_xml_return = ""; String as_entryid = ""; //short ai_reprint = 0 ; String as_newpassbook_no = ""; String as_reson = ""; int result = ndept.of_print_bookshare_firstpage(state.SsWsPass, as_loan_no, state.SsWorkDate, as_entryid, ref as_xml_return, 0, as_newpassbook_no, as_reson); Printing.PrintApplet(this, "loan_printbookin", as_xml_return); } private void PostPrintLnconNo() { String sl_xml_lnconno = ""; if (dw_main.RowCount > 0) { if (Sta.IS_MYSQL_MODE) { sl_xml_lnconno = DwPeriod_myl.Describe("DataWindow.Data.XML"); } else { sl_xml_lnconno = DwPeriod.Describe("DataWindow.Data.XML"); } // Printing.LoanPrintCont(this, sl_xml_lnconno); Printing.PrintApplet(this, "loan_printcontract", sl_xml_lnconno); } } private void CallFuntion_PrintBook() { String loancontract_no = dw_data_1.GetItemString(1, "loancontract_no"); Page.ClientScript.RegisterStartupScript(this.GetType(), "CallPrintBook", "CallPrintBook('" + loancontract_no + "')", true); } } }