private void PrintListOrder(bool bPreview) { if (bdsPXK.Position < 0) { return; } bool bAcceptShowDialog = true; bool bInVisibleNextPrint = false; string strReport_File_First = "rptPXKList"; string strMa_PX_List = ""; DataRow drCurrent = ((DataRowView)bdsPXK.Current).Row; DataRow[] drArrPrint = dtPXK.Select("Selected = true"); if (drArrPrint.Length > 1) { for (int i = 0; i < drArrPrint.Length; i++) { strMa_PX_List += drArrPrint[i]["Ma_Px"].ToString() + ","; } PrintVoucher.PrintListOrder(strMa_PX_List, bPreview, true, ref bInVisibleNextPrint, ref strReport_File_First); } else { PrintVoucher.PrintListOrder(this.strMa_PX, bPreview, true, ref bInVisibleNextPrint, ref strReport_File_First); } }
void KeyDownEvent(object sender, KeyEventArgs e) { if (bdsPXK.Position < 0) { return; } DataRow drCurrent = ((DataRowView)bdsPXK.Current).Row; switch (e.KeyCode) { case Keys.F9: //this.Filter(); break; case Keys.F7: switch (e.Modifiers) { case Keys.Shift: Design(); break; case Keys.Control: PrintVoucher.PrintInvoices(drCurrent["Ma_Px"].ToString()); break; } break; } }
//void btInTam_Click(object sender, EventArgs e) //{ // Save3(); // string strReport_File_First = string.Empty; // bool bInVisibleNextPrint = false; // PrintVoucher.Print(drEditPh1, true, true, ref bInVisibleNextPrint, ref strReport_File_First); // enuNew_Edit = enuEdit.Edit; //} void btPrint_Click(object sender, EventArgs e) { Save3(); string strReport_File_First = string.Empty; bool bInVisibleNextPrint = false; enuNew_Edit = enuEdit.Edit; PrintVoucher.Print(drEditPh1, false, true, ref bInVisibleNextPrint, ref strReport_File_First); //this.Close(); }
void btPrintReport_Click(object sender, EventArgs e) { string strRPT = cbxReport_List.SelectedValue.ToString(); if (strRPT == "PXK") { Print(true); } else if (strRPT == "PXKLIST") { PrintListOrder(true); } else if (strRPT == "INVOICE") { if (bdsPXK.Position < 0) { return; } DataRow drCurrent = ((DataRowView)bdsPXK.Current).Row; PrintVoucher.PrintInvoices(drCurrent["Ma_Px"].ToString()); } else if (strRPT == "INVOICE_0") { if (bdsPXK.Position < 0) { return; } DataRow drCurrent = ((DataRowView)bdsPXK.Current).Row; PrintVoucher.PrintInvoices(drCurrent["Ma_Px"].ToString(), true, false); } else if (strRPT == "INVOICE_1") { if (bdsPXK.Position < 0) { return; } DataRow drCurrent = ((DataRowView)bdsPXK.Current).Row; PrintVoucher.PrintInvoices(drCurrent["Ma_Px"].ToString(), true, true); } else if (strRPT == "DTT02") { PrintDTT02(); } else if (strRPT == "DTT05") { PrintDTT05(); } else if (strRPT == "DTT05_1") { PrintDTT05_1(); } }
private void Print(bool bPreview) { if (bdsViewPh.Position < 0) { return; } drCurrent = ((DataRowView)bdsViewPh.Current).Row; DataRow[] drArrPrint = dtViewPh.Select("Mark = true"); bool bAcceptShowDialog = true; bool bInVisibleNextPrint = false; string strReport_File_First = string.Empty; if (drArrPrint.Length > 1) { for (int i = 0; i < drArrPrint.Length; i++) { drCurrent = drArrPrint[i]; if (i == 0) { bAcceptShowDialog = PrintVoucher.Print(drCurrent, bPreview, true, ref bInVisibleNextPrint, ref strReport_File_First); } else { if (bAcceptShowDialog) { bAcceptShowDialog = PrintVoucher.Print(drCurrent, bPreview, false, ref bInVisibleNextPrint, ref strReport_File_First); } else { break; } } if (bAcceptShowDialog) { drCurrent["Mark"] = false; } } } else { PrintVoucher.Print(drCurrent, bPreview, true, ref bInVisibleNextPrint, ref strReport_File_First); } }
void frmThanhToan_KeyDown(object sender, KeyEventArgs e) { //if (e.KeyCode == Keys.F6) //{ // if (numTTien_Dua.Value == 0) // { // string strMsg = Element.sysLanguage == enuLanguageType.Vietnamese ? "Vui lòng nhập số tiền khách hàng đưa !" : "Please enter the amount to the customer"; // Common.MsgCancel(strMsg); // numTTien_Dua.Focus(); // } // else if (numTTien_Dua.Value < numTTien_Nt.Value) // { // string strMsg = Element.sysLanguage == enuLanguageType.Vietnamese ? "Số tiền khách hàng đưa > Số tiền thanh toán !" : "Amount customers make > Payment amount!"; // Common.MsgCancel(strMsg); // numTTien_Dua.Focus(); // } // else // { // Save3(); // string strReport_File_First = string.Empty; // bool bInVisibleNextPrint = false; // enuNew_Edit = enuEdit.Edit; // PrintVoucher.Print(drEditPh1, false, false, ref bInVisibleNextPrint, ref strReport_File_First); // } //} if (e.KeyCode == Keys.F6) { if (numTTien_Dua.Value == 0) { string strMsg = Element.sysLanguage == enuLanguageType.Vietnamese ? "Vui lòng nhập số tiền khách hàng đưa !" : "Please enter the amount to the customer"; Common.MsgCancel(strMsg); numTTien_Dua.Focus(); } else if (numTTien_Dua.Value < numTTien_Nt.Value) { string strMsg = Element.sysLanguage == enuLanguageType.Vietnamese ? "Số tiền khách hàng đưa > Số tiền thanh toán !" : "Amount customers make > Payment amount!"; Common.MsgCancel(strMsg); numTTien_Dua.Focus(); } else { Save3(); //Tự động tạo phiếu thu tiền Hashtable ht = new Hashtable(); ht["STT"] = strStt1; ht["NGAY_CT"] = drEditPh1["Ngay_Ct"]; ht["SO_CT"] = drEditPh1["So_Ct"]; ht["MA_DT"] = drEditPh1["Ma_Dt"]; ht["TIEN"] = drEditPh1["TTien0"]; ht["TIEN_NT"] = drEditPh1["TTien_Nt0"]; ht["TK_NO"] = drDmCt1["TK_No"]; ht["TK_CO"] = drDmCt1["TK_Co"]; ht["MA_DVCS"] = drEditPh1["Ma_DvCs"]; SQLExec.Execute("sp_UpdatePOS_InsertPT", ht, CommandType.StoredProcedure); string strMsg = Element.sysLanguage == enuLanguageType.Vietnamese ? "Đã lưu !" : " Save successful !"; Common.MsgCancel(strMsg); } } if (e.KeyCode == Keys.F7) { if (numTTien_Dua.Value == 0) { string strMsg = Element.sysLanguage == enuLanguageType.Vietnamese ? "Vui lòng nhập số tiền khách hàng đưa !" : "Please enter the amount to the customer"; Common.MsgCancel(strMsg); numTTien_Dua.Focus(); } else if (numTTien_Dua.Value < numTTien_Nt.Value) { string strMsg = Element.sysLanguage == enuLanguageType.Vietnamese ? "Số tiền khách hàng đưa > Số tiền thanh toán !" : "Amount customers make > Payment amount!"; Common.MsgCancel(strMsg); numTTien_Dua.Focus(); } else { Save3(); //Tự động tạo phiếu thu tiền Hashtable ht = new Hashtable(); ht["STT"] = strStt1; ht["NGAY_CT"] = drEditPh1["Ngay_Ct"]; ht["SO_CT"] = drEditPh1["So_Ct"]; ht["MA_DT"] = drEditPh1["Ma_Dt"]; ht["TIEN"] = drEditPh1["TTien0"]; ht["TIEN_NT"] = drEditPh1["TTien_Nt0"]; ht["TK_NO"] = drDmCt1["TK_No"]; ht["TK_CO"] = drDmCt1["TK_Co"]; ht["MA_DVCS"] = drEditPh1["Ma_DvCs"]; SQLExec.Execute("sp_UpdatePOS_InsertPT", ht, CommandType.StoredProcedure); string strReport_File_First = string.Empty; bool bInVisibleNextPrint = false; enuNew_Edit = enuEdit.Edit; PrintVoucher.Print(drEditPh1, false, false, ref bInVisibleNextPrint, ref strReport_File_First); this.Close(); } } }