Beispiel #1
0
        public FrmWizardScegliDettagliContratto(MetaData Meta, DataTable Flussocreditidetail)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            this.Meta = Meta;
            this.Conn = Meta.Conn;
            QHC       = new CQueryHelper();
            QHS       = Conn.GetQueryHelper();

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

            estimatekind = Conn.CreateTableByName("estimatekind", "*", false);
            DataSet D = new DataSet();

            D.Tables.Add(estimatekind);
            GetData.MarkToAddBlankRow(estimatekind);
            GetData.Add_Blank_Row(estimatekind);
            Conn.RUN_SELECT_INTO_TABLE(estimatekind, "description",
                                       QHS.AppAnd(QHS.CmpEq("active", "S"), QHS.CmpEq("linktoinvoice", "S")), null, true);
            cmbTipocontrattoattivo.DataSource    = estimatekind;
            cmbTipocontrattoattivo.ValueMember   = "idestimkind";
            cmbTipocontrattoattivo.DisplayMember = "description";

            FormInit();
        }
Beispiel #2
0
        public void MetaData_AfterLink()
        {
            Meta = MetaData.GetMetaData(this);
            Conn = Meta.Conn;
            QHC  = new CQueryHelper();
            QHS  = Meta.Conn.GetQueryHelper();

            GetData.CacheTable(DS.expensephase, QHS.AppAnd(QHS.CmpNe("nphase", Meta.GetSys("maxexpensephase")),
                                                           QHS.CmpGe("nphase", Meta.GetSys("expensefinphase")), QHS.CmpLt("nphase", Meta.GetSys("expenseregphase"))), "nphase", true);
            PostData.MarkAsTemporaryTable(DS.fase_epexp, false);
            GetData.MarkToAddBlankRow(DS.fase_epexp);
            GetData.Add_Blank_Row(DS.fase_epexp);
            EnableFaseImpegnoBudget(1, "Preimpegno di Budget");
            //EnableFaseImpegnoBudget(2, "Impegno di Budget");
            string filterSiope = QHS.CmpEq("codesorkind", Meta.GetSys("codesorkind_siopespese"));

            DataTable tSortingkind = Meta.Conn.RUN_SELECT("sortingkind", "*", null, filterSiope, null, null, true);

            if ((tSortingkind != null) && (tSortingkind.Rows.Count > 0))
            {
                DataRow R              = tSortingkind.Rows[0];
                object  idsorkind      = R["idsorkind"];
                object  idsorkind_main = R["idsorkind"];
                SetGBoxClass(idsorkind);
            }

            int    esercizioCurr = (int)Meta.GetSys("esercizio");
            string filter        = QHS.CmpEq("ayear", esercizioCurr);

            GetData.SetStaticFilter(DS.fin, QHS.AppAnd(filter, QHS.BitSet("flag", 0)));
            GetData.SetStaticFilter(DS.account, QHS.AppAnd(filter));
        }
Beispiel #3
0
        public WizSostituisciDettaglio(DataRow rContratto, DataAccess Conn, MetaDataDispatcher Disp)
        {
            this.rContratto = rContratto;
            this.Conn       = Conn;
            this.Disp       = Disp;
            QHC             = new CQueryHelper();
            QHS             = Conn.GetQueryHelper();
            InitializeComponent();
            tOldIvaKind = DataAccess.CreateTableByName(Conn, "ivakind", "*");
            GetData.MarkToAddBlankRow(tOldIvaKind);
            GetData.Add_Blank_Row(tOldIvaKind);
            DataAccess.RUN_SELECT_INTO_TABLE(Conn, tOldIvaKind, "description", null, null, true);
            cmbOldTipoIva.DataSource    = tOldIvaKind;
            cmbOldTipoIva.DisplayMember = "description";
            cmbOldTipoIva.ValueMember   = "idivakind";

            tNewIvaKind = DataAccess.CreateTableByName(Conn, "ivakind", "*");
            GetData.MarkToAddBlankRow(tNewIvaKind);
            GetData.Add_Blank_Row(tNewIvaKind);
            DataAccess.RUN_SELECT_INTO_TABLE(Conn, tNewIvaKind, "description", null, null, true);
            cmbNewTipoIva.DataSource    = tNewIvaKind;
            cmbNewTipoIva.DisplayMember = "description";
            cmbNewTipoIva.ValueMember   = "idivakind";

            tassoCambio = CfgFn.GetNoNullDouble(rContratto["exchangerate"]);
        }
Beispiel #4
0
        public FrmWizardScegliDettagli(MetaData Meta, object idstore, string filterstore,
                                       DataTable Storeunloaddetail)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            this.Meta              = Meta;
            this.Conn              = Meta.Conn;
            this.filterstore       = filterstore;
            this.Storeunloaddetail = Storeunloaddetail;
            this.idstore           = idstore;
            QHC = new CQueryHelper();
            QHS = Meta.Conn.GetQueryHelper();

            manager = Conn.CreateTableByName("manager", "*", false);
            GetData.MarkToAddBlankRow(manager);
            GetData.Add_Blank_Row(manager);
            Conn.RUN_SELECT_INTO_TABLE(manager, null, null, null, true);
            MetaManager = Disp.Get("manager");
            SetDataSourceCmb();

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

            FormInit();
        }
Beispiel #5
0
        public void MetaData_AfterLink()
        {
            Meta = MetaData.GetMetaData(this);
            Conn = Meta.Conn;
            QHC  = new CQueryHelper();
            QHS  = Conn.GetQueryHelper();
            string filtereserc = QHS.CmpEq("ayear", Meta.GetSys("esercizio"));
            string filter      = QHS.NullOrEq("flagdalia", "S");

            GetData.SetStaticFilter(DS.service, filter);
            //GetData.CacheTable(DS.service);

            GetData.MarkToAddBlankRow(DS.service);
            GetData.Add_Blank_Row(DS.service);

            string filterActive = QHS.DoPar(QHS.AppOr(QHS.NullOrEq("active", 'S'), QHS.CmpEq("active", "")));
            string filterI      = QHS.DoPar(QHS.AppOr(QHS.DoPar(QHS.AppAnd(QHS.NullOrLe("start", Meta.GetSys("esercizio")),
                                                                           QHS.NullOrGe("stop", Meta.GetSys("esercizio")), filterActive)), QHS.CmpEq("idsorkind", 0)));

            QueryCreator.SetFilterForInsert(DS.sortingapplicabilityview, filterI);

            string filterI_SK = QHS.DoPar(QHS.AppOr(QHS.DoPar(QHS.AppAnd(QHS.NullOrLe("start", Meta.GetSys("esercizio")),
                                                                         QHS.NullOrGe("stop", Meta.GetSys("esercizio")), filterActive)), QHS.CmpEq("idsorkind", 0)));

            QueryCreator.SetFilterForInsert(DS.sortingkind, filterI_SK);
        }
Beispiel #6
0
        public void DisplayMember_Accertamento(string filter)
        {
            if (Meta.IsEmpty)
            {
                return;
            }
            DS.admpay_assessmentview.Clear();
            GetData.MarkToAddBlankRow(DS.admpay_assessmentview);
            GetData.Add_Blank_Row(DS.admpay_assessmentview);
            cmbAccertamento.DataSource = null;

            DataAccess.RUN_SELECT_INTO_TABLE(Meta.Conn, DS.admpay_assessmentview, null, filter, null, true);// da commentare
            cmbAccertamento.DataSource    = DS.admpay_assessmentview;
            cmbAccertamento.DisplayMember = "!nassessment_description";
            cmbAccertamento.ValueMember   = "nassessment";
            cmbAccertamento.SelectedIndex = -1;
            foreach (DataRow R in DS.admpay_assessmentview.Rows)
            {
                if (CfgFn.GetNoNullInt32(R["nassessment"]) == 0)
                {
                    R["!nassessment_description"] = DBNull.Value;
                }
                else
                {
                    R["!nassessment_description"] = R["nassessment"].ToString() + " - " + R["description"].ToString();
                }
            }
            DS.admpay_assessmentview.AcceptChanges();
        }
Beispiel #7
0
        void FormInit()
        {
            CustomTitle = "Rivalutazioni Cespiti";
            tabController.HideTabsMode =
                Crownwood.Magic.Controls.TabControl.HideTabsModes.HideAlways;

            DataTable Manager = Conn.CreateTableByName("manager", "*");

            GetData.MarkToAddBlankRow(Manager);
            GetData.Add_Blank_Row(Manager);
            DataAccess.RUN_SELECT_INTO_TABLE(Conn, Manager, "title asc", null, null, true);
            cboResponsabile.DataSource    = Manager;
            cboResponsabile.DisplayMember = "title";
            cboResponsabile.ValueMember   = "idman";

            DataTable Inventory = Conn.CreateTableByName("inventory", "*");

            GetData.MarkToAddBlankRow(Inventory);
            GetData.Add_Blank_Row(Inventory);
            DataAccess.RUN_SELECT_INTO_TABLE(Conn, Inventory, "description asc", "(active='S')", null, true);
            cmbInventario.DataSource    = Inventory;
            cmbInventario.DisplayMember = "description";
            cmbInventario.ValueMember   = "idinventory";
            if (CodInv != null && CodInv != DBNull.Value)
            {
                cmbInventario.SelectedValue = CodInv;
                cmbInventario.Enabled       = false;
            }
            //Selects first tab
            DisplayTabs(0);
        }
Beispiel #8
0
        public FrmAskInfoStore(MetaDataDispatcher Disp, DataRow RInvDet, DataRow RList)
        {
            InitializeComponent();

            this.Disp = Disp;
            this.Conn = Disp.Conn;

            QHC = new CQueryHelper();
            QHS = Conn.GetQueryHelper();

            MetaStore = Disp.Get("store");

            store = Conn.CreateTableByName("store", "*", false);
            DataSet D = new DataSet();

            D.Tables.Add(store);
            GetData.MarkToAddBlankRow(store);
            GetData.Add_Blank_Row(store);
            Conn.RUN_SELECT_INTO_TABLE(store, "description", QHS.CmpEq("active", "S"), null, true);
            cmbMagazzino.DataSource    = store;
            cmbMagazzino.ValueMember   = "idstore";
            cmbMagazzino.DisplayMember = "description";
            if (RInvDet["idinvkind"] != DBNull.Value)
            {
                RiempiControlli(RInvDet, RList);
            }
        }
Beispiel #9
0
        public WizRimpiazzaPerProrata(DataRow rContratto, DataAccess Conn, MetaDataDispatcher Disp)
        {
            this.rContratto = rContratto;
            this.Conn       = Conn;
            this.Disp       = Disp;
            QHC             = new CQueryHelper();
            QHS             = Conn.GetQueryHelper();
            InitializeComponent();
            tOldIvaKind = DataAccess.CreateTableByName(Conn, "ivakind", "*");
            GetData.MarkToAddBlankRow(tOldIvaKind);
            GetData.Add_Blank_Row(tOldIvaKind);
            DataAccess.RUN_SELECT_INTO_TABLE(Conn, tOldIvaKind, "description", null, null, true);
            cmbOldTipoIva.DataSource    = tOldIvaKind;
            cmbOldTipoIva.DisplayMember = "description";
            cmbOldTipoIva.ValueMember   = "idivakind";

            tNewIvaKind = DataAccess.CreateTableByName(Conn, "ivakind", "*");
            GetData.MarkToAddBlankRow(tNewIvaKind);
            GetData.Add_Blank_Row(tNewIvaKind);
            DataAccess.RUN_SELECT_INTO_TABLE(Conn, tNewIvaKind, "description", QHS.NullOrEq("active", "S"), null, true);
            cmbNewTipoIva.DataSource    = tNewIvaKind;
            cmbNewTipoIva.DisplayMember = "description";
            cmbNewTipoIva.ValueMember   = "idivakind";

            tOldUnitaMisuraAcquisto = DataAccess.CreateTableByName(Conn, "package", "*");
            GetData.MarkToAddBlankRow(tOldUnitaMisuraAcquisto);
            GetData.Add_Blank_Row(tOldUnitaMisuraAcquisto);
            DataAccess.RUN_SELECT_INTO_TABLE(Conn, tOldUnitaMisuraAcquisto, "description", null, null, true);
            cmbOldUnitaMisuraAcquisto.DataSource    = tOldUnitaMisuraAcquisto;
            cmbOldUnitaMisuraAcquisto.DisplayMember = "description";
            cmbOldUnitaMisuraAcquisto.ValueMember   = "idpackage";

            tNewUnitaMisuraAcquisto = DataAccess.CreateTableByName(Conn, "package", "*");
            GetData.MarkToAddBlankRow(tNewUnitaMisuraAcquisto);
            GetData.Add_Blank_Row(tNewUnitaMisuraAcquisto);
            DataAccess.RUN_SELECT_INTO_TABLE(Conn, tNewUnitaMisuraAcquisto, "description", null, null, true);
            cmbNewUnitaMisuraAcquisto.DataSource    = tNewUnitaMisuraAcquisto;
            cmbNewUnitaMisuraAcquisto.DisplayMember = "description";
            cmbNewUnitaMisuraAcquisto.ValueMember   = "idpackage";

            tOldUnitaMisuraCS = DataAccess.CreateTableByName(Conn, "unit", "*");
            GetData.MarkToAddBlankRow(tOldUnitaMisuraCS);
            GetData.Add_Blank_Row(tOldUnitaMisuraCS);
            DataAccess.RUN_SELECT_INTO_TABLE(Conn, tOldUnitaMisuraCS, "description", null, null, true);
            cmbOldUnitaMisuraCS.DataSource    = tOldUnitaMisuraCS;
            cmbOldUnitaMisuraCS.DisplayMember = "description";
            cmbOldUnitaMisuraCS.ValueMember   = "idunit";

            tNewUnitaMisuraCS = DataAccess.CreateTableByName(Conn, "unit", "*");
            GetData.MarkToAddBlankRow(tNewUnitaMisuraCS);
            GetData.Add_Blank_Row(tNewUnitaMisuraCS);
            DataAccess.RUN_SELECT_INTO_TABLE(Conn, tNewUnitaMisuraCS, "description", null, null, true);
            cmbNewUnitaMisuraCS.DataSource    = tNewUnitaMisuraCS;
            cmbNewUnitaMisuraCS.DisplayMember = "description";
            cmbNewUnitaMisuraCS.ValueMember   = "idunit";


            tassoCambio = CfgFn.GetNoNullDouble(rContratto["exchangerate"]);
        }
Beispiel #10
0
        public FrmAskBilancio(object upbParent, object finParent, decimal importoLiquidazione,
                              MetaDataDispatcher Disp, DataAccess Conn)
        {
            InitializeComponent();
            QHC = new CQueryHelper();
            QHS = Conn.GetQueryHelper();

            this.upbParent = upbParent;
            this.finParent = finParent;
            this.Disp      = Disp;
            this.Conn      = Conn;
            this.importo   = importoLiquidazione;

            MetaUpb = Disp.Get("upb");
            Meta    = Disp.Get("finview");

            finview = DataAccess.CreateTableByName(Conn, "finview", "*");
            upb     = DataAccess.CreateTableByName(Conn, "upb", "*");
            GetData.MarkToAddBlankRow(upb);
            GetData.Add_Blank_Row(upb);
            DataAccess.RUN_SELECT_INTO_TABLE(Conn, upb, null, null, null, true);

            cmbUpb.DataSource    = upb;
            cmbUpb.ValueMember   = "idupb";
            cmbUpb.DisplayMember = "codeupb";

            if (upbParent != DBNull.Value)
            {
                string  filterUpb = QHC.CmpEq("idupb", upbParent);
                DataRow UPBRow    = upb.Select(filterUpb)[0];
                txtDescrizioneUpb.Text = UPBRow["title"].ToString();
                HelpForm.SetComboBoxValue(cmbUpb, upbParent);

                if (finParent != DBNull.Value)
                {
                    string filterFinView = QHS.AppAnd(QHS.CmpEq("idfin", finParent), QHS.CmpEq("idupb", upbParent));
                    DataAccess.RUN_SELECT_INTO_TABLE(Conn, finview, null, filterFinView, null, true);

                    if (finview.Rows.Count > 0)
                    {
                        DataRow finRow = finview.Rows[0];
                        txtCodiceBilancio.Text        = finRow["codefin"].ToString();
                        txtDenominazioneBilancio.Text = finRow["title"].ToString();
                    }
                }
            }

            responsabile = DataAccess.CreateTableByName(Meta.Conn, "manager", "*");
            GetData.MarkToAddBlankRow(responsabile);
            GetData.Add_Blank_Row(responsabile);
            DataAccess.RUN_SELECT_INTO_TABLE(Conn, responsabile, null, null, null, true);

            cmbResponsabile.DataSource    = responsabile;
            cmbResponsabile.ValueMember   = "idman";
            cmbResponsabile.DisplayMember = "title";

            Selected = null;
        }
Beispiel #11
0
        void FormInit()
        {
            DataTable Invoicekind = Conn.CreateTableByName("invoicekind", "*");

            GetData.MarkToAddBlankRow(Invoicekind);
            GetData.Add_Blank_Row(Invoicekind);
            DataAccess.RUN_SELECT_INTO_TABLE(Conn, Invoicekind, "description asc", QHS.AppAnd(QHS.BitClear("flag", 0), QHS.BitClear("flag", 2)), null, true);
            cmbInv.DataSource    = Invoicekind;
            cmbInv.DisplayMember = "description";
            cmbInv.ValueMember   = "idinvkind";
        }
Beispiel #12
0
        void FillFileFormatTmpTable()
        {
            GetData.MarkToAddBlankRow(DS.tmp_fileformat);
            GetData.Add_Blank_Row(DS.tmp_fileformat);
            DS.tmp_fileformat.Rows.Add(new object[] { "F", "File a lunghezza fissa" });
            DS.tmp_fileformat.Rows.Add(new object[] { "T", "File con campi separati da tabulatori" });
            DS.tmp_fileformat.Rows.Add(new object[] { "C", "File con campi separati da virgole" });
            DS.tmp_fileformat.Rows.Add(new object[] { "E", "Trasferimento a Microsoft Excel" });

            PostData.MarkAsTemporaryTable(DS.tmp_fileformat, false);
            DS.tmp_fileformat.AcceptChanges();
        }
Beispiel #13
0
 public void MetaData_AfterLink()
 {
     Meta = MetaData.GetMetaData(this);
     Conn = Meta.Conn;
     QHC  = new CQueryHelper();
     QHS  = Meta.Conn.GetQueryHelper();
     HelpForm.SetDenyNull(DS.csa_contractepexp.Columns["idepexp"], true);
     PostData.MarkAsTemporaryTable(DS.fase_epexp, false);
     GetData.MarkToAddBlankRow(DS.fase_epexp);
     GetData.Add_Blank_Row(DS.fase_epexp);
     EnableFaseImpegnoBudget(1, "Preimpegno di Budget");
     EnableFaseImpegnoBudget(2, "Impegno di Budget");
 }
Beispiel #14
0
        void FillModuleNameTmpTable()
        {
            string    command     = "select distinct modulename from exportfunction";
            DataTable ModuliTable = Meta.Conn.SQLRunner(command);

            GetData.MarkToAddBlankRow(DS.tmp_modulename);
            GetData.Add_Blank_Row(DS.tmp_modulename);
            foreach (DataRow R in ModuliTable.Rows)
            {
                DS.tmp_modulename.Rows.Add(new object[] { R["modulename"] });
            }
            PostData.MarkAsTemporaryTable(DS.tmp_modulename, false);
            DS.tmp_modulename.AcceptChanges();
        }
Beispiel #15
0
        public void MetaData_AfterLink()
        {
            Meta      = MetaData.GetMetaData(this);
            QHS       = Meta.Conn.GetQueryHelper();
            QHC       = new CQueryHelper();
            esercizio = CfgFn.GetNoNullInt32(Meta.GetSys("esercizio"));
            string filterEsercizio = QHS.CmpEq("ayear", Meta.GetSys("esercizio"));

            GetData.SetStaticFilter(DS.f24ep, filterEsercizio);
            GetData.CacheTable(DS.license);
            GetData.CacheTable(DS.config, filterEsercizio, null, false);
            GetData.MarkToAddBlankRow(DS.monthname);
            GetData.Add_Blank_Row(DS.monthname);
            GetData.CacheTable(DS.monthname);
            GetData.SetSorting(DS.monthname, "code");
        }
Beispiel #16
0
        public FrmSelectDetailsFromBooking(MetaData Meta, string filtersql, vistaForm DS)
        {
            InitializeComponent();
            this.Meta      = Meta;
            this.Conn      = Meta.Conn;
            this.Disp      = Meta.Dispatcher;
            this.filtersql = filtersql;
            this.DS        = DS;
            QHC            = new CQueryHelper();
            QHS            = Meta.Conn.GetQueryHelper();

            // Magazzino
            DataTable store = Conn.CreateTableByName("store", "*", false);
            DataSet   D     = new DataSet();

            D.Tables.Add(store);
            Conn.RUN_SELECT_INTO_TABLE(store, "description", filtersql, null, true);
            cmbMagazzino.DataSource    = store;
            cmbMagazzino.ValueMember   = "idstore";
            cmbMagazzino.DisplayMember = "description";
            HelpForm.SetComboBoxValue(cmbMagazzino, store.Rows[0]["idstore"]);
            cmbMagazzino.Enabled = false;

            // Responsabile
            DataTable manager = Conn.CreateTableByName("manager", "*", false);

            D.Tables.Add(manager);
            GetData.MarkToAddBlankRow(manager);
            GetData.Add_Blank_Row(manager);
            Conn.RUN_SELECT_INTO_TABLE(manager, "title", null, null, true);
            cmbResponsabile.DataSource    = manager;
            cmbResponsabile.ValueMember   = "idman";
            cmbResponsabile.DisplayMember = "title";

            Conn.DeleteAllUnselectable(manager);
            //RiempiGrid();
            FormInit();
        }
Beispiel #17
0
        public AskClassificazione(MetaData Meta)
        {
            this.Meta = Meta;
            InitializeComponent();
            string    filter = "tablename = 'inventorytree'";
            DataTable tClass = DataAccess.CreateTableByName(Meta.Conn, "sortingapplicabilityview", "idsorkind, description");

            GetData.MarkToAddBlankRow(tClass);
            GetData.Add_Blank_Row(tClass);
            Meta.Conn.RUN_SELECT_INTO_TABLE(tClass, null, filter, null, true);

            if (tClass == null)
            {
                return;
            }

            tClass.TableName = "sortingkind";
            DataSet ds = new DataSet();

            ds.Tables.Add(tClass);
            cmbSortingKind.DataSource    = ds.Tables[0];
            cmbSortingKind.ValueMember   = "idsorkind";
            cmbSortingKind.DisplayMember = "description";
        }
Beispiel #18
0
        bool CheckStandard()
        {
            Conn.DO_SYS_CMD("update registry set cf=null where cf=''", true);
            Conn.DO_SYS_CMD("update registry set p_iva=null where p_iva=''", true);

            int NUM_STD = Conn.RUN_SELECT_COUNT("registryclass",
                                                "(idregistryclass in ('21','22','23','24')AND(active='S'))", false);

            if (NUM_STD != 0 && NUM_STD != 4)
            {
                MessageBox.Show("Le tipologie presenti non sono compatibili con questa procedura");
                return(false);
            }
            if (NUM_STD == 0)
            {
                if (MessageBox.Show(this, "Mancano in questa anagrafica le tipologie standard. " +
                                    "Procedendo saranno installate. Si intende procedere?", "Avviso",
                                    MessageBoxButtons.OKCancel) != DialogResult.OK)
                {
                    return(false);
                }
                Conn.DO_SYS_CMD(instregclass, false);
            }
            NUM_STD = Conn.RUN_SELECT_COUNT("registryclass",
                                            "(idregistryclass in ('21','22','23','24')AND(active='S'))", false);
            if (NUM_STD != 4)
            {
                MessageBox.Show("Problemi nell'installazione delle tipologie standard");
                return(false);
            }
            int NUM_UNKNREG = Conn.RUN_SELECT_COUNT("registry",
                                                    "(idregistryclass not in ('01','02','03','04','05','06'," +
                                                    "'07','08','09','10','OO','21','22','23','24'))", false);

            if (NUM_UNKNREG > 0)
            {
                MessageBox.Show("Ci sono anagrafiche classificate con tipologie sconosciute." +
                                "E' necessario correggerle prima di procedere.");
                return(false);
            }

            int NUM_BADREG = Conn.RUN_SELECT_COUNT("registry",
                                                   "(idregistryclass not in ('21','22','23','24'))", false);

            if (NUM_BADREG > 0)
            {
                if (MessageBox.Show("Ci sono anagrafiche classificate con tipologie non standard." +
                                    "Procedendo saranno riclassificati in automatico con tipologie standard." +
                                    "Si intende procedere?", "Avviso",
                                    MessageBoxButtons.OKCancel) != DialogResult.OK)
                {
                    return(false);
                }
                Conn.DO_SYS_CMD(Upd_registry, false);
            }
            NUM_BADREG = Conn.RUN_SELECT_COUNT("registry",
                                               "(idregistryclass not in ('21','22','23','24'))", false);
            if (NUM_BADREG > 0)
            {
                MessageBox.Show("Sono rimaste anagrafiche non classificate con tipologie standard." +
                                "Questo è un problema non risolvibile in automatico.");
                return(false);
            }
            RegClass = Conn.CreateTableByName("registryclass", "*");
            GetData.MarkToAddBlankRow(RegClass);
            GetData.Add_Blank_Row(RegClass);
            Conn.RUN_SELECT_INTO_TABLE(RegClass, "idregistryclass", "idregistryclass in ('21','22','23','24')", null, false);
            for (int i = 1; i < tabController.TabPages.Count; i++)
            {
                ComboBox C = combo[i];
                if (C == null)
                {
                    continue;
                }
                C.DataSource    = RegClass;
                C.DisplayMember = "description";
                C.ValueMember   = "idregistryclass";
                C.DropDownStyle = ComboBoxStyle.DropDownList;
            }

            return(true);
        }
Beispiel #19
0
        public FrmAskInfo(string filter_upb, MetaDataDispatcher Disp,
                          object idupb,
                          object idmanager,
                          object idfin,
                          decimal importo,
                          decimal importoRimasto,
                          object idexp,
                          object idpettycash,
                          bool upbToSelect,
                          string mode)
        {
            InitializeComponent();

            this.filter_upb     = filter_upb;
            this.currfilter_upb = filter_upb;
            this.Disp           = Disp;
            this.Conn           = Disp.Conn;
            this.importo        = importo;
            this.idmanager      = idmanager;
            this.idfin          = idfin;
            this.idupb          = idupb;
            this.importoRimasto = importoRimasto;
            this.idexp          = idexp;
            this.idpettycash    = idpettycash;
            this.upbToSelect    = upbToSelect;
            this.mode           = mode;
            QHC = new CQueryHelper();
            QHS = Conn.GetQueryHelper();

            txtImporto.Text = importo.ToString("c");
            Selected        = null;

            responsabile = Conn.CreateTableByName("manager", "*", false);
            D            = new DataSet();
            D.Tables.Add(responsabile);
            GetData.MarkToAddBlankRow(responsabile);
            GetData.Add_Blank_Row(responsabile);

            Conn.RUN_SELECT_INTO_TABLE(responsabile, "title", QHS.CmpEq("active", "S"), null, true);

            Conn.DeleteAllUnselectable(responsabile);
            cmbResponsabile.DataSource    = responsabile;
            cmbResponsabile.ValueMember   = "idman";
            cmbResponsabile.DisplayMember = "title";

            upb = Conn.CreateTableByName("upb", "*", false);
            D.Tables.Add(upb);
            GetData.MarkToAddBlankRow(upb);
            GetData.Add_Blank_Row(upb);
            Conn.RUN_SELECT_INTO_TABLE(upb, "codeupb", QHS.CmpEq("active", "S"), null, true);

            Conn.DeleteAllUnselectable(upb);
            if (filter_upb == null)
            {
                chkFilterAvailable.Checked = false;
                chkFilterAvailable.Enabled = false;
            }

            cmbUPB.DataSource    = upb;
            cmbUPB.ValueMember   = "idupb";
            cmbUPB.DisplayMember = "codeupb";

            fin = Conn.CreateTableByName("fin", "*", false);
            D.Tables.Add(fin);
            Conn.RUN_SELECT_INTO_TABLE(fin, null, QHS.CmpEq("idfin", idfin), null, true);

            Conn.DeleteAllUnselectable(fin);



            expensephase = Conn.CreateTableByName("expensephase", "*", false);
            D.Tables.Add(expensephase);
            GetData.MarkToAddBlankRow(expensephase);
            GetData.Add_Blank_Row(expensephase);
            string filterCmbPhase = QHS.AppAnd(QHS.CmpNe("nphase", Conn.GetSys("maxexpensephase")), QHS.CmpGe("nphase", Conn.GetSys("expensefinphase")));

            Conn.RUN_SELECT_INTO_TABLE(expensephase, "nphase", filterCmbPhase, null, true);
            cmbFaseSpesa.DataSource    = expensephase;
            cmbFaseSpesa.ValueMember   = "nphase";
            cmbFaseSpesa.DisplayMember = "description";

            string filterpcash = QHC.CmpEq("idpettycash", idpettycash);

            idpettycashreg = Conn.DO_READ_VALUE("pettycashsetup", filterpcash, "registrymanager");

            ImpostaOggetti();
        }
Beispiel #20
0
        public FrmAskInfo(string E_S, string filter_upb, MetaDataDispatcher Disp,
                          object idmanager,
                          decimal importo,
                          bool upbToSelect)
        {
            InitializeComponent();

            this.E_S        = E_S;
            this.filter_upb = filter_upb;
            //this.currfilter_upb = filter_upb;
            this.Disp        = Disp;
            this.Conn        = Disp.Conn;
            this.importo     = importo;
            this.idmanager   = idmanager;
            this.upbToSelect = upbToSelect;

            QHC = new CQueryHelper();
            QHS = Conn.GetQueryHelper();

            SubEntity_txtImportoMovimento.Text = importo.ToString("c");
            Selected = null;

            DataTable responsabile = Conn.CreateTableByName("manager", "*", false);
            DataSet   D            = new DataSet();

            D.Tables.Add(responsabile);
            GetData.MarkToAddBlankRow(responsabile);
            GetData.Add_Blank_Row(responsabile);
            if (idmanager != null && idmanager != DBNull.Value)
            {
                Conn.RUN_SELECT_INTO_TABLE(responsabile, "title",
                                           QHS.CmpEq("idman", idmanager), null, true);
                cmbResponsabile.Enabled = false;
            }
            else
            {
                if (idmanager == DBNull.Value)
                {
                    Conn.RUN_SELECT_INTO_TABLE(responsabile, "title", QHS.CmpEq("active", "S"), null, true);
                }
                else
                {
                    cmbResponsabile.Enabled = false;
                }
            }
            Conn.DeleteAllUnselectable(responsabile);

            DataTable upb = Conn.CreateTableByName("upb", "*", false);

            D.Tables.Add(upb);
            GetData.MarkToAddBlankRow(upb);
            GetData.Add_Blank_Row(upb);
            if (filter_upb != null && filter_upb != "")
            {
                Conn.RUN_SELECT_INTO_TABLE(upb, "codeupb", filter_upb, null, true);
                cmbUPB.Enabled = false;
                if (upb.Select(filter_upb).Length > 0)
                {
                    txtUPB.Text = upb.Select(filter_upb)[0]["title"].ToString();
                }
            }
            else
            {
                if (upbToSelect)
                {
                    Conn.RUN_SELECT_INTO_TABLE(upb, "codeupb", QHS.CmpEq("active", "S"), null, true);
                }
                else
                {
                    cmbUPB.Enabled = false;
                }
            }

            if (filter_upb == null)
            {
                chkFilterAvailable.Checked = false;
                chkFilterAvailable.Enabled = false;
            }
            cmbResponsabile.DataSource    = responsabile;
            cmbResponsabile.ValueMember   = "idman";
            cmbResponsabile.DisplayMember = "title";
            if (idmanager != null && idmanager != DBNull.Value && responsabile.Rows.Count > 1)
            {
                cmbResponsabile.SelectedIndex = 1;
            }
            else
            {
                cmbResponsabile.SelectedIndex = -1;
            }
            cmbUPB.DataSource    = upb;
            cmbUPB.ValueMember   = "idupb";
            cmbUPB.DisplayMember = "codeupb";
            if (filter_upb != null)
            {
                cmbUPB.SelectedIndex = 1;
            }
            //Meta = Disp.Get("finview");
            if (filter_upb != null)
            {
                Meta = Disp.Get("finview");
            }
            else
            {
                Meta = Disp.Get("fin");
            }
            //if (filter_upb == null) {
            //    txtBilancio.Enabled = false;
            //}
        }
Beispiel #21
0
        public FrmSelectDetailsFromStock(MetaData Meta, string filtersql, DataSet DS)
        {
            InitializeComponent();
            this.Meta      = Meta;
            this.Conn      = Meta.Conn;
            this.Disp      = Meta.Dispatcher;
            this.filtersql = filtersql;
            this.DS        = DS;

            QHC = new CQueryHelper();
            QHS = Meta.Conn.GetQueryHelper();

            // Magazzino
            DataTable store = Conn.CreateTableByName("store", "*", false);

            D = new DataSet();
            D.Tables.Add(store);
            Conn.RUN_SELECT_INTO_TABLE(store, "description", filtersql, null, true);
            cmbMagazzino.DataSource    = store;
            cmbMagazzino.ValueMember   = "idstore";
            cmbMagazzino.DisplayMember = "description";
            HelpForm.SetComboBoxValue(cmbMagazzino, store.Rows[0]["idstore"]);
            cmbMagazzino.Enabled = false;

            // Responsabile
            DataTable manager = Conn.CreateTableByName("manager", "*", false);

            D.Tables.Add(manager);
            GetData.MarkToAddBlankRow(manager);
            GetData.Add_Blank_Row(manager);
            Conn.RUN_SELECT_INTO_TABLE(manager, "title", null, null, true);
            cmbResponsabile.DataSource    = manager;
            cmbResponsabile.ValueMember   = "idman";
            cmbResponsabile.DisplayMember = "title";

            Conn.DeleteAllUnselectable(manager);

            MetaSorting = Disp.Get("sorting");

            FormInit();
            DD                 = new DataSet("a");
            Sorting1           = Conn.CreateTableByName("sorting", "*");
            Sorting1.TableName = "sorting1";
            Sorting2           = Conn.CreateTableByName("sorting", "*");
            Sorting2.TableName = "sorting2";
            Sorting3           = Conn.CreateTableByName("sorting", "*");
            Sorting3.TableName = "sorting3";
            DD.Tables.Add(Sorting1);
            DD.Tables.Add(Sorting2);
            DD.Tables.Add(Sorting3);
            DD.EnforceConstraints = false;

            DataAccess.SetTableForReading(Sorting1, "sorting");
            DataAccess.SetTableForReading(Sorting2, "sorting");
            DataAccess.SetTableForReading(Sorting3, "sorting");

            string    filter    = "(ayear=" + QueryCreator.quotedstrvalue(Meta.GetSys("esercizio"), true) + ")";
            DataTable tExpSetup = Meta.Conn.RUN_SELECT("config", "*", null,
                                                       filter, null, null, true);

            if ((tExpSetup != null) && (tExpSetup.Rows.Count > 0))
            {
                DataRow R          = tExpSetup.Rows[0];
                string  idsorkind1 = R["idsortingkind1"].ToString();
                string  idsorkind2 = R["idsortingkind2"].ToString();
                string  idsorkind3 = R["idsortingkind3"].ToString();
                SetGBoxClass(1, idsorkind1);
                SetGBoxClass(2, idsorkind2);
                SetGBoxClass(3, idsorkind3);

                if (idsorkind3 == "")
                {
                    grpAnalitico.Size = new System.Drawing.Size(366, 200);
                }
                if (idsorkind2 + idsorkind3 == "")
                {
                    grpAnalitico.Size = new System.Drawing.Size(366, 100);
                }
                if (idsorkind1 + idsorkind2 + idsorkind3 == "")
                {
                    grpAnalitico.Visible = false;
                }
                if (idsorkind1 != "")
                {
                    CSM1 = new Class_SelectionManager(Meta, txtCodice1, txtDenom1, R["idsortingkind1"]);
                }
                if (idsorkind2 != "")
                {
                    CSM2 = new Class_SelectionManager(Meta, txtCodice2, txtDenom2, R["idsortingkind2"]);
                }
                if (idsorkind3 != "")
                {
                    CSM3 = new Class_SelectionManager(Meta, txtCodice3, txtDenom3, R["idsortingkind3"]);
                }
            }
        }