Beispiel #1
0
        public override void WebDescribeTree(hwTreeView tree, DataTable T, string ListingType)
        {
            int esercizio = Convert.ToInt32(GetSys("esercizio"));

            if (ListingType == "tree")
            {
                DescribeColumns(T, ListingType);
            }


            base.WebDescribeTree(tree, T, ListingType);
            int               maxlevel  = 9;
            string            filterc   = QHC.IsNull("paridaccmotive");
            string            filtersql = QHS.IsNull("paridaccmotive");
            hwTreeViewManager M         = new hwTreeViewAccMotiveApplied(Conn, T, tree, filterc, filtersql, maxlevel);
        }
Beispiel #2
0
        public override void WebDescribeTree(hwTreeView tree, DataTable T, string ListingType)
        {
            int maxDepth = 9;

            if (ListingType == "tree")
            {
                base.DescribeColumns(T, ListingType);
                foreach (DataColumn C in T.Columns)
                {
                    DescribeAColumn(T, C.ColumnName, "");
                }
                DescribeAColumn(T, "codelistclass", "Codice");
                DescribeAColumn(T, "title", "Denominazione");
            }

            base.WebDescribeTree(tree, T, ListingType);
            string filterc   = QHC.IsNull("paridlistclass");
            string filtersql = QHS.IsNull("paridlistclass");

            hwTreeViewListClass M = new hwTreeViewListClass(Conn, T, tree, filterc, filtersql, false, maxDepth);
        }
Beispiel #3
0
        public override void DescribeTree(TreeView tree, DataTable T, string ListingType)
        {
            // L'idupb ha una lunghezza di 36 caratteri ed ogni livello ha una lunghezza di 4 caratteri

            //Aggiorno le intestazioni del DataGrid
            if (ListingType == "tree")
            {
                base.DescribeColumns(T, ListingType);
                foreach (DataColumn C in T.Columns)
                {
                    DescribeAColumn(T, C.ColumnName, "");
                }
                DescribeAColumn(T, "codemotive", "Codice");
                DescribeAColumn(T, "title", "Denominazione");
            }

            base.DescribeTree(tree, T, ListingType);
            string filterc   = QHC.IsNull("paridaccmotive");
            string filtersql = QHS.IsNull("paridaccmotive");

            TreeViewAccMotive M = new TreeViewAccMotive(Conn, T, tree, filterc, filtersql);
        }
Beispiel #4
0
        public override void DescribeTree(TreeView tree, DataTable T, string ListingType)
        {
            //Aggiorno le intestazioni del DataGrid
            int esercizio = Convert.ToInt32(GetSys("esercizio"));

            if (ListingType == "tree" || ListingType == "treee" || ListingType == "treesupbnew" || ListingType == "treeeupbnew" ||
                ListingType == "trees" || ListingType == "treees" ||
                ListingType == "treeenew" || ListingType == "treesnew" ||
                ListingType == "treeeupb" || ListingType == "treesupb" ||
                ListingType == "treealle" || ListingType == "treealls" ||
                ListingType == "treeallenew" || ListingType == "treeallsnew" ||
                ListingType == "upbprevision")
            {
                base.DescribeColumns(T, ListingType);
                foreach (DataColumn C in T.Columns)
                {
                    DescribeAColumn(T, C.ColumnName, "");
                }
                DescribeAColumn(T, "codefin", "Codice");
                DescribeAColumn(T, "leveldescr", "Livello");
                DescribeAColumn(T, "title", "Denominazione");
                DescribeAColumn(T, "manager", "Responsabile");
                DescribeAColumn(T, "cupcode", "CUP");
                DescribeAColumn(T, "prevision", "Prev. Iniziale Princ.");
                DescribeAColumn(T, "currentprevision", "Prev. Attuale Princ.");
                DescribeAColumn(T, "availableprevision", "Prev. Disponibile Princ.");
                if (Conn != null)
                {
                    int finkind = CfgFn.GetNoNullInt32(Conn.GetSys("fin_kind"));
                    if (finkind == 3)
                    {
                        DescribeAColumn(T, "secondaryprev", "Prev. Iniziale Second.");
                        DescribeAColumn(T, "currentsecondaryprev", "Prev. Attuale Second.");
                        DescribeAColumn(T, "availablesecondaryprev", "Prev. Disponibile Second.");
                    }
                }
            }

            base.DescribeTree(tree, T, ListingType);

            int    esercizionew    = esercizio + 1;
            string filterC         = QHC.CmpEq("nlevel", 1);
            string filtersql       = QHS.CmpEq("nlevel", 1);
            string kind            = "ES";
            string filteresercizio = QHS.CmpEq("ayear", GetSys("esercizio"));

            if (ListingType == "treee")
            {
                filtersql = QHS.AppAnd(
                    QHS.BitClear("flag", 0),
                    QHS.AppAnd(QHS.CmpEq("ayear", esercizio), QHS.IsNull("paridfin")));
                filterC = QHC.AppAnd(
                    QHC.BitClear("flag", 0),
                    QHC.AppAnd(QHC.CmpEq("ayear", esercizio), QHC.IsNull("paridfin")));
                kind = "E";
            }
            if (ListingType == "trees")
            {
                filtersql = QHS.AppAnd(
                    QHS.BitSet("flag", 0),
                    QHS.AppAnd(QHS.CmpEq("ayear", esercizio), QHS.IsNull("paridfin")));
                filterC = QHC.AppAnd(
                    QHC.BitSet("flag", 0),
                    QHC.AppAnd(QHC.CmpEq("ayear", esercizio), QHC.IsNull("paridfin")));
                kind = "S";
            }
            if (ListingType == "treees")
            {
                //filter="(nlevel='1')";
                kind = "ES";
            }
            if (ListingType == "tree")
            {
                //filter="(nlevel='1')";
                kind = "ES";
            }
            if (ListingType == "treeenew")
            {
                filtersql = QHS.AppAnd(
                    QHS.BitClear("flag", 0),
                    QHS.AppAnd(QHS.CmpEq("ayear", esercizionew), QHS.IsNull("paridfin")));
                filterC = QHC.AppAnd(
                    QHC.BitClear("flag", 0),
                    QHC.AppAnd(QHC.CmpEq("ayear", esercizionew), QHC.IsNull("paridfin")));
                kind            = "E";
                filteresercizio = QHS.CmpEq("ayear", esercizionew);
            }
            if (ListingType == "treeeupbnew")
            {
                filtersql = QHS.AppAnd(
                    QHS.BitClear("flag", 0),
                    QHS.AppAnd(QHS.CmpEq("ayear", esercizionew), QHS.IsNull("paridfin")));
                filterC = QHC.AppAnd(
                    QHC.BitClear("flag", 0),
                    QHC.AppAnd(QHC.CmpEq("ayear", esercizionew), QHC.IsNull("paridfin")));
                kind            = "E";
                filteresercizio = QHS.CmpEq("ayear", esercizionew);
            }

            if (ListingType == "treesnew")
            {
                filtersql = QHS.AppAnd(
                    QHS.BitSet("flag", 0),
                    QHS.AppAnd(QHS.CmpEq("ayear", esercizionew), QHS.IsNull("paridfin")));
                filterC = QHC.AppAnd(
                    QHC.BitSet("flag", 0),
                    QHC.AppAnd(QHC.CmpEq("ayear", esercizionew), QHC.IsNull("paridfin")));
                kind            = "S";
                filteresercizio = QHS.CmpEq("ayear", esercizionew);
            }
            if (ListingType == "treesupbnew")
            {
                filtersql = QHS.AppAnd(
                    QHS.BitSet("flag", 0),
                    QHS.AppAnd(QHS.CmpEq("ayear", esercizionew), QHS.IsNull("paridfin")));
                filterC = QHC.AppAnd(
                    QHC.BitSet("flag", 0),
                    QHC.AppAnd(QHC.CmpEq("ayear", esercizionew), QHC.IsNull("paridfin")));
                kind            = "S";
                filteresercizio = QHS.CmpEq("ayear", esercizionew);
            }
            if (ListingType == "treeeupb")
            {
                filtersql = QHS.AppAnd(
                    QHS.BitClear("flag", 0),
                    QHS.AppAnd(QHS.CmpEq("ayear", esercizio), QHS.IsNull("paridfin")));
                filterC = QHC.AppAnd(
                    QHC.BitClear("flag", 0),
                    QHC.AppAnd(QHC.CmpEq("ayear", esercizio), QHC.IsNull("paridfin")));
                kind = "E";
            }

            if (ListingType == "treesupb")
            {
                filtersql = QHS.AppAnd(
                    QHS.BitSet("flag", 0),
                    QHS.AppAnd(QHS.CmpEq("ayear", esercizio), QHS.IsNull("paridfin")));
                filterC = QHC.AppAnd(
                    QHC.BitSet("flag", 0),
                    QHC.AppAnd(QHC.CmpEq("ayear", esercizio), QHC.IsNull("paridfin")));
                kind = "S";
            }

            if (ListingType == "upbprevision")
            {
                filtersql = QHS.AppAnd(QHS.CmpEq("ayear", esercizio), QHS.IsNull("paridfin"));
                filterC   = QHC.AppAnd(QHC.CmpEq("ayear", esercizio), QHC.IsNull("paridfin"));
                kind      = "ES";
            }

            bool all = false;

            if (ListingType == "treealle")
            {
                filtersql = QHS.AppAnd(
                    QHS.BitClear("flag", 0),
                    QHS.AppAnd(QHS.CmpEq("ayear", esercizio), QHS.IsNull("paridfin")));
                filterC = QHC.AppAnd(
                    QHC.BitClear("flag", 0),
                    QHC.AppAnd(QHC.CmpEq("ayear", esercizio), QHC.IsNull("paridfin")));
                kind = "E";
                all  = true;
            }
            if (ListingType == "treealls")
            {
                filtersql = QHS.AppAnd(
                    QHS.BitSet("flag", 0),
                    QHS.AppAnd(QHS.CmpEq("ayear", esercizio), QHS.IsNull("paridfin")));
                filterC = QHC.AppAnd(
                    QHC.BitSet("flag", 0),
                    QHC.AppAnd(QHC.CmpEq("ayear", esercizio), QHC.IsNull("paridfin")));
                kind = "S";
                all  = true;
            }

            if (ListingType == "treeallenew")
            {
                filtersql = QHS.AppAnd(
                    QHS.BitClear("flag", 0),
                    QHS.AppAnd(QHS.CmpEq("ayear", esercizionew), QHS.IsNull("paridfin")));
                filterC = QHC.AppAnd(
                    QHC.BitClear("flag", 0),
                    QHC.AppAnd(QHC.CmpEq("ayear", esercizionew), QHC.IsNull("paridfin")));
                kind = "E";
                all  = true;
            }
            if (ListingType == "treeallsnew")
            {
                filtersql = QHS.AppAnd(
                    QHS.BitSet("flag", 0),
                    QHS.AppAnd(QHS.CmpEq("ayear", esercizionew), QHS.IsNull("paridfin")));
                filterC = QHC.AppAnd(
                    QHC.BitSet("flag", 0),
                    QHC.AppAnd(QHC.CmpEq("ayear", esercizionew), QHC.IsNull("paridfin")));
                kind = "S";
                all  = true;
            }
            int    maxlevel = 0;
            object o        = Conn.DO_READ_VALUE("finlevel", QHS.CmpEq("ayear", GetSys("esercizio")), "max(nlevel)");

            if ((o != null) && (o != DBNull.Value))
            {
                maxlevel = Convert.ToInt32(o);
            }
            TreeViewManager M = new TreeViewBilancio(Conn, T, tree, filterC, filtersql, kind, all, maxlevel,
                                                     CfgFn.GetNoNullInt32(GetSys("finusablelevel")));

            myGetData.SetStaticFilter("finlevel", filteresercizio);
        }
Beispiel #5
0
        public override bool IsValid(DataRow R, out string errmess, out string errfield)
        {
            if (!base.IsValid(R, out errmess, out errfield))
            {
                return(false);
            }


            DateTime datainizio = (DateTime)R["start"];

            if (!controllaData(datainizio, out errmess))
            {
                errfield = "start";
                return(false);
            }

            object df = R["stop"];

            if (df != DBNull.Value)
            {
                DateTime datafine = (DateTime)df;
                if (!controllaData(datafine, out errmess))
                {
                    errfield = "stop";
                    return(false);
                }

                if ((datafine != QueryCreator.EmptyDate()) && (datafine < datainizio))
                {
                    errmess  = "'Data fine validità' non può precedere 'Data inizio validità'";
                    errfield = "stop";
                    return(false);
                }
            }

            int codicecreddeb = CfgFn.GetNoNullInt32(R["idreg"]);

            if (codicecreddeb <= 0)
            {
                errmess  = "Inserire il codice dell'anagrafica";
                errfield = "idreg";
                return(false);
            }

            if ((R["address"].ToString() == "") || (R["address"].ToString().Trim() == "."))
            {
                errmess  = "Attenzione! Inserire l'indirizzo.";
                errfield = "address";
                return(false);
            }

            object codeAddressKind =
                Conn.DO_READ_VALUE("address", QHS.CmpEq("idaddress", R["idaddresskind"]), "codeaddress");

            if (codeAddressKind != null)
            {
                if ((codeAddressKind.ToString() == "07_SW_DOM") && (R["idcity"] is DBNull))
                {
                    errmess  = "Il domicilio fiscale non può essere estero! Inserire un comune italiano.";
                    errfield = "idcity";
                    return(false);
                }
            }

            if (codeAddressKind != null)
            {
                if ((codeAddressKind.ToString() != "07_SW_ANP") && (R["recipientagency"] != DBNull.Value))
                {
                    errmess = "L'Ente di provenienza deve essere specificato solo per l'indirizzo di tipo " +
                              "Anagrafe delle Prestazioni";
                    errfield = "recipientagency";
                    return(false);
                }
            }

            //indirizzo estero o nazionale
            if (R["flagforeign"].ToString().ToUpper() == "S")
            {
                if (R["idnation"].ToString() == "")
                {
                    errmess  = "Attenzione! Inserire lo stato estero.";
                    errfield = "idnation";
                    return(false);
                }
            }
            else
            {
                if (R["idcity"].ToString() == "")
                {
                    errmess  = "Attenzione! Inserire il Comune.";
                    errfield = "idcity";
                    return(false);
                }

                if (Conn.RUN_SELECT_COUNT("geo_city_agency",
                                          QHS.AppAnd(QHS.CmpEq("idagency", 3), QHS.CmpEq("idcity", R["idcity"]), QHS.IsNull("stop")),
                                          false) > 0)
                {
                    object cap   = R["cap"];
                    string query = "select value from geo_city_agency where " +
                                   QHS.AppAnd(QHS.CmpEq("idagency", 3), QHS.CmpEq("idcity", R["idcity"]),
                                              QHS.IsNull("stop"));
                    DataTable t  = Conn.SQLRunner(query);
                    DataRow[] r1 = t.Select("value=" + QueryCreator.quotedstrvalue(cap, false));
                    if (r1.Length == 0)
                    {
                        //DialogResult dr = MessageBox.Show(LinkedForm, "Il C.A.P. non è coerente o non è più valido per il comune inserito. Salvare ugualmente?", "Avviso", MessageBoxButtons.YesNo);
                        //if (dr==DialogResult.No)
                        //{
                        object comune = Conn.readValue("geo_city", q.eq("idcity", R["idcity"]), "title") ??
                                        "(Comune non trovato)";
                        //R.GetParentRow("geo_cityregistryaddress")["title"];
                        if (t.Rows.Count == 1)
                        {
                            errmess = "Il codice postale del comune di '" + comune + "' è '" +
                                      t.Rows[0]["value"].ToString() + "'";
                        }
                        else
                        {
                            errmess = "Il comune di '" + comune + "' ha i seguenti codici postali:\n"
                                      + QueryCreator.ColumnValues(t, null, "value", false);
                        }

                        errfield = "cap";
                        return(false);
                        //}
                    }
                }
            }

            return(true);
        }
Beispiel #6
0
 public override void DescribeTree(TreeView tree, DataTable T, string ListingType)
 {
     // Listing Type chiamato dal form di gestione di budgetprevision (fissato l'IDFIN)
     if (ListingType == "tree")
     {
         object idSorting = T.ExtendedProperties["idsor"];
         base.DescribeTree(tree, T, ListingType);
         string          filterC         = QHC.AppAnd(QHC.CmpEq("idsor", idSorting), QHC.IsNull("paridupb"));
         string          filterSql       = QHS.AppAnd(QHS.CmpEq("idsor", idSorting), QHS.IsNull("paridupb"));
         string          filteresercizio = QHS.CmpEq("ayear", GetSys("esercizio"));
         TreeViewManager M = new TreeViewbudgetprevision(T, tree, filterC, filterSql, null);
         myGetData.SetStaticFilter("sortinglevel", filteresercizio);
     }
 }
Beispiel #7
0
 public override void DescribeTree(TreeView tree, DataTable T, string ListingType)
 {
     // Listing Type chiamato dal form di gestione di ACCOUNTYEAR (fissato l'IDACC)
     if (ListingType == "tree")
     {
         string idAcc = T.ExtendedProperties["idacc"].ToString();
         base.DescribeTree(tree, T, ListingType);
         string          filterc         = QHC.AppAnd(QHC.CmpEq("idacc", idAcc), QHC.IsNull("paridupb"));
         string          filtersql       = QHS.AppAnd(QHS.CmpEq("idacc", idAcc), QHS.IsNull("paridupb"));
         string          filteresercizio = QHS.CmpEq("ayear", GetSys("esercizio"));
         TreeViewManager M = new TreeViewAccountYear(Conn, T, tree, filterc, filtersql, null, 10);
         myGetData.SetStaticFilter("accountlevel", filteresercizio);
     }
 }