Ejemplo n.º 1
0
 public override void CalculateFields(System.Data.DataRow R, string listtype)
 {
     if (R.Table.DataSet.Tables["fin"] != null)
     {
         DataTable tFin      = R.Table.DataSet.Tables["fin"];
         string    filterFin = QHC.CmpEq("idfin", R["idfin"]);
         if (tFin.Select(filterFin).Length > 0)
         {
             DataRow rFin    = tFin.Select(filterFin)[0];
             object  flagObj = rFin["flag"];
             if (flagObj == null)
             {
                 return;
             }
             byte flag      = Convert.ToByte(flagObj);
             bool isEntrata = (flag & 1) == 0;
             if (listtype == "lista")
             {
                 if (isEntrata)
                 {
                     R["!E/S"] = "E";
                 }
                 else
                 {
                     R["!E/S"] = "S";
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
        public override void DescribeTree(TreeView tree, DataTable T, string ListingType)
        {
            //Aggiorno le intestazioni del DataGrid
            if (ListingType == "tree")
            {
                base.DescribeColumns(T, ListingType);
                foreach (DataColumn C in T.Columns)
                {
                    DescribeAColumn(T, C.ColumnName, "", -1);
                }
                DescribeAColumn(T, "leveldescr", "Livello", 1);
                DescribeAColumn(T, "sortcode", "Codice", 2);
                DescribeAColumn(T, "description", "Denominazione", 3);
                DescribeAColumn(T, "movkind", "Tipo movimento", 4);
                DescribeAColumn(T, "printingorder", "Ordine stampa", 5);
                DescribeAColumn(T, "incomeprevision", "Budget Ricavi", 6);
                DescribeAColumn(T, "expenseprevision", "Budget Costi", 7);
            }


            base.DescribeTree(tree, T, ListingType);
            string filterc   = QHC.CmpEq("nlevel", 1);
            string filtersql = QHS.CmpEq("nlevel", 1);

            int eserc = CfgFn.GetNoNullInt32(GetSys("esercizio"));

            filterc   = QHC.AppAnd(filterc, QHC.NullOrLe("start", eserc), QHC.NullOrGe("stop", eserc));
            filtersql = QHC.AppAnd(filtersql, QHS.NullOrLe("start", eserc), QHS.NullOrGe("stop", eserc));

            TreeViewManager M = new TreeViewClassMovimentiView(T, tree, filterc, filtersql);
        }
Ejemplo n.º 3
0
        public override void DescribeTree(TreeView tree, DataTable T, string ListingType)
        {
            bool all = false;

            base.DescribeTree(tree, T, ListingType);
            //Aggiorno le intestazioni del DataGrid
            if (ListingType == "tree")
            {
                base.DescribeColumns(T, ListingType);
                foreach (DataColumn C in T.Columns)
                {
                    DescribeAColumn(T, C.ColumnName, "");
                }
                DescribeAColumn(T, "leveldescr", "Livello");
                DescribeAColumn(T, "apfinancialactivitycode", "Codice");
                DescribeAColumn(T, "description", "Descrizione");
            }

            if (ListingType == "treeall")
            {
                base.DescribeColumns(T, ListingType);
                foreach (DataColumn C in T.Columns)
                {
                    DescribeAColumn(T, C.ColumnName, "");
                }
                DescribeAColumn(T, "leveldescr", "Livello");
                DescribeAColumn(T, "apfinancialactivitycode", "Codice");
                DescribeAColumn(T, "description", "Descrizione");
                all = true;
            }

            string          filterc   = QHC.CmpEq("nlevel", 1);
            string          filtersql = QHS.CmpEq("nlevel", 1);
            TreeViewManager M         = new TreeAttivitaEconomicaView(T, tree, filterc, filtersql, all);
        }
Ejemplo n.º 4
0
        public override bool FilterRow(DataRow R, string list_type)
        {
            if ((list_type == "bilancio") || (list_type == "upb"))
            {
                if (R.Table.DataSet.Tables["finvar"] != null)
                {
                    DataTable tFinVar      = R.Table.DataSet.Tables["finvar"];
                    string    filterFinVar = QHC.AppAnd(QHC.CmpEq("yvar", R["yvar"]),
                                                        QHC.CmpEq("nvar", R["nvar"]));

                    if (tFinVar.Select(filterFinVar).Length > 0)
                    {
                        DataRow rFinVar = tFinVar.Select(filterFinVar)[0];
                        if (CfgFn.GetNoNullInt32(rFinVar["idfinvarstatus"]) != 5)
                        {
                            return(false);
                        }
                    }

                    return(true);
                }
                return(true);
            }

            return(true);
        }
Ejemplo n.º 5
0
        //modifiche luigi 8179
        public override void WebDescribeTree(hwTreeView tree, DataTable T, string ListingType)
        {
            int maxDepth = 9; bool withdescr = true;

            if (ListingType == "default")
            {
                base.DescribeColumns(T, ListingType);
                foreach (DataColumn C in T.Columns)
                {
                    DescribeAColumn(T, C.ColumnName, "");
                }
                DescribeAColumn(T, "idlocation", "Id Ubicazione");
                DescribeAColumn(T, "locationcode", "Codice Ubicazione");
                DescribeAColumn(T, "description", "Ubicazione");
            }


            base.WebDescribeTree(tree, T, ListingType);
            string filterc         = QHC.CmpEq("nlevel", 1);
            string filtersql       = QHS.CmpEq("nlevel", 1);
            easy_node_dispatcher D = new location_node_dispatcher(
                "locationlevel",
                "nlevel",
                "description",
                null,
                "description",
                "locationcode"
                );
            WebTreeViewlocation M = new WebTreeViewlocation(T, tree, filterc, filtersql, maxDepth, withdescr);
        }
Ejemplo n.º 6
0
        void CopyCustomFilter(DataRow SourceRow)
        {
            if (SourceRow.Table.ExtendedProperties["ExtraParams"] == null)
            {
                return;
            }
            DataRow parent = SourceRow.GetParentRow("sortingincomesorted");

            if (parent == null)
            {
                return;
            }
            string    filter   = QHC.CmpEq("!idsorkind", parent["idsorkind"]);
            DataTable OldTable =
                (DataTable)SourceRow.Table.ExtendedProperties[MetaData.ExtraParams];
            DataTable newTable = OldTable.Clone();

            DataRow [] selected = OldTable.Select(filter);
            foreach (DataRow R in selected)
            {
                DataRow newR = newTable.NewRow();
                foreach (DataColumn C in newTable.Columns)
                {
                    newR[C] = R[C.ColumnName];
                }
                newTable.Rows.Add(newR);
                newR.AcceptChanges();
            }
            PrimaryDataTable.ExtendedProperties[MetaData.ExtraParams] = newTable;
        }
Ejemplo n.º 7
0
        public override void DescribeTree(TreeView tree, DataTable T, string ListingType)
        {
            //Aggiorno le intestazioni del DataGrid
            if (ListingType == "tree")
            {
                base.DescribeColumns(T, ListingType);
                foreach (DataColumn C in T.Columns)
                {
                    DescribeAColumn(T, C.ColumnName, "", -1);
                }
                DescribeAColumn(T, "codeacc", "Codice", 1);
                DescribeAColumn(T, "account", "Denominazione", 2);
            }

            base.DescribeTree(tree, T, ListingType);
            string filterc   = QHC.CmpEq("nlevel", "1");
            string filtersql = QHS.CmpEq("nlevel", "1");

            int    maxlevel        = 0;
            string filterEsercizio = QHS.CmpEq("ayear", GetSys("esercizio"));
            object o = Conn.DO_READ_VALUE("accountlevel", filterEsercizio, "max(nlevel)");

            if ((o != null) && (o != DBNull.Value))
            {
                maxlevel = Convert.ToInt32(o);
            }
            TreeViewManager M = new TreeViewAccountPrevisionView(Conn, T, tree, filterc, filtersql, maxlevel);

            myGetData.SetStaticFilter("accountlevel", filterEsercizio);
        }
Ejemplo n.º 8
0
        public override DataRow Get_New_Row(DataRow ParentRow, DataTable T)
        {
            string    testoMessaggio = "Bisogna inserire i dati nel form di configurazione della prestazione occasionale";
            DataTable configurazione = T.DataSet.Tables["config"];

            DataRow [] configrow = configurazione.Select(QHC.CmpEq("ayear", GetSys("esercizio")));
            if (configrow.Length == 0)
            {
                MessageBox.Show(testoMessaggio, "Prestazione Occasionale - Dati Mancanti", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(null);
            }
            int    flag_autodocnumbering = CfgFn.GetNoNullInt32(configrow[0]["flag_autodocnumbering"]);
            string kind = ((flag_autodocnumbering & 0x20) == 0) ? "A" : "M";

            if (kind.ToUpper() == "A")
            {
                string reset = configrow[0]["casualcontract_flagrestart"].ToString();
                if (reset.ToUpper() == "S")
                {
                    RowChange.SetSelector(T, "ycon");
                }
                RowChange.MarkAsAutoincrement(T.Columns["ncon"], null, null, 0);
            }
            else
            {
                int nmax = CfgFn.GetNoNullInt32(
                    Conn.DO_READ_VALUE("casualcontract", QHS.CmpEq("ycon", GetSys("esercizio")), "MAX(ncon)")) + 1;
                SetDefault(T, "ncon", nmax);
            }
            return(base.Get_New_Row(ParentRow, T));
        }
Ejemplo n.º 9
0
        public override DataRow Get_New_Row(DataRow ParentRow, DataTable T)
        {
            DataTable tConfigurazione = T.DataSet.Tables["config"];

            DataRow[] rConfig = tConfigurazione.Select(QHC.CmpEq("ayear", GetSys("esercizio")));
            if (rConfig.Length == 0)
            {
                MessageBox.Show("Bisogna inserire i dati nel form di configurazione del contratto",
                                "Contratto - Dati Mancanti", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(null);
            }

            int    flag_autodocnumbering = CfgFn.GetNoNullInt32(rConfig[0]["flag_autodocnumbering"]);
            string kind = ((flag_autodocnumbering & 0x10) == 0) ? "A" : "M";

            RowChange.SetSelector(T, "ycon");
            RowChange.MarkAsAutoincrement(T.Columns["idcon"], null,
                                          Conn.GetSys("esercizio").ToString().Substring(2, 2), 6);
            if (kind.ToUpper() == "A")
            {
                RowChange.MarkAsAutoincrement(T.Columns["ncon"], null, null, 0);
            }
            else
            {
                int nmax = CfgFn.GetNoNullInt32(
                    Conn.DO_READ_VALUE("parasubcontract", QHS.CmpEq("ycon", GetSys("esercizio"))
                                       , "MAX(CONVERT(int,ncon))")) + 1;
                SetDefault(T, "ncon", nmax);
            }

            return(base.Get_New_Row(ParentRow, T));
        }
Ejemplo n.º 10
0
        public override void DescribeTree(System.Windows.Forms.TreeView tree, DataTable T, string ListingType)
        {
            bool all = false;

            //Aggiorno le intestazioni del DataGrid
            if (ListingType == "tree" || ListingType == "treeall" || ListingType == "treenew" || ListingType == "treeminusable")
            {
                base.DescribeColumns(T, ListingType);
                foreach (DataColumn C in T.Columns)
                {
                    DescribeAColumn(T, C.ColumnName, "");
                }
                DescribeAColumn(T, "!livello", "Livello", "accountlevel.description");
                DescribeAColumn(T, "codeacc", "Codice");
                DescribeAColumn(T, "title", "Denominazione");
            }

            base.DescribeTree(tree, T, ListingType);
            int    esercizio       = Convert.ToInt32(GetSys("esercizio"));
            int    esercizionew    = esercizio + 1;
            string filteresercizio = QHC.CmpEq("ayear", GetSys("esercizio"));
            string filterc         = QHC.CmpEq("nlevel", "1");
            string filtersql       = QHS.CmpEq("nlevel", "1");

            int    maxlevel = 0;
            object o        = Conn.DO_READ_VALUE("accountlevel", filteresercizio, "max(nlevel)");

            if ((o != null) && (o != DBNull.Value))
            {
                maxlevel = Convert.ToInt32(o);
            }
            int    minlevelop         = CfgFn.GetNoNullInt32(GetSys("accountusablelevel"));
            string filterAccountLevel = filteresercizio;

            if (ListingType == "treeminusable")
            {
                maxlevel = minlevelop;
                string filterenablebudgetprev = QHS.NullOrEq("flagenablebudgetprev", "S");
                filterAccountLevel = QHS.AppAnd(QHS.CmpEq("ayear", esercizionew), QHS.CmpLe("nlevel", minlevelop), filterenablebudgetprev);
            }

            //		TreeViewAccount M = new TreeViewAccount(Conn, T, tree, filter, maxlevel);
            //		myGetData.SetStaticFilter("accountevel","(ayear='"+GetSys("esercizio").ToString()+"')");
            //
            if (ListingType == "treeall")
            {
                all = true;
            }
            if (ListingType == "treenew")
            {
                //string livsupid = esercizionew.ToString().Substring(2);
                //filter = "(paridacc is null + QueryCreator.quotedstrvalue(livsupid, true) + ")";
                filterAccountLevel = QHS.CmpEq("ayear", esercizionew);
                all = true;
            }
            TreeViewAccount M = new TreeViewAccount(Conn, T, tree, filterc, filtersql, all, maxlevel);

            myGetData.SetStaticFilter("accountlevel", filterAccountLevel);
        }
Ejemplo n.º 11
0
        void CheckResponsabileChange()
        {
            DataRow [] Location = DS.assetlocation.Select(null, null, DataViewRowState.Added);
            foreach (DataRow RL in Location)
            {
                string    filterloc = QHC.CmpEq("idlocation", RL["idlocation"]);
                DataRow[] LL        = DS.location.Select(filterloc);
                if (LL.Length == 0)
                {
                    continue;
                }
                if (LL[0]["idman"] == DBNull.Value)
                {
                    continue;
                }
                if (LL[0]["idman"].ToString() == lastrejected.ToString())
                {
                    continue;
                }
                string filter = QHC.CmpEq("start", RL["start"]);
                if (DS.assetmanager.Select(filter).Length == 0)
                {
                    if (MessageBox.Show(this, "Si vuole reimpostare il responsabile in base alla nuova ubicazione?", "Conferma",
                                        MessageBoxButtons.YesNo) == DialogResult.No)
                    {
                        lastrejected = LL[0]["idman"];
                        return;
                    }

                    MetaData AM = Meta.Dispatcher.Get("assetmanager");
                    AM.SetDefaults(DS.assetmanager);
                    DataRow NA = AM.Get_New_Row(DS.asset.Rows[0], DS.assetmanager);
                    MetaData.SetDefault(DS.assetmanager, "start", RL["start"]);
                    NA["start"] = RL["start"];
                    NA["idman"] = LL[0]["idman"];
                }
                else
                {
                    DataRow CurrAssMan = DS.assetmanager.Select(filter)[0];
                    if (CurrAssMan["idman"].ToString() != LL[0]["idman"].ToString())
                    {
                        if (MessageBox.Show(this, "Si vuole reimpostare il responsabile in base alla nuova ubicazione?", "Conferma",
                                            MessageBoxButtons.YesNo) == DialogResult.No)
                        {
                            lastrejected = LL[0]["idman"];
                            return;
                        }
                        CurrAssMan["idman"] = LL[0]["idman"];
                    }
                }
                Meta.myGetData.GetTemporaryValues(DS.assetmanager);
                lastrejected = DBNull.Value;
            }
        }
Ejemplo n.º 12
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);
     }
 }
Ejemplo n.º 13
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);
     }
 }
Ejemplo n.º 14
0
        //fine

        public override void DescribeTree(TreeView tree, DataTable T, string ListingType)
        {
            base.DescribeTree(tree, T, ListingType);
            string filterc         = QHC.CmpEq("nlevel", 1);
            string filtersql       = QHS.CmpEq("nlevel", 1);
            easy_node_dispatcher D = new location_node_dispatcher(
                "locationlevel",
                "nlevel",
                "description",
                null,
                "description",
                "locationcode"
                );
            TreeViewManager M = new TreeViewClassInventario(T, tree, filterc, filtersql);
        }
Ejemplo n.º 15
0
        public override void WebDescribeTree(hwTreeView tree, DataTable T, string ListingType)
        {
            int    esercizio       = Convert.ToInt32(GetSys("esercizio"));
            int    esercizionew    = esercizio + 1;
            string filteresercizio = QHC.CmpEq("ayear", GetSys("esercizio"));
            string filterc         = QHC.CmpEq("nlevel", "1");
            string filtersql       = QHS.CmpEq("nlevel", "1");

            if (ListingType == "tree" || ListingType == "treeall" || ListingType == "treenew" || ListingType == "treeminusable")
            {
                base.DescribeColumns(T, ListingType);
                foreach (DataColumn C in T.Columns)
                {
                    DescribeAColumn(T, C.ColumnName, "");
                }
                DescribeAColumn(T, "!livello", "Livello", "accountlevel.description");
                DescribeAColumn(T, "codeacc", "Codice");
                DescribeAColumn(T, "title", "Denominazione");
            }
            int    maxlevel = 0;
            object o        = Conn.DO_READ_VALUE("accountlevel", filteresercizio, "max(nlevel)");

            if ((o != null) && (o != DBNull.Value))
            {
                maxlevel = Convert.ToInt32(o);
            }
            int minlevelop = CfgFn.GetNoNullInt32(GetSys("accountusablelevel"));

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

            base.WebDescribeTree(tree, T, ListingType);

            hwTreeViewAccount M = new hwTreeViewAccount(Conn, T, tree, filterc, filtersql, false, maxlevel);
        }
Ejemplo n.º 16
0
        public override void DescribeTree(TreeView tree, DataTable T, string ListingType)
        {
            base.DescribeTree(tree, T, ListingType);
            string filterc   = QHC.CmpEq("nlevel", 1);
            string filtersql = QHS.CmpEq("nlevel", 1);

            inventory_node_dispatcher D = new inventory_node_dispatcher(
                "inventorysortinglevel",
                "nlevel",
                "description",
                "flag",
                "description",
                "codeinv"
                );
            TreeViewManager M = new TreeViewClassInventario(T, tree, filterc, filtersql);
        }
Ejemplo n.º 17
0
        string getNMovBySelect(DataTable t, object idmov)
        {
            DataRow[] Exp = t.Select(QHC.CmpEq("idexp", idmov));
            if (Exp.Length == 0)
            {
                return(null);
            }
            string nMov = Exp[0]["nmov"].ToString();

            while ((nMov.StartsWith("0")) && (nMov.Length > 0))
            {
                nMov = nMov.Substring(1, nMov.Length - 1);
            }

            return(nMov);
        }
Ejemplo n.º 18
0
        public override void DescribeTree(TreeView tree, DataTable T, string ListingType)
        {
            base.DescribeTree(tree, T, ListingType);
            string filterc   = QHC.CmpEq("nlevel", "1");
            string filtersql = QHS.CmpEq("nlevel", "1");

            if (ListingType != "history")
            {
                int eserc = CfgFn.GetNoNullInt32(GetSys("esercizio"));
                filterc   = QHC.AppAnd(filterc, QHC.NullOrLe("start", eserc), QHC.NullOrGe("stop", eserc));
                filtersql = QHC.AppAnd(filtersql, QHS.NullOrLe("start", eserc), QHS.NullOrGe("stop", eserc));
            }
            //			if (ListingType=="tree"){
            //				string eserc = esercizio.ToString();
            //				filter=filter+"AND(esercizio='" + eserc + "')";
            //			}
            //easy_node_dispatcher D = new easy_node_dispatcher(
            //    "sortinglevel",
            //    "nlevel",
            //    "description",
            //    "flagusable",
            //    "description",
            //    "sortcode"
            //    );
            int    maxlevel        = 0;
            string filterSortLevel = "";

            if (ListingType == "tree5")
            {
                maxlevel        = 5;
                filterSortLevel = QHS.CmpLe("nlevel", maxlevel);
                myGetData.SetStaticFilter("sortinglevel", filterSortLevel);
            }

            bool all = false;

            if (ListingType == "treeall")
            {
                all = true;
            }
            //object o = T.ExtendedProperties["idsorkindFilter"];
            //string filtro = o==null
            //    ? QHS.BitSet("flag", 1)
            //    : QHS.AppAnd(o.ToString(), QHS.BitSet("flag", 1));
            //int levelop = CfgFn.GetNoNullInt32(Conn.DO_READ_VALUE("sortinglevel", filtro, "min(nlevel)"));
            TreeViewManager M = new TreeViewClassMovimenti(Conn, T, tree, filterc, filtersql, all, maxlevel);          //, levelop);
        }
Ejemplo n.º 19
0
        //string removefilterupb(string filter){
        //          if (filter.IndexOf("AND(idupb IS NULL)")>=0) {
        //              return filter.Replace("AND(idupb IS NULL)", "");
        //          }
        //	int i = filter.IndexOf("(idupb=");
        //	if (i<0) return filter;
        //	int j= filter.IndexOf(")",i+5);
        //          if (filter.Length >= j + 4) {
        //              if (filter.Substring(j, 4).ToLower() == ")and") {
        //                  j += 3;
        //              }
        //          }

        //    if (filter.Length >= j + 2 && i>=3) {
        //        if (filter[j + 1] == ')' && filter.Substring(i-3, 3).ToLower() == "and") {
        //            i -= 3;//caso in cui c'è ... AND(idupb='asasa'))
        //        }
        //    }
        //	//if (j+1< filter.Length)
        //          return removefilterupb(filter.Substring(0, i) + filter.Substring(j + 1));
        //}

        public override string GetStaticFilter(string ListingType)
        {
            string filteresercizio, filtraSuUpbLibero;

            //if ((ListingType!="default")&&(ListingType!="upbprevision"))
            if ((ListingType == "tree") || (ListingType == "treee") || (ListingType == "trees") ||
                (ListingType == "treees") || (ListingType == "manager") || (ListingType == "treeenew") || (ListingType == "treesnew") ||
                (ListingType == "treealle") || (ListingType == "treealls") ||
                (ListingType == "treeallenew") || (ListingType == "treeallsnew") ||
                (ListingType == "treeeupb") || (ListingType == "treesupb"))
            {
                filteresercizio   = QHC.CmpEq("ayear", GetSys("esercizio"));
                filtraSuUpbLibero = QHC.AppAnd(filteresercizio, QHC.CmpEq("idupb", "0001"));
                return(filtraSuUpbLibero);
            }
            return(base.GetStaticFilter(ListingType));
        }
Ejemplo n.º 20
0
 public override void CalculateFields(DataRow R, string list_type)
 {
     if (list_type == "lista")
     {
         if (!R.Table.DataSet.Tables.Contains("virtualuser"))
         {
             return;
         }
         DataTable VU = R.Table.DataSet.Tables["virtualuser"];
         DataRow[] f  = VU.Select(QHC.CmpEq("cf", R["cf"]));
         if (f.Length > 0)
         {
             R["!surname"]  = f[0]["surname"];
             R["!forename"] = f[0]["forename"];
         }
     }
 }
Ejemplo n.º 21
0
        public override void DescribeTree(TreeView tree, DataTable T, string ListingType)
        {
            bool all = false;

            //Aggiorno le intestazioni del DataGrid
            if (ListingType == "tree" || ListingType == "treeall")
            {
                base.DescribeColumns(T, ListingType);
                foreach (DataColumn C in T.Columns)
                {
                    DescribeAColumn(T, C.ColumnName, "");
                }
                DescribeAColumn(T, "!livello", "Livello", "flowchartlevel.description");
                DescribeAColumn(T, "codeflowchart", "Codice");
                DescribeAColumn(T, "title", "Denominazione");
            }

            base.DescribeTree(tree, T, ListingType);
            int    esercizio = Convert.ToInt32(GetSys("esercizio"));
            string filterc   = QHC.CmpEq("nlevel", "1");
            string filtersql = QHS.CmpEq("nlevel", "1");
            int    maxlevel  = 0;
            object o         = Conn.DO_READ_VALUE("flowchartlevel", "(ayear = '" + Conn.GetSys("esercizio") + "')", "max(nlevel)");

            if ((o != null) && (o != DBNull.Value))
            {
                maxlevel = Convert.ToInt32(o);
            }

            if (ListingType == "treeall")
            {
                all = true;
            }

            TreeViewFlowChart M = new TreeViewFlowChart(Conn, T, tree, filterc, filtersql, all, maxlevel);

            myGetData.SetStaticFilter("flowchartlevel", QHS.CmpEq("ayear", esercizio));
        }
Ejemplo n.º 22
0
        public override void DescribeTree(TreeView tree, DataTable T, string ListingType)
        {
            bool all = false;

            //Aggiorno le intestazioni del DataGrid
            if (ListingType == "tree")
            {
                base.DescribeColumns(T, ListingType);
                foreach (DataColumn C in T.Columns)
                {
                    DescribeAColumn(T, C.ColumnName, "", -1);
                }
                int nPos = 1;
                DescribeAColumn(T, "leveldescr", "Livello", nPos++);
                DescribeAColumn(T, "codeinv", "Codice", nPos++);
                DescribeAColumn(T, "description", "Descrizione", nPos++);
            }
            if (ListingType == "treeall")
            {
                base.DescribeColumns(T, ListingType);
                foreach (DataColumn C in T.Columns)
                {
                    DescribeAColumn(T, C.ColumnName, "", -1);
                }
                int nPos = 1;
                DescribeAColumn(T, "leveldescr", "Livello", nPos++);
                DescribeAColumn(T, "codeinv", "Codice", nPos++);
                DescribeAColumn(T, "description", "Descrizione", nPos++);
                all = true;
            }
            base.DescribeTree(tree, T, ListingType);

            string filterc   = QHC.CmpEq("nlevel", 1);
            string filtersql = QHS.CmpEq("nlevel", 1);
            //			if (ListingType=="tree"){
            TreeViewManager M = new TreeClassInventarioView(T, tree, filterc, filtersql, all);
        }
Ejemplo n.º 23
0
        public override void DescribeTree(TreeView tree, DataTable T, string ListingType)
        {
            int maxlev = 0;

            if (ListingType == "treecr" || ListingType == "tree" || ListingType == "treec" || ListingType == "treer" || ListingType == "treecnew" || ListingType == "treernew")
            {
                base.DescribeColumns(T, ListingType);
                foreach (DataColumn C in T.Columns)
                {
                    DescribeAColumn(T, C.ColumnName, "");
                }
                DescribeAColumn(T, "!livello", "Livello", "placcountlevel.description");
                DescribeAColumn(T, "codeplaccount", "Codice");
                DescribeAColumn(T, "title", "Denominazione");
            }

            base.DescribeTree(tree, T, ListingType);
            int    esercizio       = Convert.ToInt32(GetSys("esercizio"));
            int    esercizionew    = esercizio + 1;
            string filteresercizio = QHS.CmpEq("ayear", GetSys("esercizio"));
            string filterc         = QHC.CmpEq("nlevel", "1");
            string filtersql       = QHS.CmpEq("nlevel", "1");
            string kind            = "CR";
            bool   all             = false;

            if (ListingType == "treecr")
            {
                //filter="(nlevel='1')";
                kind = "CR";
            }
            if (ListingType == "treec")
            {
                string livsupid = esercizio.ToString().Substring(2) + "C";
                filterc   = QHC.CmpEq("paridplaccount", livsupid);
                filtersql = QHS.CmpEq("paridplaccount", livsupid);
                kind      = "C";
                all       = true;
            }
            if (ListingType == "treer")
            {
                string livsupid = esercizio.ToString().Substring(2) + "R";
                filterc   = QHC.CmpEq("paridplaccount", livsupid);
                filtersql = QHS.CmpEq("paridplaccount", livsupid);
                kind      = "R";
                all       = true;
            }
            if (ListingType == "treecnew")
            {
                string livsupid = esercizionew.ToString().Substring(2) + "C";
                filterc         = QHC.CmpEq("paridplaccount", livsupid);
                filtersql       = QHS.CmpEq("paridplaccount", livsupid);
                kind            = "C";
                filteresercizio = QHS.CmpEq("ayear", esercizionew);
                all             = true;
            }
            if (ListingType == "treernew")
            {
                string livsupid = esercizionew.ToString().Substring(2) + "R";
                filterc   = QHC.CmpEq("paridplaccount", livsupid);
                filtersql = QHS.CmpEq("paridplaccount", livsupid);

                kind            = "R";
                filteresercizio = QHS.CmpEq("ayear", esercizionew);
                all             = true;
            }

            int    maxlevel = 0;
            object o        = Conn.DO_READ_VALUE("placcountlevel", filteresercizio, "max(nlevel)");

            if ((o != null) && (o != DBNull.Value))
            {
                maxlevel = Convert.ToInt32(o);
            }

            if (maxlev > 0)
            {
                myGetData.SetStaticFilter("placcount", QHS.AppAnd(filteresercizio, QHS.CmpLe("nlevel", maxlev)));
                myGetData.SetStaticFilter("placcountview", QHS.AppAnd(filteresercizio, QHS.CmpLe("nlevel", maxlev)));
            }

            TreeViewContoEconomico M = new TreeViewContoEconomico(T, tree, filterc, filtersql, kind, all, maxlev);

            myGetData.SetStaticFilter("placcountlevel", filteresercizio);
        }
Ejemplo n.º 24
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);
        }
Ejemplo n.º 25
0
        void CalcolaUbicazioneResponsabile(System.Data.DataRow R)
        {
            //Mette in !location la riga di assetlocation con data null
            DataTable AssetLocation = R.Table.DataSet.Tables["assetlocation"];
            DataTable Location      = R.Table.DataSet.Tables["location"];

            DataRow [] RAL = AssetLocation.Select(QHC.AppAnd(QHC.CmpEq("idasset", R["idasset"]),
                                                             QHC.IsNull("start")));
            if (RAL.Length > 0)
            {
                object    idlocation = RAL[0]["idlocation"];
                DataRow[] RLoc       = Location.Select(QHC.CmpEq("idlocation", idlocation));
                if (RLoc.Length == 0)
                {
                    Conn.RUN_SELECT_INTO_TABLE(Location, null, QHS.CmpEq("idlocation", idlocation), null, false);
                    RLoc = Location.Select(QHC.CmpEq("idlocation", idlocation));
                }

                if (RLoc.Length > 0)
                {
                    R["!location"] = RLoc[0]["description"];
                }
                else
                {
                    R["!location"] = "";
                }
            }
            else
            {
                R["!location"] = "";
            }


            //Mette in !manager la riga di assetmanager con data null
            DataTable AssetManager = R.Table.DataSet.Tables["assetmanager"];
            DataTable Manager      = R.Table.DataSet.Tables["manager"];

            DataRow[] RAM = AssetManager.Select(QHC.AppAnd(QHC.CmpEq("idasset", R["idasset"]),
                                                           QHC.IsNull("start")));
            if (RAM.Length > 0)
            {
                object    idmanager = RAM[0]["idman"];
                DataRow[] RMan      = Manager.Select(QHC.CmpEq("idman", idmanager));
                if (RMan.Length == 0)
                {
                    Conn.RUN_SELECT_INTO_TABLE(Manager, null, QHS.CmpEq("idman", idmanager), null, false);
                    RMan = Manager.Select(QHC.CmpEq("idman", idmanager));
                }
                if (RMan.Length > 0)
                {
                    R["!manager"] = RMan[0]["title"];
                }
                else
                {
                    R["!manager"] = "";
                }
            }
            else
            {
                R["!manager"] = "";
            }

            //Mette in !submanager la riga di assetsubmanager con data null
            DataTable AssetSubManager = R.Table.DataSet.Tables["assetsubmanager"];
            DataTable SubManager      = R.Table.DataSet.Tables["submanager"];

            DataRow[] RAsubM = AssetSubManager.Select(QHC.AppAnd(QHC.CmpEq("idasset", R["idasset"]),
                                                                 QHC.IsNull("start")));
            if (RAsubM.Length > 0)
            {
                object    idmanager = RAsubM[0]["idmanager"];
                DataRow[] RAsubMan  = SubManager.Select(QHC.CmpEq("idman", idmanager));
                if (RAsubMan.Length == 0)
                {
                    Conn.RUN_SELECT_INTO_TABLE(SubManager, null, QHS.CmpEq("idman", idmanager), null, false);
                    RAsubMan = SubManager.Select(QHC.CmpEq("idman", idmanager));
                }
                if (RAsubMan.Length > 0)
                {
                    R["!submanager"] = RAsubMan[0]["title"];
                }
                else
                {
                    R["!submanager"] = "";
                }
            }
            else
            {
                R["!submanager"] = "";
            }
        }
Ejemplo n.º 26
0
        private void copia_Bppugliese_IN020304()
        {
            //Quando viene regolarizzato un mandato, ossia in presenza del TipoMov 031 vi è anche il TipoMov 033 (regolarizz. provv.uscita). Idem per 021 e 023, per le reversali.
            //Per quanto riguarda gli annullamenti di regolarizzazioni, la situazione è speculare.
            //Quando viene annullata la regolarizzazione di un mandato, ossia in presenza del TipoMov 032 vi è anche il TipoMov 034.
            // Idem per 022 e 024, per le reversali.
            // Nel 031 abbiamo l'info del num.doc., mentre nel 033 abbiamo l'info del num. bolletta. Il legame tra i due è dato da NRIC.
            // Quindi, facciamo un ciclo preliminare per elaborare  i record 023, 024, 033, 034 e memorizzare in quattro hashtable NRIC.
            // Queste verranno interrogate dopo

            //queste rappresentano n. di bolletta, le leggiamo dai record 23,24,33,34
            Hashtable nbolletta_entrata = new Hashtable(); //Regolarizzazione e annullo Provvisorio Entrata  23,24
            Hashtable nbolletta_uscita  = new Hashtable(); //Regolarizzazione e annullo Provvisorio Uscita 33,34

            //queste rappresentano i record corrispondenti, nei documenti
            //Hashtable doc_entrata  = new Hashtable(); //Regolarizzazione e annullo  Reversale 21,22
            //Hashtable doc_uscita = new Hashtable(); //Regolarizzazione e annullo Mandato 31,32

            string filtroRec023Rec033 = QHC.AppOr(QHC.CmpEq("tipomovimento", "023"), QHC.CmpEq("tipomovimento", "033"), QHC.CmpEq("tipomovimento", "024"),
                                                  QHC.CmpEq("tipomovimento", "034"));

            //i tipi 23,24,33,34 a nel campo numdocumento hanno il n.bolletta mentre nel campo numricevuta un numero imprecisato
            foreach (DataRow s in DS.bppugliese.Select(filtroRec023Rec033))
            {
                if (s["numricevuta"].ToString() == "")
                {
                    continue;
                }
                object nric = s["numricevuta"];
                if (s["tipomovimento"].ToString() == "023" || s["tipomovimento"].ToString() == "024")
                {
                    nbolletta_entrata[nric] = s["numdocumento"];
                }
                if (s["tipomovimento"].ToString() == "033" || s["tipomovimento"].ToString() == "034")
                {
                    nbolletta_uscita[nric] = s["numdocumento"];
                }
            }

            DS.flussobanca.Clear();
            foreach (DataRow s in DS.bppugliese.Rows)
            {
                string  tipoMov = s["tipomovimento"].ToString();
                DataRow r       = DS.flussobanca.NewRow();
                r["CODEN"]  = s["codiceente"];
                r["ESERC"]  = s["codiceesercizio"];
                r["TIPDOC"] = s["tipdoc"];

                // Per i TipoMov. 003, 013, 004 e 014 Il numero documento rappresenta il numero del Provvisorio, ossia il numero della bolletta.
                if ((s["tipomovimento"].ToString() == "003") || (s["tipomovimento"].ToString() == "013") ||
                    (s["tipomovimento"].ToString() == "004") || (s["tipomovimento"].ToString() == "014")
                    )
                {
                    r["NUMDOC"] = DBNull.Value;
                    r["NUMQUI"] = s["numdocumento"];
                }

                /*
                 * // Il TipoMov 016 è lo storno della disposizione di Uscita.
                 * if (s["tipomovimento"].ToString() == "016") {
                 *      if(CfgFn.GetNoNullInt32(s["numsub"])>0){
                 *          // NSUB >0 : identifica lo storno di un mandato
                 *              r["NUMDOC"] = s["numdocumento"];
                 *              r["NUMQUI"] = DBNull.Value;
                 *          }
                 *      else {
                 *          // NSUB = 0 : identifica lo storno di un provvisorio
                 *          r["NUMDOC"] = DBNull.Value;
                 *          r["NUMQUI"] = s["numdocumento"];
                 *          }
                 *  }
                 */
                //riscossione/annullo mandati e reversali
                if ((s["tipomovimento"].ToString() == "001") || (s["tipomovimento"].ToString() == "002") ||
                    (s["tipomovimento"].ToString() == "011") || (s["tipomovimento"].ToString() == "012"))
                {
                    r["NUMDOC"] = s["numdocumento"];
                    r["NUMQUI"] = DBNull.Value;
                }

                ////i tipi 23,24, regolarizzazione e annullo bolletta entrata. In numdocumento c'è il num.bolletta
                if ((s["tipomovimento"].ToString() == "023") || (s["tipomovimento"].ToString() == "024")
                    )
                {
                    r["NUMQUI"] = s["numdocumento"];
                    //object nric = r["numricevuta"];
                    //if (nric.ToString() != "" && doc_entrata[nric] != null) {
                    //    DataRow source = (DataRow)doc_entrata[nric];
                    //    r["NUMDOC"] = source["numdocumento"];
                    //    r["numsub"] = source["numsub"];
                    //}
                    //else {
                    //    r["NUMDOC"] = DBNull.Value;
                    //    r["numsub"] = DBNull.Value;
                    //}
                    r["NUMDOC"] = DBNull.Value;
                    s["numsub"] = DBNull.Value;
                }

                if ((s["tipomovimento"].ToString() == "033") || (s["tipomovimento"].ToString() == "034"))
                {
                    r["NUMQUI"] = s["numdocumento"];
                    //object nric = r["numricevuta"];
                    //if (nric.ToString() != "" && doc_uscita[nric] != null) {
                    //    DataRow source = (DataRow)doc_uscita[nric];
                    //    r["NUMDOC"] = source["numdocumento"];
                    //    r["numsub"] = source["numsub"];
                    //}
                    //else {
                    //    r["NUMDOC"] = DBNull.Value;
                    //    r["numsub"] = DBNull.Value;
                    //}
                    r["NUMDOC"] = DBNull.Value;
                    s["numsub"] = DBNull.Value;
                }


                //Regolarizzazione o annullo Reversale
                // nell'annullo di regolarizzazione di reversale si deve valorizzare il numero di provvisorio
                // prendendolo dalla riga 023 (regolarizzazione provvisorio entrata), solo che questa riga potrebbe essere assente
                // si potrebbe leggere il numero provvisorio anche dalla riga 024 con lo stesso numero ricevuta
                if (s["tipomovimento"].ToString() == "021" || s["tipomovimento"].ToString() == "022")
                {
                    object NRIC = s["numricevuta"];
                    r["NUMDOC"] = s["numdocumento"];
                    if (nbolletta_entrata[NRIC] != null)
                    {
                        r["NUMQUI"] = nbolletta_entrata[NRIC];
                    }
                    else
                    {
                        r["NUMQUI"] = DBNull.Value;
                    }
                }

                if (s["tipomovimento"].ToString() == "031" || s["tipomovimento"].ToString() == "032")
                {
                    object NRIC = s["numricevuta"];
                    r["NUMDOC"] = s["numdocumento"];
                    if (nbolletta_uscita[NRIC] != null)
                    {
                        r["NUMQUI"] = nbolletta_uscita[NRIC];
                    }
                    else
                    {
                        r["NUMQUI"] = DBNull.Value;
                    }
                }


                r["PRODOC"] = s["numsub"];
                r["CAPBIL"] = s["numcapitolo"];
                r["ARTBIL"] = s["numarticolo"];
                r["IMPDOC"] = s["importoricevuta"];
                r["SEGNO"]  = s["segno"];
                r["DTELAB"] = s["datamovimento"];// Da rivedere (?)
                r["DTPAG"]  = s["datamovimento"];
                r["DVAL"]   = s["datavaluta"];

                if (s["tipomovimento"].ToString() == "021" || s["tipomovimento"].ToString() == "031" ||
                    s["tipomovimento"].ToString() == "022" || s["tipomovimento"].ToString() == "032")
                {
                    if (s["datamovimento"] == DBNull.Value && s["datavaluta"] != DBNull.Value)
                    {
                        r["DTPAG"] = s["datavaluta"];
                    }
                }

                r["INDREG"] = s["indreg"];
                r["DVALBE"] = DBNull.Value; // s["datavalutabeneficiario"];// Da rivedere (?)
                r["IBOLLI"] = s["importibolli"];
                r["INDBOL"] = s["codicebolli"];
                r["ISPE"]   = s["importospese"];
                r["INDSPE"] = s["codicespese"];
                r["TPAGTS"] = s["codiceesecuzione"];// Da rivedere
                r["CODABI"] = s["abicliente"];
                r["CODCAB"] = s["cabcliente"];
                //r["CONTO"] = s["conto"];    // DA RIVEDERE : NEL TRACCIATO MANCA
                //r["CIN"] = s["cin"];// DA RIVEDERE : NEL TRACCIATO MANCA
                //r["NCNT"] = s["numerosottoconto"];
                r["ANABE"] = s["descrizionecliente"];
                //r["CFISC"] = s["cf"];
                r["CAUSALE"] = s["codicecausale"];
                r["FILLER"]  = s["tipomovimento"];
                r["CAUSALE"] = s["causale1"].ToString() + s["causale2"].ToString() + s["causale3"].ToString();
                if ((s["tipomovimento"].ToString() == "003") || (s["tipomovimento"].ToString() == "013"))
                {
                    r["CAUSALE"] = "(Imputaz." + s["codicetipoimputazione"].ToString() + ")" + r["CAUSALE"].ToString();
                }

                // I TipiRec 023 e 033 e anche 024 - 034non li passiamo al motore degli esiti, sono serviti solo per valorizzare il num.bolletta di Rec. 021 e 031
                //if ((s["tipomovimento"].ToString() != "023") && (s["tipomovimento"].ToString() != "033") &&
                //    (s["tipomovimento"].ToString() != "024") && (s["tipomovimento"].ToString() != "034")) {
                //    DS.flussobanca.Rows.Add(r);
                //}
                DS.flussobanca.Rows.Add(r);
            }
            DS.bppugliese.Clear();
        }
Ejemplo n.º 27
0
        public override void DescribeTree(TreeView tree, DataTable T, string ListingType)
        {
            int maxlev = 0;

            //Aggiorno le intestazioni del DataGrid
            if (ListingType == "treeap" || ListingType == "tree" || ListingType == "treea" || ListingType == "treep" || ListingType == "treeanew" || ListingType == "treepnew")
            {
                base.DescribeColumns(T, ListingType);
                foreach (DataColumn C in T.Columns)
                {
                    DescribeAColumn(T, C.ColumnName, "", -1);
                }
                DescribeAColumn(T, "!livello", "Livello", "patrimonylevel.description", 1);
                DescribeAColumn(T, "codepatrimony", "Codice", 2);
                DescribeAColumn(T, "title", "Denominazione", 3);
            }

            base.DescribeTree(tree, T, ListingType);
            int    esercizio       = Convert.ToInt32(GetSys("esercizio"));
            int    esercizionew    = esercizio + 1;
            string filteresercizio = QHS.CmpEq("ayear", GetSys("esercizio"));
            string filterc         = QHC.CmpEq("nlevel", "1");
            string filtersql       = QHS.CmpEq("nlevel", "1");
            string kind            = "AP";
            bool   all             = false;

            if (ListingType == "treeap")
            {
                //filter="(nlevel='1')";
                kind = "AP";
            }
            if (ListingType == "tree")
            {
                //filter="(nlevel='1')";
                kind = "AP";
            }
            if (ListingType == "treea")
            {
                string livsupid = esercizio.ToString().Substring(2) + "A";
                //filter = "(paridpatrimony=" + QueryCreator.quotedstrvalue(livsupid, true) + ")";
                filterc   = QHC.CmpEq("paridpatrimony", livsupid);
                filtersql = QHS.CmpEq("paridpatrimony", livsupid);
                kind      = "A";
                all       = true;
            }
            if (ListingType == "treep")
            {
                string livsupid = esercizio.ToString().Substring(2) + "P";
                filterc   = QHC.CmpEq("paridpatrimony", livsupid);
                filtersql = QHS.CmpEq("paridpatrimony", livsupid);
                kind      = "P";
                all       = true;
            }
            if (ListingType == "treeanew")
            {
                string livsupid = esercizionew.ToString().Substring(2) + "A";
                filterc         = QHC.CmpEq("paridpatrimony", livsupid);
                filtersql       = QHS.CmpEq("paridpatrimony", livsupid);
                kind            = "A";
                filteresercizio = QHS.CmpEq("ayear", esercizionew);
                all             = true;
            }
            if (ListingType == "treepnew")
            {
                string livsupid = esercizionew.ToString().Substring(2) + "P";
                filterc         = QHC.CmpEq("paridpatrimony", livsupid);
                filtersql       = QHS.CmpEq("paridpatrimony", livsupid);
                kind            = "P";
                filteresercizio = QHS.CmpEq("ayear", esercizionew);
                all             = true;
            }
            object o = Conn.DO_READ_VALUE("patrimonylevel", filteresercizio, "max(nlevel)");

            if ((o != null) && (o != DBNull.Value))
            {
                maxlev = Convert.ToInt32(o);
            }

            if (maxlev > 0)
            {
                myGetData.SetStaticFilter("patrimony", QHS.AppAnd(filteresercizio, QHS.CmpLe("nlevel", maxlev)));
                //myGetData.SetStaticFilter("patrimonyview", QHS.AppAnd(filteresercizio, QHS.CmpLe("nlevel", maxlev)));
            }

            TreeViewPatrimoniale M = new TreeViewPatrimoniale(T, tree, filterc, filtersql, kind, all, maxlev);

            myGetData.SetStaticFilter("patrimonylevel", filteresercizio);
        }
Ejemplo n.º 28
0
        override public DataRow Get_New_Row(DataRow ParentRow, DataTable T)
        {
            DataTable Levels = T.DataSet.Tables["sortinglevel"];

            if (Levels == null)
            {
                return(null);
            }
            bool   linear = false;
            int    level;
            string codprefix;
            string ordinestampaprefix;

            if (ParentRow != null)
            {
                level              = Convert.ToInt32(ParentRow["nlevel"]) + 1;
                codprefix          = ParentRow["sortcode"].ToString();
                ordinestampaprefix = ParentRow["printingorder"].ToString();
            }
            else
            {
                level              = 1;
                codprefix          = "";
                ordinestampaprefix = "";
            }
            if (level > (Levels.Select(QHC.CmpEq("idsorkind", this.ExtraParameter)).Length))
            {
                MessageBox.Show("Non è possibile inserire un livello inferiore a quello selezionato");
                return(null);
            }
            int    len  = 6;
            string kind = "A";

            DataRow [] levrow = Levels.Select(QHC.AppAnd(QHC.CmpEq("idsorkind", this.ExtraParameter), QHC.CmpEq("nlevel", level)));

            if (levrow.Length != 1)
            {
                return(null);
            }

            int flag = CfgFn.GetNoNullInt32(levrow[0]["flag"]);

            len  = flag >> 8;
            kind = (flag & 1) != 0 ? "A" : "N";
            if ((flag & 4) == 0)
            {
                linear = true;
            }

            T.Columns["sortcode"].ExtendedProperties["length"] = codprefix.Length + len;
            if (kind.ToUpper() == "A")
            {
                RowChange.MarkAsAutoincrement(T.Columns["printingorder"], null, ordinestampaprefix, len, linear);
            }

            SetDefault(T, "nlevel", level);

            //RowChange.SetSelector(T,"idsorkind");
            RowChange.MarkAsAutoincrement(T.Columns["idsor"], null, null, 8);

            if (kind.ToLower() == "a")
            {
                SetDefault(T, "sortcode", codprefix);
                RowChange.ClearAutoIncrement(T.Columns["sortcode"]);
                SetDefault(T, "printingorder", ordinestampaprefix);               //??
            }
            else
            {
                RowChange.MarkAsAutoincrement(T.Columns["sortcode"],
                                              null, codprefix, len, linear);
                RowChange.MarkAsAutoincrement(T.Columns["printingorder"],
                                              null, ordinestampaprefix, len, linear);
                if (!linear)
                {
                    RowChange.SetMySelector(T.Columns["sortcode"], "paridsor", 0);
                    RowChange.SetMySelector(T.Columns["printingorder"], "paridsor", 0);
                }
                RowChange.SetMySelector(T.Columns["sortcode"], "idsorkind", 0);
                RowChange.SetMySelector(T.Columns["printingorder"], "idsorkind", 0);
            }


            DataRow R = base.Get_New_Row(ParentRow, T);

            if (kind.ToLower() == "a")
            {
                RowChange.ClearAutoIncrement(T.Columns["printingorder"]);
            }
            return(R);
        }
Ejemplo n.º 29
0
        override public bool IsValid(DataRow R, out string errmess, out string errfield)
        {
            if (!base.IsValid(R, out errmess, out errfield))
            {
                return(false);
            }
            if (DS.Tables["sortingkind"] == null)
            {
                return(true);
            }
            DataRow parent = R.GetParentRow("sortingincomesorted");

            if (parent == null)
            {
                return(true);
            }
            string filtercodice = QHC.CmpEq("idsorkind", parent["idsorkind"]);

            DataRow [] tipoclass = DS.Tables["sortingkind"].Select(filtercodice);
            if (tipoclass.Length == 0)
            {
                return(true);                                 //??
            }
            if (R["amount"] == DBNull.Value)
            {
                errmess  = "L'importo della classificazione deve sempre essere specificato";
                errfield = "amount";
                return(false);
            }

            if (edit_type == "default")
            {
                if (DS.Tables["sorting"] == null)
                {
                    return(true);
                }

                string     filteridcodice = QHC.CmpEq("idsor", R["idsor"]);
                DataRow [] classmov       = DS.Tables["sorting"].Select(filteridcodice);
                if (classmov.Length == 0)
                {
                    return(true);                                    //??
                }
                DataRow CurrTipo  = tipoclass[0];
                DataRow CurrClass = classmov[0];

                //Evaluates flagincompleto and checks forced columns to be not null
                bool flagincompleto = false;
                foreach (char C in new char[3] {
                    'n', 's', 'v'
                })
                {
                    for (int i = 1; i <= 5; i++)
                    {
                        string suffix = C.ToString() + i.ToString();
                        if ((CurrTipo["forced" + suffix].ToString().ToLower() == "s") &&
                            (R["value" + C.ToString() + i.ToString()] == DBNull.Value))
                        {
                            if (MessageBox.Show(
                                    "Il campo " + CurrTipo["label" + suffix].ToString() +
                                    " non dovrebbe essere vuoto. Proseguo lo stesso?",
                                    "Avviso",
                                    MessageBoxButtons.YesNo) != DialogResult.Yes)
                            {
                                errfield = "value" + suffix;
                                errmess  = null;
                                return(false);
                            }
                            flagincompleto = true;
                        }
                    }
                }
                if ((CurrClass["flagnodate"].ToString().ToLower() == "n") &&
                    (R["flagnodate"].ToString().ToLower() == "n"))
                {
                    if (R["start"].ToString().Equals(""))
                    {
                        if (MessageBox.Show(
                                "Il campo datainizio non dovrebbe essere vuoto. Proseguo lo stesso?",
                                "Avviso",
                                MessageBoxButtons.YesNo) != DialogResult.Yes)
                        {
                            errfield = "start";
                            errmess  = null;
                            return(false);
                        }
                        else
                        {
                            flagincompleto = true;
                        }
                    }
                    if (R["stop"].ToString().Equals(""))
                    {
                        if (MessageBox.Show(
                                "Il campo datafine non dovrebbe essere vuoto. Proseguo lo stesso?",
                                "Avviso",
                                MessageBoxButtons.YesNo) != DialogResult.Yes)
                        {
                            errfield = "stop";
                            errmess  = null;
                            return(false);
                        }
                    }
                    else
                    {
                        flagincompleto = true;
                    }
                }

                if ((flagincompleto) && (R["tobecontinued"].ToString().ToLower() == ""))
                {
                    R["tobecontinued"] = "s";
                }
            }
            if (edit_type == "main")
            {
                if (DS.Tables["sortingview"] == null)
                {
                    return(true);
                }

                string     filteridcodice = QHC.CmpEq("idsor", R["idsor"]);
                DataRow [] classmov       = DS.Tables["sortingview"].Select(filteridcodice);
                if (classmov.Length == 0)
                {
                    return(true);                                    //??
                }
                DataRow CurrTipo  = tipoclass[0];
                DataRow CurrClass = classmov[0];

                //Evaluates flagincompleto and checks forced columns to be not null
                bool flagincompleto = false;
                foreach (char C in new char[3] {
                    'n', 's', 'v'
                })
                {
                    for (int i = 1; i <= 5; i++)
                    {
                        string suffix = C.ToString() + i.ToString();
                        if ((CurrTipo["forced" + suffix].ToString().ToLower() == "s") &&
                            (R["value" + C.ToString() + i.ToString()] == DBNull.Value))
                        {
                            if (MessageBox.Show(
                                    "Il campo " + CurrTipo["label" + suffix].ToString() +
                                    " non dovrebbe essere vuoto. Proseguo lo stesso?",
                                    "Avviso",
                                    MessageBoxButtons.YesNo) != DialogResult.Yes)
                            {
                                errfield = "value" + suffix;
                                errmess  = null;
                                return(false);
                            }
                            flagincompleto = true;
                        }
                    }
                }

                if ((CurrClass["flagnodate"].ToString().ToLower() == "n") &&
                    (R["flagnodate"].ToString().ToLower() == "n"))
                {
                    if (R["start"].ToString().Equals(""))
                    {
                        if (MessageBox.Show(
                                "Il campo datainizio non dovrebbe essere vuoto. Proseguo lo stesso?",
                                "Avviso",
                                MessageBoxButtons.YesNo) != DialogResult.Yes)
                        {
                            errfield = "start";
                            errmess  = null;
                            return(false);
                        }
                        else
                        {
                            flagincompleto = true;
                        }
                    }
                    if (R["stop"].ToString().Equals(""))
                    {
                        if (MessageBox.Show(
                                "Il campo datafine non dovrebbe essere vuoto. Proseguo lo stesso?",
                                "Avviso",
                                MessageBoxButtons.YesNo) != DialogResult.Yes)
                        {
                            errfield = "stop";
                            errmess  = null;
                            return(false);
                        }
                    }
                    else
                    {
                        flagincompleto = true;
                    }
                }

                if ((flagincompleto) && (R["tobecontinued"].ToString().ToLower() == ""))
                {
                    R["tobecontinued"] = "s";
                }
            }
            return(true);
        }
Ejemplo n.º 30
0
        public override bool IsValid(DataRow R, out string errmess, out string errfield)
        {
            if (!base.IsValid(R, out errmess, out errfield))
            {
                return(false);
            }
            //profservice§2006§34

            if (CfgFn.GetNoNullInt32(R["idser"]) <= 0)
            {
                errmess  = "Bisogna specificare la prestazione";
                errfield = "idser";
                return(false);
            }

            string    filterRitEnpals = QHS.AppAnd(QHS.CmpEq("idser", R["idser"]), QHS.CmpEq("taxkind", 3), QHS.Like("taxref", "%enpals%"));
            DataTable TRitEnpals      = Conn.RUN_SELECT("servicetaxview", "*", null, filterRitEnpals, null, false);

            if (TRitEnpals.Rows.Count > 0)
            {
                errmess = "La denuncia UNIEMENS per il compenso assoggettato ad ENPALS \n\r " +
                          "non sarà prodotta con il flusso UNIEMENS di Easy ma \n\r " +
                          "dovrà essere eventualmente effettuata direttamente dal sito \n\r " +
                          "http://www.inps.it/ . Si raccomanda di informare tempestivamente \n\r " +
                          "l'ufficio competente alla trasmissione della denuncia UNIEMENS.";
                errfield = "idser";
                MessageBox.Show(errmess, "Avviso", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }

            bool IsAdmin = (GetSys("manage_prestazioni") != null)
                            ? GetSys("manage_prestazioni").ToString() == "S"
                            : false;

            string filter_idrelated = QHC.CmpEq("idrelated", "profservice§" + R["ycon"] + "§" + R["ncon"]);
            //filter_idrelated = "(idrelated="+QueryCreator.quotedstrvalue(filter_idrelated,true)+")";

            DataTable Tserviceregistry = Conn.RUN_SELECT("serviceregistry", "*", null, filter_idrelated, null, null, true);

            if ((Tserviceregistry.Rows.Count > 0) && (R.RowState == DataRowState.Modified))
            {
                bool   error   = false;
                string message = "";
                if (R["idreg", DataRowVersion.Current].ToString() != R["idreg", DataRowVersion.Original].ToString())
                {
                    message = "Percipiente \n\r ";
                    error   = true;
                }
                if (R["description", DataRowVersion.Current].ToString() != R["description", DataRowVersion.Original].ToString())
                {
                    message = message + "Descrizione \n\r ";
                    error   = true;
                }
                if (R["start", DataRowVersion.Current].ToString() != R["start", DataRowVersion.Original].ToString())
                {
                    message = message + "Data Inizio \n\r ";
                    error   = true;
                }
                if (R["stop", DataRowVersion.Current].ToString() != R["stop", DataRowVersion.Original].ToString())
                {
                    message = message + "Data Fine \n\r ";
                    error   = true;
                }
                if (CfgFn.RoundValuta(CfgFn.GetNoNullDecimal(R["totalcost", DataRowVersion.Current])) != CfgFn.RoundValuta(CfgFn.GetNoNullDecimal(R["totalcost", DataRowVersion.Original])))
                {
                    message = message + "Lordo al beneficiario \n\r ";
                    error   = true;
                }

                if (error)
                {
                    if (IsAdmin)
                    {
                        errmess = "L'Anagrafe delle Prestazioni è stata già generata, e risultano modificati i seguenti dati: \n\r"
                                  + message + "Adeguare anche i dati dell'Incarico.";
                        MessageBox.Show(errmess, "Avviso", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    else
                    {
                        errmess = "Risultano modificati i seguenti dati: \n\r"
                                  + message + "La modifica non è consentita perché l'Anagrafe delle Prestazioni è stata già generata.\r\n" +
                                  "Contattare il servizio assistenza o un utente con ruolo 'manage_prestazioni' ";
                        return(false);
                    }
                }
            }

            //

            if (CfgFn.GetNoNullInt32(R["idreg"]) == 0)
            {
                errmess  = "Inserire il percipiente";
                errfield = "idreg";
                return(false);
            }
            if (R["description"].ToString() == "")
            {
                errmess  = "Il campo descrizione è obbligatorio.";
                errfield = "description";
                return(false);
            }
            if (R["doc"].ToString() == "")
            {
                errmess  = "Il campo documento è obbligatorio e dovrebbe contenere il rif. alla fattura.";
                errfield = "doc";
            }

            if (R["docdate"].ToString() == "")
            {
                errmess  = "Il campo data documento è obbligatorio e dovrebbe contenere la data della fattura.";
                errfield = "docdate";
            }
            //A questo controllo è stato tolto l' uguale,perchè ci sono dei casi in cui i professionisti fatturano solo spese non imponibili
            //anticipate per conto del committente quindi è possibile che l'importo della prestazione sia uguale a zero. Task 3750
            if (CfgFn.GetNoNullDecimal(R["feegross"]) < 0)
            {
                errmess  = "L'importo lordo del contratto deve essere maggiore di zero";
                errfield = "feegross";
                return(false);
            }

            DateTime dataInizio = (DateTime)R["start"];
            DateTime dataFine   = (DateTime)R["stop"];

            if (dataInizio > dataFine)
            {
                errmess  = "La data di fine deve essere identica o successiva a quella di inizio";
                errfield = "stop";
                return(false);
            }

            //Se il percipiente ha un indirizzo AP, nel form del compenso si deve scegliere o S o N
            String    codeaddress   = "07_SW_ANP";
            DateTime  DataInizio    = (DateTime)R["start"];
            object    idaddresskind = Conn.DO_READ_VALUE("address", QHS.CmpEq("codeaddress", codeaddress), "idaddress");
            DataTable Address       = DataAccess.RUN_SELECT(Conn, "registryaddress", "*", null,
                                                            QHS.AppAnd(QHS.CmpEq("idaddresskind", idaddresskind), QHS.CmpEq("idreg", R["idreg"]),
                                                                       QHS.CmpLe("start", DataInizio), QHS.NullOrGe("stop", DataInizio)), false);

            if (Address.Rows.Count > 0)
            {
                if ((R["authneeded"].ToString() != "S") && (R["authneeded"].ToString() != "N"))
                {
                    errfield = "authneeded";
                    errmess  = "Il percipiente ha un indirizzo Anagrafe delle Prestazioni, pertanto va indicato se necessita o meno dell'autorizzazione.";
                    return(false);
                }
            }
            if (R["authneeded"].ToString() == "S" && R["authdoc"].ToString() == "")
            {
                errmess  = "Il campo 'Documento' è obbligatorio";
                errfield = "authdoc";
                return(false);
            }

            if (R["authneeded"].ToString() == "S" && R["authdocdate"] == DBNull.Value)
            {
                errmess  = "Il campo 'data' è obbligatorio";
                errfield = "authdocdate";
                return(false);
            }

            if (R["authneeded"].ToString() == "N" && R["noauthreason"].ToString() == "")
            {
                errmess  = "Il campo 'Motivo' è obbligatorio";
                errfield = "authdoc";
                return(false);
            }


            if ((R.RowState == DataRowState.Added) && (!RowChange.IsAutoIncrement(R.Table.Columns["ncon"])))
            {
                string filterProfService = QHS.AppAnd(QHS.CmpEq("ycon", R["ycon"]),
                                                      QHS.CmpEq("ncon", R["ncon"]));
                int NPRESENT = Conn.RUN_SELECT_COUNT("profservice", filterProfService, true);
                if (NPRESENT > 0)
                {
                    errmess  = "Esiste già un contratto con lo stesso numero.";
                    errfield = "ncon";
                    return(false);
                }
            }
            //Se il DS contiene la tabella registry, controlla che l'idreg abbia il CF,se SI chiama il metodo.
            if (R.Table.DataSet.Tables.Contains("registry") && (R.Table.DataSet.Tables["registry"].Rows.Count > 0))
            {
                DataRow Registry = R.Table.DataSet.Tables["registry"].Rows[0];
                if (Registry["cf"] != DBNull.Value)
                {
                    string errori;
                    if (!CalcolaCodiceFiscale.CodiceFiscaleValido(this.Conn, Registry, out errori))
                    {
                        errmess = "Il Codice Fiscale non è valido!\n" + errori;
                        return(false);
                    }
                }
            }
            else
            {
                //Se il DS non contiene la tabella registry,controlla che l'idreg abbia il CF se SI legge la riga dal DB
                // e chiama il metodo.
                object CF = Conn.DO_READ_VALUE("registry", QHS.CmpEq("idreg", R["idreg"]), "cf");
                if (CF != DBNull.Value)
                {
                    DataTable TRegistry = Conn.RUN_SELECT("registry", "*", null, QHS.CmpEq("idreg", R["idreg"]), null, null, true);
                    if (TRegistry.Rows.Count > 0)
                    {
                        DataRow Registry = TRegistry.Rows[0];
                        string  errori;
                        if (!CalcolaCodiceFiscale.CodiceFiscaleValido(this.Conn, Registry, out errori))
                        {
                            errmess = "Il Codice Fiscale non è valido!\n" + errori;
                            return(false);
                        }
                    }
                }
            }
            return(true);
        }