private void tableGrid_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex >= 0)
                {
                    if (despactDirection != nameof(EI.GibUser.GibUsers))
                    {
                        #region panelVisiblity
                        if (despactDirection == nameof(EI.Direction.IN))//gelen faturalara tıklandıysa
                        {
                            pnlIncomingDespatch.Visible = true;
                        }
                        else if (despactDirection == nameof(EI.Direction.OUT))//giden faturalar
                        {
                            pnlSendDespatch.Visible = true;
                        }
                        else if (despactDirection == nameof(EI.Direction.DRAFT))//taslak faturalar
                        {
                            pnlDraftDespatch.Visible = true;
                        }
                        #endregion

                        //html göruntule butonuna tıkladıysa
                        if (e.ColumnIndex == tableGrid.Columns[nameof(EI.GridBtnClmName.previewHtml)].Index)
                        {
                            string uuid = tableGrid.Rows[e.RowIndex].Cells[nameof(EI.Invoice.uuid)].Value.ToString();

                            string content = Singl.despatchControllerGet.getDespatchContentXml(uuid, despactDirection);
                            if (content != null) //servisten veya dıskten getırlebılmısse
                            {
                                FrmView previewInvoices = new FrmView(content, nameof(EI.Despatch.DespatchAdvices));
                                previewInvoices.ShowDialog();
                            }
                            else
                            {
                                MessageBox.Show(Lang.cantGetContent);
                            }
                        }
                    }
                }
            }
            catch (FaultException <REQUEST_ERRORType> ex)
            {
                if (ex.Detail.ERROR_CODE == 2005)
                {
                    Singl.authControllerGet.Login(FrmLogin.usurname, FrmLogin.password);
                }
                MessageBox.Show(ex.Detail.ERROR_SHORT_DES, "ProcessingFault", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (System.Data.Entity.Infrastructure.DbUpdateException)
            {
                MessageBox.Show(Lang.dbFault, "DataBaseFault", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Esempio n. 2
0
        private void TableGrid_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                #region panelVisiblity
                if (gridMenuType == EI.SelfEmploymentReceipt.SelfEmploymentReceipts.ToString())//smm
                {
                    pnlSmm.Visible        = true;
                    pnlSmmReports.Visible = false;
                    pnlDraftSmm.Visible   = false;
                }
                else if (gridMenuType == EI.SmmReports.SmmReports.ToString()) //smm report
                {
                    pnlSmm.Visible        = false;
                    pnlSmmReports.Visible = true;
                    pnlDraftSmm.Visible   = false;
                }
                else //taslak smm
                {
                    pnlSmm.Visible        = false;
                    pnlSmmReports.Visible = false;
                    pnlDraftSmm.Visible   = true;
                }
                #endregion

                try
                {
                    if (e.ColumnIndex == tableGrid.Columns[nameof(EI.GridBtnClmName.previewHtml)].Index)
                    {
                        // imzalı contentı getır
                        if (gridMenuType.Equals(nameof(EI.SmmReports.SmmReports))) //smm raporlarında  ıse
                        {
                            ////burayı ekle
                            ///
                        }
                        else  //smm  veya taslak smmde ıse
                        {
                            string content = Singl.smmControllerGet.getSmmContentXml(tableGrid.Rows[e.RowIndex].Cells[nameof(EI.Invoice.uuid)].Value.ToString());

                            if (content != null)                                                                                         //servisten veya dıskten getırlebılmısse
                            {
                                FrmView previewInvoices = new FrmView(content, nameof(EI.SelfEmploymentReceipt.SelfEmploymentReceipts)); //taslak fatura olsa turu arsıvdır
                                previewInvoices.ShowDialog();
                            }
                            else
                            {
                                MessageBox.Show(Lang.cantGetContent);//content dıskten sılınmıs ve servısten getırılemedı
                            }
                        }
                    }
                }
                catch (FaultException <REQUEST_ERRORType> ex)
                {
                    if (ex.Detail.ERROR_CODE == 2005)
                    {
                        Singl.authControllerGet.Login(FrmLogin.usurname, FrmLogin.password);
                    }
                    MessageBox.Show(ex.Detail.ERROR_SHORT_DES, "ProcessingFault", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (System.Data.Entity.Infrastructure.DbUpdateException)
                {
                    MessageBox.Show(Lang.dbFault, "DataBaseFault", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
        }
Esempio n. 3
0
        private void btnCreditNoteView_Click(object sender, EventArgs e)
        {
            try
            {
                string       uuid    = tableGrid.SelectedRows[0].Cells[nameof(EI.SelfEmploymentReceipt.uuid)].Value.ToString();
                CONTENT_TYPE docType = CONTENT_TYPE.XML;

                if (rdViewHtml.Checked) //html
                {
                    string xmlContent = Singl.smmControllerGet.getSmmContentXml(uuid);
                    if (xmlContent != null)
                    {
                        FrmView previewInvoices = new FrmView(xmlContent, nameof(EI.SelfEmploymentReceipt.SelfEmploymentReceipts));
                        previewInvoices.ShowDialog();
                    }
                    else
                    {
                        MessageBox.Show(Lang.cantGetContent);//content dıskten sılınmıs ve servısten getırılemedı
                    }
                }
                else  //html degılse
                {
                    if (rdViewXml.Checked) // xml ise
                    {
                        docType = CONTENT_TYPE.XML;
                    }
                    else //hicbirini secmezse pdf  görüntülenecektır
                    {
                        docType = CONTENT_TYPE.PDF;
                    }
                    /////////////
                    byte[] content = Singl.smmControllerGet.getSmmWithType(uuid, docType);
                    if (content != null)
                    {
                        string path = FolderControl.smmFolderPath + uuid + "." + docType;
                        FolderControl.writeFileOnDiskWithByte(content, path);
                        System.Diagnostics.Process.Start(path);
                    }
                    else
                    {
                        MessageBox.Show(Lang.cantGetContent);//content dıskten sılınmıs ve servısten getırılemedı
                    }
                }
            }
            catch (FaultException <SERVICES.serviceCreditNote.REQUEST_ERRORType> ex)  //archive req error
            {
                if (ex.Detail.ERROR_CODE == 2005)
                {
                    Singl.authControllerGet.Login(FrmLogin.usurname, FrmLogin.password);
                }
                MessageBox.Show(ex.Detail.ERROR_SHORT_DES, "ProcessingFault", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (System.Data.Entity.Infrastructure.DbUpdateException ex)
            {
                MessageBox.Show(Lang.dbFault + " " + ex.InnerException.Message.ToString(), "DataBaseFault", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (System.Data.DataException ex)
            {
                MessageBox.Show(ex.InnerException.Message.ToString());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Esempio n. 4
0
        private void tableArchiveGrid_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                #region panelVisiblity
                if (gridMenuType == EI.Invoice.ArchiveInvoices.ToString())//arsıv ınvoices
                {
                    pnlArchive.Visible       = true;
                    pnlDraftArchive.Visible  = false;
                    pnlArchiveReport.Visible = false;
                }
                else if (gridMenuType == EI.ArchiveReports.ArchiveReports.ToString()) //arsıv report
                {
                    pnlArchive.Visible       = false;
                    pnlDraftArchive.Visible  = false;
                    pnlArchiveReport.Visible = true;
                }
                else //taslak archıve
                {
                    pnlDraftArchive.Visible  = true;
                    pnlArchiveReport.Visible = false;
                    pnlArchive.Visible       = false;
                }
                #endregion

                try
                {
                    if (!gridMenuType.Equals(nameof(EI.Invoice.ArchiveInvoices)))                                   //grid durumu arsıv faturalarında degılse
                    {
                        if (e.ColumnIndex == tableArchiveGrid.Columns[nameof(EI.GridBtnClmName.previewHtml)].Index) //html goruntuleye tıkladı
                        {
                            // imzalı contentı getır
                            if (gridMenuType.Equals(nameof(EI.ArchiveReports.ArchiveReports))) //arsıv raporlarında  ıse
                            {
                                string content = Singl.archiveControllerGet.getArchiveReportXml(tableArchiveGrid.Rows[e.RowIndex].Cells[nameof(EI.ArchiveReports.reportNo)].Value.ToString());

                                if (content != null) //servisten veya dıskten getırlebılmısse
                                {
                                    FrmView previewInvoices = new FrmView(content, gridMenuType);
                                    previewInvoices.ShowDialog();
                                }
                                else
                                {
                                    MessageBox.Show(Lang.cantGetContent);//content dıskten sılınmıs ve servısten getırılemedı
                                }
                            }
                            else  //taslak arsıv ıse
                            {
                                string content = Singl.archiveControllerGet.getArchiveContentXml(tableArchiveGrid.Rows[e.RowIndex].Cells[nameof(EI.Invoice.uuid)].Value.ToString());

                                if (content != null)                                                                    //servisten veya dıskten getırlebılmısse
                                {
                                    FrmView previewInvoices = new FrmView(content, nameof(EI.Invoice.ArchiveInvoices)); //taslak fatura olsa turu arsıvdır
                                    previewInvoices.ShowDialog();
                                }
                                else
                                {
                                    MessageBox.Show(Lang.cantGetContent);//content dıskten sılınmıs ve servısten getırılemedı
                                }
                            }
                        }
                    }
                }
                catch (FaultException <REQUEST_ERRORType> ex)
                {
                    if (ex.Detail.ERROR_CODE == 2005)
                    {
                        Singl.authControllerGet.Login(FrmLogin.usurname, FrmLogin.password);
                    }
                    MessageBox.Show(ex.Detail.ERROR_SHORT_DES, "ProcessingFault", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (System.Data.Entity.Infrastructure.DbUpdateException)
                {
                    MessageBox.Show(Lang.dbFault, "DataBaseFault", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
        }