void bttPrintContract_Click(object sender, EventArgs e) { //print PrintDocuments.booking PrintBooking = new DXWindowsApplication2.PrintDocuments.booking(); int reserve_id = int.Parse(textEditReserveId.EditValue.ToString()); //reserve_id PrintBooking.loopGenDataRow(reserve_id); PrintBooking.ShowPreview(); initRoom(); }
//void printPreviewContract() //{ // PrintDocuments.contract PrintContract = new DXWindowsApplication2.PrintDocuments.contract(); // DataTable GeneralInfo = BusinessLogicBridge.DataStore.getGeneralConfig(); // string filePath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); // filePath = filePath + @"\" + GeneralInfo.Rows[0]["path_all_document"].ToString(); // string pathname = DXWindowsApplication2.MainForm.CombinePaths(Environment.GetFolderPath(Environment.SpecialFolder.Personal), GeneralInfo.Rows[0]["path_all_document"].ToString(), "Contract", textEditContractNo.EditValue.ToString() + ".pdf"); // PrintContract.loopGenDataRow(check_in_id); // PrintContract.ExportToPdf(pathname); // PrintContract.ShowPreview(); //} private void bttPrint_Click(object sender, EventArgs e) { string pathname = ""; string filePath = ""; DataTable GeneralInfo = new DataTable(); DataTable GridTableCheckbox = new DataTable(); GridTableCheckbox = ((DataTable)gridControlContract.DataSource); PrintDocuments.contract PrintContract = new DXWindowsApplication2.PrintDocuments.contract(); for (int i = 0; i < GridTableCheckbox.Rows.Count; i++) { if ((bool)(GridTableCheckbox.Rows[i]["checkbox"]) == true) { if (GridTableCheckbox.Rows[i]["flag_type_contract"].To <int>() == 1) { // Checkin GeneralInfo = BusinessLogicBridge.DataStore.getGeneralConfig(); filePath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); filePath = filePath + @"\" + GeneralInfo.Rows[0]["path_all_document"].ToString(); pathname = DXWindowsApplication2.MainForm.CombinePaths(filePath, "Contract", GridTableCheckbox.Rows[i].Table.Rows[0]["check_in_label"].ToString() + ".pdf"); PrintContract.loopGenDataRow(GridTableCheckbox.Rows[i]["check_in_id"].To <int>()); PrintContract.ShowPreview(); } else { // Booking PrintDocuments.booking PrintBooking = new DXWindowsApplication2.PrintDocuments.booking(); int reserve_id = GridTableCheckbox.Rows[i]["check_in_id"].To <int>(); //reserve_id PrintBooking.loopGenDataRow(reserve_id); PrintBooking.ShowPreview(); } } } loadContract(); }
void bttPrintContract_Click(object sender, EventArgs e) { //print PrintDocuments.booking PrintBooking = new DXWindowsApplication2.PrintDocuments.booking(); int reserve_id = int.Parse(textEditReserveId.EditValue.ToString()); //reserve_id PrintBooking.loopGenDataRow(reserve_id); PrintBooking.ShowPreview(); initRoom(); }
//void printPreviewContract() //{ // PrintDocuments.contract PrintContract = new DXWindowsApplication2.PrintDocuments.contract(); // DataTable GeneralInfo = BusinessLogicBridge.DataStore.getGeneralConfig(); // string filePath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); // filePath = filePath + @"\" + GeneralInfo.Rows[0]["path_all_document"].ToString(); // string pathname = DXWindowsApplication2.MainForm.CombinePaths(Environment.GetFolderPath(Environment.SpecialFolder.Personal), GeneralInfo.Rows[0]["path_all_document"].ToString(), "Contract", textEditContractNo.EditValue.ToString() + ".pdf"); // PrintContract.loopGenDataRow(check_in_id); // PrintContract.ExportToPdf(pathname); // PrintContract.ShowPreview(); //} private void bttPrint_Click(object sender, EventArgs e) { string pathname = ""; string filePath = ""; DataTable GeneralInfo = new DataTable(); DataTable GridTableCheckbox = new DataTable(); GridTableCheckbox = ((DataTable)gridControlContract.DataSource); PrintDocuments.contract PrintContract = new DXWindowsApplication2.PrintDocuments.contract(); for (int i = 0; i < GridTableCheckbox.Rows.Count; i++) { if ((bool)(GridTableCheckbox.Rows[i]["checkbox"]) == true) { if (GridTableCheckbox.Rows[i]["flag_type_contract"].To<int>() == 1) { // Checkin GeneralInfo = BusinessLogicBridge.DataStore.getGeneralConfig(); filePath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); filePath = filePath + @"\" + GeneralInfo.Rows[0]["path_all_document"].ToString(); pathname = DXWindowsApplication2.MainForm.CombinePaths(filePath, "Contract", GridTableCheckbox.Rows[i].Table.Rows[0]["check_in_label"].ToString() + ".pdf"); PrintContract.loopGenDataRow(GridTableCheckbox.Rows[i]["check_in_id"].To<int>()); PrintContract.ShowPreview(); } else { // Booking PrintDocuments.booking PrintBooking = new DXWindowsApplication2.PrintDocuments.booking(); int reserve_id = GridTableCheckbox.Rows[i]["check_in_id"].To<int>(); //reserve_id PrintBooking.loopGenDataRow(reserve_id); PrintBooking.ShowPreview(); } } } loadContract(); }