Example #1
0
        public FrmShowTracciato(string S, DataTable T, string obj)
        {
            InitializeComponent();
            if (S == "")
            {
                tabControl1.TabPages.Remove(tabPage1);
            }
            else
            {
                txtTracciato.Text = S;
                txtTracciato.Select(0, 0);
                tabPage1.Text = obj;
            }
            if (T.DataSet == null)
            {
                DataSet D = new DataSet();
                D.Tables.Add(T);
            }
            if (T == null)
            {
                tabControl1.TabPages.Remove(tabGrid);
            }
            else
            {
                HelpForm.SetDataGrid(gridTab, T);

                ExcelMenu = new ContextMenu();
                ExcelMenu.MenuItems.Add("Excel", new EventHandler(Excel_Click));
                ExcelMenu.MenuItems.Add("CSV", new EventHandler(CSV_Click));
                gridTab.ContextMenu = ExcelMenu;
            }
        }
Example #2
0
        private void riempiContrattoNonTrasferibile()
        {
            int    eserciziosucc     = esercizio + 1;
            string sortContratti     = "idcon";
            string filtraContrattiNT = QHS.AppAnd(QHS.CmpLe("ycon", esercizio),
                                                  QHS.CmpEq("ycon", esercizio)) +
                                       " AND NOT EXISTS(SELECT * FROM parasubcontractyear WHERE (ayear = " +
                                       QHS.quote(eserciziosucc) + " ) AND (parasubcontractview.idcon = parasubcontractyear.idcon)) " +
                                       " AND ((SELECT COUNT(*) FROM payroll WHERE " +
                                       QHS.AppAnd(QHS.CmpEq("fiscalyear", esercizio), QHS.IsNull("disbursementdate"),
                                                  QHS.CmpEq("flagbalance", "S"), "(parasubcontractview.idcon = payroll.idcon)") +
                                       ") > 0)";

            DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, DS.parasubcontractview, sortContratti, filtraContrattiNT, null, false);

            foreach (DataRow drContratto in DS.parasubcontractview.Rows)
            {
                drContratto["!causa"] = "Cedolino di conguaglio Non Erogato";
            }

            assegnaCaption();

            if (dgContratto.DataSource == null)
            {
                HelpForm.SetDataGrid(dgContratto, DS.parasubcontractview);
                new formatgrids(dgContratto).AutosizeColumnWidth();
            }
        }
Example #3
0
        //private void impostaCaption() {
        //    if (DS.incomeview == null) return;

        //    foreach (DataColumn C in DS.incomeview.Columns) {
        //        DS.incomeview.Columns[C.ColumnName].Caption = "";
        //    }
        //    //DS.incomeview.Columns["ymov"].Caption = "Eserc. Mov.";
        //    DS.incomeview.Columns["nmov"].Caption = "Num. Mov.";
        //    DS.incomeview.Columns["description"].Caption = "Descrizione";
        //    DS.incomeview.Columns["registry"].Caption = "Versante";
        //    DS.incomeview.Columns["curramount"].Caption = "Importo";
        //    //DS.incomeview.Columns["ypro"].Caption = "Eserc. Reversale";
        //    DS.incomeview.Columns["npro"].Caption = "Num. Reversale";
        //    DS.incomeview.Columns["idpro"].Caption = "Num. Operazione";
        //}

        private void fillProceedsView()
        {
            DS.proceedsview.Clear();

            //string q1 = " exists (select * from incomeview where"
            //    + QHS.AppAnd(
            //        QHS.CmpEq("proceedsview.ypro",QHS.Field("incomeview.ypro")),
            //        QHS.CmpEq("proceedsview.npro",QHS.Field("incomeview.npro")));
            //string q2 = " not exists (select * from banktransaction where"
            //    + QHS.AppAnd(
            //        QHS.CmpEq("banktransaction.ypro",QHS.Field("incomeview.ypro")),
            //        QHS.CmpEq("banktransaction.npro",QHS.Field("incomeview.npro")),
            //        QHS.CmpEq("banktransaction.idpro",QHS.Field("incomeview.idpro")),
            //        QHS.CmpEq("banktransaction.idinc",QHS.Field("incomeview.idinc)")));

            //string filtro = QHS.AppAnd(
            //    QHS.CmpEq("yproceedstransmission", meta.GetSys("esercizio")),
            //    q1, q2) + ")";

            string filtro = QHS.AppAnd(
                QHS.CmpEq("ypro", meta.GetSys("esercizio")),
                QHS.IsNotNull("yproceedstransmission"),
                QHS.NullOrEq("performed", 0));

            meta.Conn.RUN_SELECT_INTO_TABLE(DS.proceedsview, "ypro,npro", filtro, null, false);

            if (gridReversali.DataSource == null)
            {
                HelpForm.SetDataGrid(gridReversali, DS.proceedsview);
                new formatgrids(gridReversali).AutosizeColumnWidth();
            }
        }
Example #4
0
        void RiempiGrid()
        {
            string filterstock = QHS.IsNull("idinvkind");

            string sqlCmd = " SELECT * " +
                            " FROM ddt_inview " +
                            " WHERE " + filter +
                            " AND EXISTS (SELECT * FROM stock WHERE " +
                            " ddt_inview.idddt_in = stock.idddt_in AND " + filterstock + " ) " +
                            " ORDER BY ddt_inview.idddt_in asc ";

            DataTable ddt_in = Meta.Conn.SQLRunner(sqlCmd);

            if (ddt_in.Rows.Count != 0)
            {
                ddt_in.PrimaryKey = new DataColumn[] { ddt_in.Columns["idddt_in"] };
                //Ora ha messo in ddt_in tutto ciò che da DB risulta 'da fatturare'.
                if (ddt_in.Select().Length > 0)
                {
                    MetaData MAP;
                    MAP = Meta.Dispatcher.Get("ddt_inview");
                    MAP.DescribeColumns(ddt_in, "default");
                    DataSet D = new DataSet();
                    D.Tables.Add(ddt_in);
                    HelpForm.SetDataGrid(gridDettagli, ddt_in);
                    gridDettagli.TableStyles.Clear();
                    HelpForm.SetGridStyle(gridDettagli, ddt_in);
                    formatgrids format = new formatgrids(gridDettagli);
                    format.AutosizeColumnWidth();
                    HelpForm.SetAllowMultiSelection(ddt_in, true);
                    SelezionaTutto();
                }
            }
        }
Example #5
0
        private void Esegui()
        {
            string filterCedolini = QHS.AppAnd(QHS.CmpEq("ayear", esercizio),
                                               "((SELECT COUNT(*) FROM payroll " +
                                               " WHERE " + QHS.AppAnd(QHS.CmpEq("fiscalyear", esercizio), QHS.CmpEq("flagbalance", "S"),
                                                                      " (parasubcontractview.idcon = payroll.idcon)") +
                                               " = 0)");

            DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, DS.parasubcontractview, null, filterCedolini, null, false);

            if (DS.parasubcontractview.Rows.Count == 0)
            {
                return;
            }

            foreach (DataColumn C in DS.parasubcontractview.Columns)
            {
                C.Caption = "";
            }

            DS.parasubcontractview.Columns["ycon"].Caption     = "Esercizio";
            DS.parasubcontractview.Columns["ncon"].Caption     = "Numero";
            DS.parasubcontractview.Columns["registry"].Caption = "Percipiente";

            if (dgContratto.DataSource == null)
            {
                HelpForm.SetDataGrid(dgContratto, DS.parasubcontractview);
                new formatgrids(dgContratto).AutosizeColumnWidth();
            }
        }
Example #6
0
        void ShowPage(int NPasso)
        {
            btnBack.Enabled    = false;
            btnNext.Enabled    = false;
            btnRefresh.Enabled = false;
            labNrighe.Visible  = false;

            string   filter = query[NPasso];
            DataGrid dgr    = dgrid[NPasso];

            //Anagrafica= Conn.RUN_SELECT("registrymainview","*","title",filter,null,false);
            Cursor = Cursors.WaitCursor;
            Application.DoEvents();
            Anagrafica = Conn.SQLRunner("SELECT * FROM registrymainview WHERE " + filter + " ORDER BY TITLE", false, 0);
            Cursor     = Cursors.Default;
            DataSet DD = new DataSet("temp");

            DD.Tables.Add(Anagrafica);
            foreach (DataColumn CC in Anagrafica.Columns)
            {
                MetaData.DescribeAColumn(Anagrafica, CC.ColumnName, "", -1);
            }
            int pos = 1;

            MetaData.DescribeAColumn(Anagrafica, "idreg", "#", pos++);
            MetaData.DescribeAColumn(Anagrafica, "title", "Denominazione", pos++);
            MetaData.DescribeAColumn(Anagrafica, "cf", "C.F.", pos++);
            MetaData.DescribeAColumn(Anagrafica, "p_iva", "P.Iva", pos++);
            MetaData.DescribeAColumn(Anagrafica, "registryclass", "Tipologia", pos++);
            MetaData.DescribeAColumn(Anagrafica, "forename", "Nome", pos++);
            MetaData.DescribeAColumn(Anagrafica, "surname", "Cognome", pos++);
            dgr.DataBindings.Clear();
            dgr.DataSource = null;
            dgr.TableStyles.Clear();
            HelpForm.SetDataGrid(dgr, Anagrafica);

            formatgrids fg = new formatgrids(dgr);

            fg.AutosizeColumnWidth();
            ComboBox C = combo[NPasso];

            if (C != null)
            {
                C.SelectedIndex = 0;
            }

            btnRefresh.Visible = (NPasso > 0);
            btnBack.Enabled    = true;
            btnNext.Enabled    = true;
            btnRefresh.Enabled = true;
            if (Anagrafica.Rows.Count > 0)
            {
                labNrighe.Text = "Righe trovate: " + Anagrafica.Rows.Count;
            }
            else
            {
                labNrighe.Text = "Nessuna  riga trovata.";
            }
            labNrighe.Visible = true;
        }
Example #7
0
        private void fillExpenseView()
        {
            DS.expenseview.Clear();
            object esercizio = meta.GetSys("esercizio");

            string q1 = QHS.AppAnd(QHS.IsNotNull("idpay"), QHS.CmpEq("ayear", esercizio), QHS.CmpGe("curramount", 0));
            string q2 = " NOT EXISTS(SELECT * FROM banktransaction B WHERE ";

            q2 += QHS.AppAnd(QHS.CmpEq("B.idexp", QHS.Field("expenseview.idexp")),
                             QHS.CmpEq("B.kpay", QHS.Field("expenseview.kpay")),
                             QHS.CmpEq("B.idpay", QHS.Field("expenseview.idpay"))) + ")";
            q2 = QHS.DoPar(q2);

            string filtro = QHS.AppAnd(q1, q2)
//                + " and (select count(*) from expenseview e2 where e2.ypay=expenseview.ypay and e2.npay=expenseview.npay)>1"
                            +
                            " and exists (select * from paymentview where paymentview.kpay=expenseview.kpay and kpaymenttransmission is not null and isnull(notperformed,0) > 0)";

            meta.Conn.RUN_SELECT_INTO_TABLE(DS.expenseview, null, filtro, null, false);

            if (gridMandati.DataSource == null)
            {
                HelpForm.SetDataGrid(gridMandati, DS.expenseview);
                new formatgrids(gridMandati).AutosizeColumnWidth();
            }
        }
Example #8
0
        public FrmEntryPreSave(DataTable tEntry, DataAccess Conn, DataTable toPreScan)
        {
            InitializeComponent();
            this.tEntry   = tEntry;
            this.Conn     = Conn;
            QHS           = this.Conn.GetQueryHelper();
            QHC           = new CQueryHelper();
            tAccount      = DataAccess.CreateTableByName(Conn, "account", "idacc, codeacc, title");
            tAnagrafica   = DataAccess.CreateTableByName(Conn, "registry", "idreg, title");
            tUpb          = DataAccess.CreateTableByName(Conn, "upb", "idupb, codeupb");
            tSorting      = DataAccess.CreateTableByName(Conn, "sorting", "idsorkind, idsor,sortcode");
            tAccMotive    = DataAccess.CreateTableByName(Conn, "accmotive", "idaccmotive, codemotive, title");
            tExpenseSetup = DataAccess.CreateTableByName(Conn, "config", "ayear, idsortingkind1, idsortingkind2, idsortingkind3");
            string f = QHS.CmpEq("ayear", Conn.GetSys("esercizio"));

            DataAccess.RUN_SELECT_INTO_TABLE(Conn, tExpenseSetup, null, f, null, true);

            preScanAll(toPreScan);

            fillTempField();
            assegnaCaption();
            HelpForm.SetDataGrid(dgDettaglio, tEntry);

            ExcelMenu = new ContextMenu();
            ExcelMenu.MenuItems.Add("Excel", new EventHandler(Excel_Click));
        }
Example #9
0
        public FrmViewResult(MetaData Meta,
                             string cmd, string table, string listtype, string edittype)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.table    = table;
            this.listtype = listtype.Trim();
            this.edittype = edittype;
            Text          = "Elenco di problemi da risolvere";
            //Text = table + "." + listtype + "." + edittype;
            this.Meta = Meta;
            QHS       = Meta.Conn.GetQueryHelper();

            T = Meta.Conn.SQLRunner(cmd, false);
            if (T == null)
            {
                return;
            }

            DataSet DD = new DataSet("temp");

            ClearDataSet.RemoveConstraints(DD);
            DD.Tables.Add(T);
            HelpForm.SetDataGrid(dgrid, T);
            //dgrid.SetDataBinding(DD, T.TableName);

            formatgrids fg = new formatgrids(dgrid);

            fg.AutosizeColumnWidth();
        }
Example #10
0
 public FrmDettaglioRisultati(DataTable table)
 {
     InitializeComponent();
     HelpForm.SetDataGrid(dataGrid1, table);
     ExcelMenu = new ContextMenu();
     ExcelMenu.MenuItems.Add("Excel", new EventHandler(Excel_Click));
     dataGrid1.ContextMenu = ExcelMenu;
 }
Example #11
0
 private void ToGrid(DataTable T, string explanation)
 {
     //gridRisultati.DataSource = null;
     //gridRisultati.DataBindings.Clear();
     HelpForm.SetDataGrid(gridRisultati, T);
     tabControl1.SelectedTab = tabPageRisultati;
     labelRisultato.Text     = explanation;
 }
Example #12
0
 private void fillGrid()
 {
     HelpForm.SetDataGrid(dgInventory, dsPruned.Tables["inventory"]);
     HelpForm.SetDataGrid(dgAssetLoadMotive, dsPruned.Tables["assetloadmotive"]);
     HelpForm.SetDataGrid(dgAssetUnloadMotive, dsPruned.Tables["assetunloadmotive"]);
     HelpForm.SetDataGrid(dgAssetLoadKind, dsPruned.Tables["assetloadkind"]);
     HelpForm.SetDataGrid(dgAssetUnloadKind, dsPruned.Tables["assetunloadkind"]);
 }
Example #13
0
 public void VisualizzaOut(DataTable T1, DataTable T2)
 {
     DS.Tables.Add(T1);
     DS.Tables.Add(T2);
     dataGridOldSP.DataSource = null;
     dataGridNewSP.DataSource = null;
     HelpForm.SetDataGrid(dataGridOldSP, T1);
     HelpForm.SetDataGrid(dataGridNewSP, T2);
 }
Example #14
0
 public frmErrori(DataTable t)
 {
     InitializeComponent();
     HelpForm.SetDataGrid(gridErrori, t);
     ExcelMenu = new ContextMenu();
     ExcelMenu.MenuItems.Add("Excel", new EventHandler(Excel_Click));
     gridErrori.ContextMenu = ExcelMenu;
     this.Text = "Errori riscontrati nella generazione del Record G";
 }
Example #15
0
 public SubF24(DataTable t)
 {
     InitializeComponent();
     HelpForm.SetDataGrid(gridErrori, t);
     ExcelMenu = new ContextMenu();
     ExcelMenu.MenuItems.Add("Excel", new EventHandler(Excel_Click));
     gridErrori.ContextMenu = ExcelMenu;
     this.Text = "Controlli Modello F24 EP ";
 }
Example #16
0
        public FrmViewError(DataSet DS)
        {
            InitializeComponent();
            this.DS = DS;
            DataTable T = DS.Tables[0];

            btnSave.Enabled      = (T.Rows.Count > 0);
            T.Columns[0].Caption = "Errore";
            HelpForm.SetDataGrid(gridCheck, T);
        }
Example #17
0
        private void visualizzaXml()
        {
            DirectoryInfo di = new DirectoryInfo(txtDirectory.Text);

            dsEmens.Emens.Clear();

            foreach (FileInfo fi in di.GetFiles())
            {
                XmlDocument document = new XmlDocument();
                try{
                    document.Load(fi.FullName);
                }
                catch (XmlException ex) {
                    MessageBox.Show(this, "Impossibile aprire il file Xml specificato.\n" + ex.Message);
                    return;
                }

                XmlElement DenunceRetributiveMensili = document.DocumentElement;
                XmlElement DatiMittente = DenunceRetributiveMensili["DatiMittente"];
                foreach (XmlElement Azienda in DenunceRetributiveMensili.GetElementsByTagName("Azienda"))
                {
                    string     filtroEsercizio    = "(ayear=" + Azienda["AnnoMeseDenuncia"].InnerText.Substring(0, 4) + ")";
                    XmlElement ListaCollaboratori = Azienda["ListaCollaboratori"];
                    foreach (XmlElement Collaboratore in ListaCollaboratori.GetElementsByTagName("Collaboratore"))
                    {
                        DataRow rEmens = dsEmens.Emens.NewRow();
                        rEmens["CFAzienda"]        = valore(Azienda["CFAzienda"]);
                        rEmens["AnnoMeseDenuncia"] = mese(Azienda["AnnoMeseDenuncia"]);
                        rEmens["CFCollaboratore"]  = valore(Collaboratore["CFCollaboratore"]);
                        rEmens["Cognome"]          = valore(Collaboratore["Cognome"]);
                        rEmens["Nome"]             = valore(Collaboratore["Nome"]);
                        rEmens["CodiceComune"]     = valore(Collaboratore["CodiceComune"]);
                        rEmens["TipoRapporto"]     = decodifica(Collaboratore["TipoRapporto"], dsEmens.emenscontractkind, filtroEsercizio,
                                                                "idemenscontractkind", "description");
                        rEmens["CodiceAttivita"] = decodifica(Collaboratore["CodiceAttivita"], dsEmens.inpsactivity, filtroEsercizio,
                                                              "activitycode", "description");
                        rEmens["Imponibile"] = valuta(Collaboratore["Imponibile"]);
                        rEmens["Aliquota"]   = percentuale(Collaboratore["Aliquota"]);
                        rEmens["AltraAss"]   = decodifica(Collaboratore["AltraAss"], dsEmens.otherinsurance, filtroEsercizio,
                                                          "idotherinsurance", "description");
                        rEmens["Dal"]               = giorno(Collaboratore["Dal"]);
                        rEmens["Al"]                = giorno(Collaboratore["Al"]);
                        rEmens["CodCalamita"]       = valore(Collaboratore["CodCalamita"]);
                        rEmens["CodCertificazione"] = valore(Collaboratore["CodCertificazione"]);
                        rEmens["nomefile"]          = fi.FullName;
                        dsEmens.Emens.Rows.Add(rEmens);
                    }
                }
            }

            HelpForm.SetDataGrid(gridFile, dsEmens.Emens);
            new formatgrids(gridFile).AutosizeColumnWidth();
        }
Example #18
0
        public FrmViewError(ImportErrorList Err)
        {
            InitializeComponent();
            this.DS = new DataSet("a");
            DataTable T = new DataTable("aa");

            T.Columns.Add("tipo", typeof(string));
            T.Columns.Add("messaggio", typeof(string));

            btnSave.Enabled      = (T.Rows.Count > 0);
            T.Columns[0].Caption = "Errore";
            HelpForm.SetDataGrid(gridCheck, T);
        }
Example #19
0
        public FrmError(DataTable tErrorLiq, DataTable tErrorFin, object taxpaykind)
        {
            InitializeComponent();

            this.taxpaykind = taxpaykind;

            tErrorLiq.Columns["nrow"].Caption        = "";
            tErrorLiq.Columns["description"].Caption = "Descrizione Errore";

            tErrorFin.Columns["nrow"].Caption        = "";
            tErrorFin.Columns["description"].Caption = "Descrizione Errore";

            DataSet dsApp = new DataSet();

            if (tErrorLiq.DataSet == null)
            {
                dsApp.Tables.Add(tErrorLiq);
            }

            if (tErrorFin.DataSet == null)
            {
                dsApp.Tables.Add(tErrorFin);
            }

            string modello = (taxpaykind.ToString().ToUpper() == "I")
                ? "F24" : "F24EP";

            string campi = (taxpaykind.ToString().ToUpper() == "I")
                ? "(Codice Ritenuta)" : "(Codice Tributo, Anno Fiscale, Mese Riferimento, Comune (ove presente), Regione Fiscale (ove presente))";

            string msgLiquidazione = "Vengono visualizzati i dettagli precedentemente selezionati che raggruppati secondo " +
                                     "i seguenti criteri " + campi + " stabiliti dalla legge nella produzione del modello " + modello +
                                     " darebbero vita a dei rimborsi, mentre tale modello non li prevede";

            lblLiq.Text = msgLiquidazione;

            string msgFinanziario = "Vengono visualizzati i dettagli precedentemente selezionati che raggruppati secondo " +
                                    "i seguenti criteri (Codice Bilancio, Codice U.P.B., Responsabile, Ente Percipiente) " +
                                    " darebbero vita a movimenti di spesa NEGATIVI";

            lblFin.Text = msgFinanziario;

            HelpForm.SetDataGrid(dataGrid1, tErrorLiq);
            HelpForm.SetDataGrid(dataGrid2, tErrorFin);

            ExcelMenu = new ContextMenu();
            ExcelMenu.MenuItems.Add("Excel", new EventHandler(Excel_Click));

            dataGrid1.ContextMenu = ExcelMenu;
            dataGrid2.ContextMenu = ExcelMenu;
        }
Example #20
0
        public frmSpesaAutomatismi(
            MetaData Parent,
            string filterspesa, string filterentrata, string filtervarspesa)
        {
            InitializeComponent();
            this.Meta = Parent;
            string filteresercizio = "(esercizio='" + Meta.GetSys("esercizio") + "')";

            ClearDataSet.RemoveConstraints(DS);
            if (filterspesa != null)
            {
                filterspesa = GetData.MergeFilters("(" + filterspesa + ")", filteresercizio);
                DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, DS.expenseview, null, filterspesa, null, true);
            }
            if (filterentrata != null)
            {
                filterentrata = GetData.MergeFilters("(" + filterentrata + ")", filteresercizio);
                DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, DS.incomeview, null, filterentrata, null, true);
            }
            if (filtervarspesa != null)
            {
                DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, DS.expensevarview, null, filtervarspesa, null, true);
            }

            MetaData MSpesaView = Meta.Dispatcher.Get("spesaview");

            MSpesaView.DescribeColumns(DS.expenseview, "autospesa");
            HelpForm.SetDataGrid(gridSpesa, DS.expenseview);
            formatgrids FGSpesa = new formatgrids(gridSpesa);

            FGSpesa.AutosizeColumnWidth();

            MetaData MEntrataView = Meta.Dispatcher.Get("entrataview");

            MEntrataView.DescribeColumns(DS.incomeview, "autospesa");
            HelpForm.SetDataGrid(gridEntrata, DS.incomeview);
            formatgrids FGEntrata = new formatgrids(gridEntrata);

            FGEntrata.AutosizeColumnWidth();

            MetaData MVarSpesaView = Meta.Dispatcher.Get("variazionespesaview");

            MVarSpesaView.DescribeColumns(DS.expensevarview, "autospesa");
            HelpForm.SetDataGrid(gridVarSpesa, DS.expensevarview);
            formatgrids FGVarSpesa = new formatgrids(gridVarSpesa);

            FGVarSpesa.AutosizeColumnWidth();

            HideEmpties();
        }
Example #21
0
 public FrmDettaglioRisultati(DataTable table)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     HelpForm.SetDataGrid(dataGrid1, table);
     ExcelMenu = new ContextMenu();
     ExcelMenu.MenuItems.Add("Excel", new EventHandler(Excel_Click));
     dataGrid1.ContextMenu = ExcelMenu;
     //
     // TODO: Add any constructor code after InitializeComponent call
     //
 }
Example #22
0
        public FrmError(DataTable tError)
        {
            InitializeComponent();
            DataSet dsApp = new DataSet();

            if (tError.DataSet == null)
            {
                dsApp.Tables.Add(tError);
            }
            HelpForm.SetDataGrid(dataGrid1, tError);
            ExcelMenu = new ContextMenu();
            ExcelMenu.MenuItems.Add("Excel", new EventHandler(Excel_Click));
            dataGrid1.ContextMenu = ExcelMenu;
        }
Example #23
0
        void AggiornaGridDettagliFattura()
        {
            DS.invoicedetail.Clear();
            DetailsToUpdate.Clear();
            if (cmbCausale.SelectedIndex < 0)
            {
                return;
            }
            int causale = CfgFn.GetNoNullInt32(cmbCausale.SelectedValue);

            if (causale == 0)
            {
                return;
            }
            string filtercausale = QHC.CmpEq("idtipo", causale);

            if (DS.invoice.Rows.Count == 0)
            {
                return;
            }

            DataRow M             = DS.invoice.Rows[0];
            string  filterinvoice = QHS.AppAnd(QHS.CmpEq("idinvkind", M["idinvkind"]), QHS.CmpEq("yinv", M["yinv"]),
                                               QHS.CmpEq("ninv", M["ninv"]));

            string filterinvoicedetail = filterinvoice;

            filterinvoicedetail = QHS.AppAnd(filterinvoicedetail, QHS.IsNull("idexp_iva"), QHS.IsNull("idexp_taxable"));

            DSCopy = DS.Copy();

            DataAccess.RUN_SELECT_INTO_TABLE(Conn, DSCopy.Tables["invoicedetail"], null, filterinvoicedetail, null, false);
            Conn.DeleteAllUnselectable(DSCopy.Tables["invoicedetail"]);

            MetaData MD = MetaData.GetMetaData(this, "invoicedetail");

            MD.DS = DSCopy;
            MD.DescribeColumns(DSCopy.Tables["invoicedetail"], "wizardiva");
            GetData GD = new GetData();

            GD.InitClass(DSCopy, Conn, "invoicedetail");
            GD.GetTemporaryValues(DSCopy.Tables["invoicedetail"]);
            gridDetails.DataSource = null;
            HelpForm.SetDataGrid(gridDetails, DSCopy.Tables["invoicedetail"]);
            btnSelectAllDetail_Click(null, null);

            VisualizzaUPB();
            RecalcTotalDetails();
        }
Example #24
0
        public FrmNotable_SelezionaAggiungiAnagrafica(DataTable DT, DataRow RegistryFromInputFile, int RowNumberInInputFile)
        {
            InitializeComponent();
            lblMessage.Text  = "Attenzione. L'anagrafica presente nel file di input alla linea " + RowNumberInInputFile.ToString() + " presenta dei sinonimi\n";
            lblMessage.Text += "Cliccando sul pulsante 'Crea' verrà creata una nuova anagrafica con i seguenti dettagli:";
            DataSet myDS = new DataSet();

            myDS.Tables.Add(DT);

            lblGridAction.Text        = "In alternativa è possibile selezionare una delle anagrafiche mostrate nella griglia e cliccare su 'Seleziona'";
            Anagrafiche               = DT;
            txtCognome.Text           = RegistryFromInputFile["surname"].ToString();
            txtCognome.ReadOnly       = true;
            txtNome.Text              = RegistryFromInputFile["forename"].ToString();
            txtNome.ReadOnly          = true;
            txtDenominazione.Text     = RegistryFromInputFile["title"].ToString();
            txtDenominazione.ReadOnly = true;
            txtCF.Text              = RegistryFromInputFile["cf"].ToString();
            txtCF.ReadOnly          = true;
            txtCFExt.Text           = RegistryFromInputFile["foreigncf"].ToString();
            txtCFExt.ReadOnly       = true;
            txtPIva.Text            = RegistryFromInputFile["p_iva"].ToString();
            txtPIva.ReadOnly        = true;
            txtLocalita.Text        = RegistryFromInputFile["location"].ToString();
            txtLocalita.ReadOnly    = true;
            txtDataNascita.Text     = RegistryFromInputFile["birthdate"].ToString();
            txtDataNascita.ReadOnly = true;

            if (RegistryFromInputFile["gender"].ToString().Trim() == "M")
            {
                rdbM.Checked = true;
            }
            else
            {
                rdbF.Checked = true;
            }

            rdbF.Enabled = false;
            rdbM.Enabled = false;
            HelpForm.SetDataGrid(DetailGrid, DT);
            new formatgrids(DetailGrid).AutosizeColumnWidth();

/*
 *          DetailGrid.DataSource = myDS;
 *
 *
 *          DetailGrid.DataMember = "registry";
 */
        }
Example #25
0
 public FrmError(DataTable tError)
 {
     InitializeComponent();
     if (tError.DataSet == null)
     {
         DataSet ds = new DataSet();
         ds.Tables.Add(tError);
         HelpForm.SetDataGrid(dgError, ds.Tables[0]);
     }
     else
     {
         HelpForm.SetDataGrid(dgError, tError);
     }
     this.tError = tError;
 }
Example #26
0
        public FrmError(string title, DataTable t)
        {
            InitializeComponent();
            DataSet dsApp = new DataSet();

            if (t.DataSet == null)
            {
                dsApp.Tables.Add(t);
            }
            HelpForm.SetDataGrid(dataGrid1, t);
            ExcelMenu = new ContextMenu();
            ExcelMenu.MenuItems.Add("Excel", new EventHandler(Excel_Click));
            dataGrid1.ContextMenu = ExcelMenu;
            this.Text             = title;
        }
Example #27
0
        void FillTableAssegnazioni(DataRow ParentEntrataRow, DataTable Automatismi)
        {
            foreach (DataRow R in Automatismi.Rows)
            {
                AddVociCollegate(R);
                AddRowToTableAssegnazioni(ParentEntrataRow, R, DS.proceedspart);
            }
            Meta.DescribeColumns(DS.proceedspart, "assegnautomatica");

            HelpForm.SetDataGrid(dgrAssegnazione, DS.proceedspart);

            formatgrids FGAssegnazione = new formatgrids(dgrAssegnazione);

            FGAssegnazione.AutosizeColumnWidth();
        }
Example #28
0
        void SetDataGrid(DataGrid G, string table, string listtype)
        {
            MetaData M = Dispatcher.Get(table);

            if (listtype == null)
            {
                listtype = M.DefaultListType;
            }
            if (listtype == null)
            {
                listtype = "default";
            }
            M.DescribeColumns(DS.Tables[table], listtype);
            HelpForm.SetAllowMultiSelection(DS.Tables[table], true);
            HelpForm.SetDataGrid(G, DS.Tables[table]);
        }
Example #29
0
        bool CustomChangeTab(int oldTab, int newTab)
        {
            if (oldTab == 0)
            {
                try {
                    DataSet Out = Conn.CallSP("closeyear_assetgrant",
                                              new Object[4] {
                        Meta.GetSys("esercizio"),
                        DBNull.Value,             // idasset
                        DBNull.Value,             // idpiece
                        "V"
                    }
                                              );

                    if (Out == null || Out.Tables.Count == 0)
                    {
                        MessageBox.Show(this, "Procedura terminata con errore", "Errore");
                        return(false);
                    }
                    Out.Tables[0].TableName = "Cespiti ammortizzati";
                    HelpForm.SetDataGrid(gridRisultati, Out.Tables[0]);
                    if (Out.Tables[0].Rows.Count == 0)
                    {
                        btnCreaRisconti.Visible = false;
                        lblRiepilogo.Text       = "Non Saranno Generati Risconti per i Cespiti ammortizzati nell'esercizio corrente";
                    }
                    else
                    {
                        btnCreaRisconti.Visible = true;
                        lblRiepilogo.Text       = "Saranno Generati i seguenti Risconti per i Cespiti ammortizzati nell'esercizio corrente";
                    }
                }
                catch (Exception E) {
                    MessageBox.Show(E.Message);
                    return(false);
                }


                return(CheckStandard()); // 0->1: nothing to do
            }
            if ((oldTab == 1) && (newTab == 0))
            {
                return(true);                                //1->0:nothing to do!
            }
            return(true);
        }
Example #30
0
        private void Esegui()
        {
            DataSet   DSrit = new DataSet();
            DataTable T     = new DataTable("ritenutedapagare");

            DSrit.Tables.Add(T);
            T.Columns.Add("codice", typeof(string));
            T.Columns[0].Caption = "Codice ritenuta";
            T.Columns.Add("descrizione", typeof(string));
            T.Columns[1].Caption = "Descrizione";
            string   filter_auto = "";
            DateTime Datainizio, Datafine;

            foreach (DataRow R in DS.tax.Rows)
            {
                filter_auto = QHC.AppAnd(QHC.CmpEq("taxcode", R["taxcode"]), filter_eserc);
                DataRow[] Rauto = DS.taxsetup.Select(filter_auto);
                if (Rauto.Length == 0)
                {
                    continue;
                }
                if (!ControllaConfRitenuta(Rauto[0]))
                {
                    continue;
                }
                Datainizio = new DateTime(1, 1, 1);
                Datafine   = new DateTime(1, 1, 1);
                CalcolaDateDaPeriodo(Rauto[0], out Datainizio, out Datafine);
                if (!CallStoredProcedure(R["taxcode"], Datafine))
                {
                    continue;
                }
                DataRow Rrit = T.NewRow();
                Rrit["codice"]      = R["taxref"];
                Rrit["descrizione"] = R["description"];
                T.Rows.Add(Rrit);
            }

            if (T == null || T.Rows.Count == 0)
            {
                MessageBox.Show("Non ci sono ritenute da pagare", "Informazioni",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            HelpForm.SetDataGrid(gridRitenuta, T);
        }