示例#1
0
        private void eMailToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ExtreXR rpr = new ExtreXR(frtID, dateEdit1.DateTime, dateEdit2.DateTime);

            if (string.IsNullOrWhiteSpace(rpr.eMails))
            {
                XtraMessageBox.Show("eMail adresi bulunamadı", "eMail Firma Extre", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            rpti.put("EXTRE", "FRT", frtID, Program.USR, "F", "eMail");
            MailClass.MailReportTask(rpti, "eMail Firma Extre", rpr, rpr.eMails, rpr.eMailSubject, rpr.eMailBody);
        }
示例#2
0
        private void eMailToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int            frtID = (int)gridView1.GetFocusedRowCellValue(colFRTID);
            BaBsMtkbtFrmXR rpr   = new BaBsMtkbtFrmXR(frtID, dateEdit1.DateTime, dateEdit2.DateTime);

            if (string.IsNullOrWhiteSpace(rpr.eMails))
            {
                XtraMessageBox.Show("eMail adresi bulunamadı", "eMail BaBs Mutabakat Formu", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            rpti.put("BABSMF", "FRT", frtID, Program.USR, "F", "eMail");
            MailClass.MailReportTask(rpti, "eMail BaBs Mutabakat Formu", rpr, rpr.eMails, rpr.eMailSubject, rpr.eMailBody);
        }
示例#3
0
        private void alisTeklifIstegiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int PK = (int)tstGridView.GetFocusedRowCellValue(colTSTIDt);

            rprAtiTableAdapter.Fill(teklifDataSet.RPR_ATI, PK, Program.USR);

            string eMails       = teklifDataSet.RPR_ATI.Rows[0]["EMAILS"].ToString();
            string eMailSubject = teklifDataSet.RPR_ATI.Rows[0]["EMAILSUBJECT"].ToString();
            string eMailBody    = teklifDataSet.RPR_ATI.Rows[0]["EMAILBODY"].ToString();

            if (string.IsNullOrWhiteSpace(eMails))
            {
                XtraMessageBox.Show("eMail adresi bulunamadı", "ATI", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }

            if (XtraMessageBox.Show($"Mail gönderilecekler: {eMails}", "ATI", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
            {
                rpti.put("ATI", "TST", PK, Program.USR, "F", "eMail");
                MailClass.MailReportTask(rpti, "ATI", null, eMails, eMailSubject, eMailBody, "");  // NoAttachment
            }
        }
示例#4
0
        private void markenHAWBRequestMailSendToolStripMenuItem_Click(object sender, EventArgs e)
        {
            save();

            var view             = ophLayoutView;
            int OPHid            = (int)view.GetFocusedRowCellValue(colOPHID);
            MrkHAWBrequestXR rpr = new MrkHAWBrequestXR(OPHid);

            if (string.IsNullOrWhiteSpace(rpr.eMails))
            {
                XtraMessageBox.Show("eMail adresi bulunamadı", "Marken HAWB Request Form", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            rpti.put("MHAWBRF", "OPH", OPHid, Program.USR, "F", "eMail");

            MailClass.MailReportAsBodyTask(rpti, "eMail Marken HAWB Request Form", rpr, rpr.eMails, rpr.eMailSubject, rpr.eMailBody);
            //sendEMail(rpti, "eMail Marken HAWB Request Form", rpr, rpr.eMails, rpr.eMailSubject, rpr.eMailBody);
        }
示例#5
0
        private void exportSatis(string dil, bool eMail = false)
        {
            int tstID = (int)tstGridView.GetFocusedRowCellValue(colTSTIDt);

            rprTklfTableAdapter.Fill(teklifDataSet.RPR_TKLF, tstID, dil);
            TeklifDataSet.RPR_TKLFRow rprTklfRow = (TeklifDataSet.RPR_TKLFRow)teklifDataSet.RPR_TKLF.Rows[0];
            string tklfTE = "Teklif";

            if (dil == "T")
            {
                colORGf.Caption     = "Çıkış";
                colDSTf.Caption     = "Varış";
                colBRMf.Caption     = "Birim";
                colTRNTIMEf.Caption = "Transit Süre";

                colSKDY.Caption  = "KDV%";
                colSDVZf.Caption = "Para Birim";

                colSFYTf.Caption  = "Fiyat";
                colSFYT1f.Caption = "Min";
                colSFYT2f.Caption = "-45";
                colSFYT3f.Caption = "+45";
                colSFYT4f.Caption = "+100";
                colSFYT5f.Caption = "+250";
                colSFYT6f.Caption = "+300";
                colSFYT7f.Caption = "+500";
                colSFYT8f.Caption = "+1000";

                colSFYTE.Caption  = "Fiyat";
                colSFYT1E.Caption = "Min";
                colSFYT2E.Caption = "-45";
                colSFYT3E.Caption = "+45";
                colSFYT4E.Caption = "+100";
                colSFYT5E.Caption = "+250";
                colSFYT6E.Caption = "+300";
                colSFYT7E.Caption = "+500";
                colSFYT8E.Caption = "+1000";
            }
            else
            {
                tklfTE              = "Tender";
                colORGf.Caption     = "Origin";
                colDSTf.Caption     = "Destination";
                colBRMf.Caption     = "Unit";
                colTRNTIMEf.Caption = "Transit Time";

                colSKDY.Caption  = "%VAT";
                colSDVZf.Caption = "Currency";

                colSFYTf.Caption  = "Rate";
                colSFYT1f.Caption = "Min";
                colSFYT2f.Caption = "-45";
                colSFYT3f.Caption = "+45";
                colSFYT4f.Caption = "+100";
                colSFYT5f.Caption = "+250";
                colSFYT6f.Caption = "+300";
                colSFYT7f.Caption = "+500";
                colSFYT8f.Caption = "+1000";

                colSFYTE.Caption  = "Rate";
                colSFYT1E.Caption = "Min";
                colSFYT2E.Caption = "-45";
                colSFYT3E.Caption = "+45";
                colSFYT4E.Caption = "+100";
                colSFYT5E.Caption = "+250";
                colSFYT6E.Caption = "+300";
                colSFYT7E.Caption = "+500";
                colSFYT8E.Caption = "+1000";
            }

            if (colG9.GroupIndex == 0)
            {
                tsfGridView.CollapseAllGroups();
                //tsfGridView.OptionsView.ShowFooter = true;
                tsfGridView.OptionsPrint.ExpandAllGroups = false;
                tsfGridView.OptionsPrint.PrintFooter     = true;
                //tsfGridView.OptionsPrint.AutoWidth = false;
                tsfGridView.OptionsPrint.AutoWidth = true;
            }
            else
            {
                tsfGridView.ExpandAllGroups();
                //tsfGridView.OptionsView.ShowFooter = false;
                tsfGridView.OptionsPrint.ExpandAllGroups = true;
                tsfGridView.OptionsPrint.PrintFooter     = false;
                //tsfGridView.OptionsPrint.AutoWidth = false;
                tsfGridView.OptionsPrint.AutoWidth = true;
                //tsfGridView.BestFitColumns();
            }

            RichEditDocumentServer richServer = new RichEditDocumentServer();

            richServer.RtfText = rprTklfRow.ALTNOT;
            //richServer.Document.AppendText(" SENER");
            if (!rprTklfRow.IsDTYNOTNull())
            {
                if (string.IsNullOrEmpty(richServer.Text))
                {
                    richServer.RtfText = rprTklfRow.DTYNOT;
                }
                else
                {
                    richServer.Document.AppendRtfText(rprTklfRow.DTYNOT);
                }
            }

            tsfGridView.OptionsPrint.RtfReportFooter = richServer.RtfText;
            tsfGridView.OptionsPrint.RtfPageFooter   = rprTklfRow.FOOTER;


            PrintingSystem         ps   = new PrintingSystem();
            PrintableComponentLink link = new PrintableComponentLink(ps);

            link.Component = tsfGridControl;

            link.PaperKind      = System.Drawing.Printing.PaperKind.A4;
            link.Landscape      = false;
            link.Margins.Left   = 10;
            link.Margins.Right  = 10;
            link.Margins.Top    = 10;
            link.Margins.Bottom = 10;

//            tsfGridView.OptionsPrint.RtfPageHeader =
            tsfGridView.OptionsPrint.RtfReportHeader =
                rprTklfRow.USTNOT
                .Replace("@TSTID@", rprTklfRow.TSTID.ToString())
                .Replace("@FIRMA@", rprTklfRow.FIRMA)
                .Replace("@TLPTRH@", rprTklfRow.TLPTRHS)
                .Replace("@TKLTRH@", rprTklfRow.TKLTRHS)
                .Replace("@GCRTRH@", rprTklfRow.GCRTRHS)
                .Replace("@ROT@", rprTklfRow.ROT)
                .Replace("@MOT@", rprTklfRow.MOT)
                .Replace("@PTM@", rprTklfRow.PTM)
                .Replace("@DTM@", rprTklfRow.DTM)

                .Replace("@HORGS@", rprTklfRow.HORGS)
                .Replace("@HDSTS@", rprTklfRow.HDSTS)
                .Replace("@MORGS@", rprTklfRow.MORGS)
                .Replace("@MDSTS@", rprTklfRow.MDSTS)

                .Replace("@MALCINSI@", rprTklfRow["MALCINSI"].ToString())
                .Replace("@INFO@", rprTklfRow.INFO);

            link.CreateDocument();

            if (eMail)
            {
                if (string.IsNullOrWhiteSpace(rprTklfRow.EMAILS))
                {
                    XtraMessageBox.Show("eMail adresi bulunamadı", "eMail Teklif", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    return;
                }

                Cursor = Cursors.WaitCursor;
                try
                {
                    MainDataSet.SMTPRow SMTP = Program.MF.SMTP();
                    MailMessage         mail = new MailMessage();

                    // Create a new memory stream and export the report into it as PDF.
                    MemoryStream ms = new MemoryStream();
                    link.ExportToPdf(ms);

                    // Create a new attachment and put the PDF report into it.
                    ms.Seek(0, System.IO.SeekOrigin.Begin);
                    Attachment att = new Attachment(ms, string.Format("{0}-{1}.pdf", tklfTE, tstID), "application/pdf");
                    mail.Attachments.Add(att);

                    mail.To.Add(rprTklfRow.EMAILS);

                    mail.Subject    = rprTklfRow.EMAILSUBJECT;
                    mail.Body       = rprTklfRow.EMAILBODY;
                    mail.IsBodyHtml = true;

                    mail.From = new MailAddress(SMTP.MAIL_FROM_ADDRESS, SMTP.MAIL_FROM_DISPLAY_NAME);
                    SmtpClient smtp = new SmtpClient(SMTP.CLIENT_HOST);
                    smtp.Credentials = new System.Net.NetworkCredential(SMTP.CREDENTIALS_USER_NAME, SMTP.CREDENTIALS_USER_PASSWORD);
                    smtp.EnableSsl   = SMTP.ENABLE_SSL == "T" ? true : false;
                    smtp.Port        = SMTP.PORT;

                    smtp.Send(mail);

                    int    len = (int)ms.Length;
                    byte[] img = new byte[len];
                    ms.Read(img, 0, len);
                    //teklifQueriesTableAdapter.DOC_INS2("TST", tstID, "Teklif", ".pdf", "TKLF", Program.USR, len, img);
                    teklifQueriesTableAdapter.DOC_INS2("TST", tstID, string.Format("Teklif {0}", tstGridView.GetFocusedRowCellValue(colRVSNOt)), ".pdf", "TKLF", Program.USR, len, img);

                    // Close the memory stream.
                    ms.Close();
                    ms.Flush();

                    rptInfo rpti = new rptInfo();
                    rpti.put("TKLF", "TST", tstID, Program.USR, "F", "eMail Teklif");
                    Program.MF.reportDone(rpti, false);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(this, "Error sending eMail.\n" + ex.ToString());
                }
                finally
                {
                    Cursor = Cursors.Default;
                }
            }
            else
            {
                link.ShowPreviewDialog();

                if (XtraMessageBox.Show("İşlem tamamlandı mı?", "Print", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                {
                    MemoryStream ms = new MemoryStream();
                    link.ExportToPdf(ms);
                    ms.Seek(0, System.IO.SeekOrigin.Begin);
                    int    len = (int)ms.Length;
                    byte[] img = new byte[len];
                    ms.Read(img, 0, len);
                    ms.Close();

                    teklifQueriesTableAdapter.DOC_INS2("TST", tstID, string.Format("Teklif {0}", tstGridView.GetFocusedRowCellValue(colRVSNOt)), ".pdf", "TKLF", Program.USR, len, img);
                    rptInfo rpti = new rptInfo();
                    rpti.put("TKLF", "TST", tstID, Program.USR, "F", "eMail Teklif");
                    Program.MF.reportDone(rpti, false);
                }
            }
        }
示例#6
0
        private void MAWBprintToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int    OPMid = (int)opmGridView.GetFocusedRowCellValue(colOPMID);
            MawbXR rpr   = new MawbXR(OPMid, false);

            using (ReportPrintTool printTool = new ReportPrintTool(rpr))
            {
                printTool.ShowPreviewDialog();
                rpti.put("MAWB", "OPM", OPMid, Program.USR, "F", null);
                Program.MF.reportDone(rpti);
            }
        }