//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(); }
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(); } } }