Exemplo n.º 1
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));
        }
Exemplo n.º 2
0
        public int GetImpersonatedAuthAgency(DataAccess Conn)
        {
            QueryHelper QHS;
            string      idflowchart;

            if (Conn.GetSys("idflowchart") == null && Conn.GetSys("idflowchart").ToString() == "")
            {
                return(0);
            }

            // lookup idauthagency from idflowchart
            idflowchart = Conn.GetSys("idflowchart").ToString();
            QHS         = Conn.GetQueryHelper();
            string filter;

            filter = QHS.CmpEq("idflowchart", idflowchart);
            DataTable DT = Conn.RUN_SELECT("flowchartauthagency", "*", null, filter, null, false);

            if (DT == null || DT.Rows.Count == 0)
            {
                return(0);
            }

            return(CfgFn.GetNoNullInt32(DT.Rows[0]["idauthagency"]));
        }
Exemplo n.º 3
0
        public void FillManagerData()
        {
            string idman = Request.Form["txtidman"];

            if (idman == null || idman == "")
            {
                lblError.Text = "";
                return;
            }
            string      filter;
            DataAccess  Conn = (DataAccess)Session["DBUserConn"];
            QueryHelper QHS;

            QHS = Conn.GetQueryHelper();

            filter = QHS.CmpEq("idman", idman);

            DataTable DT = Conn.RUN_SELECT("manager", "*", null, filter, null, false);

            if (DT == null || DT.Rows.Count == 0)
            {
                lblError.Text = "Problema sul DB di sistema.";
                return;
            }

            txtlogin.Text = DT.Rows[0]["userweb"].ToString();
            txtidman.Text = "";


            return;
        }
Exemplo n.º 4
0
        public void FillCustomUserData()
        {
            string idcustomuser = Request.Form["txtidcustomuser"];

            if (idcustomuser == null || idcustomuser == "")
            {
                lblError.Text = "";
                return;
            }
            string      filter;
            DataAccess  Conn = (DataAccess)Session["DBUserConn"];
            QueryHelper QHS;

            QHS = Conn.GetQueryHelper();

            filter = QHS.CmpEq("idcustomuser", idcustomuser);
            DataTable DT = Conn.RUN_SELECT("customuser", "*", null, filter, null, false);

            if (DT == null || DT.Rows.Count == 0)
            {
                lblError.Text = "Problema sul DB di sistema.";
                return;
            }

            txtcustuser.Text = DT.Rows[0]["idcustomuser"].ToString();
            if (Request.Form["userkind"].ToString() == "3")
            {
                txtlogin.Text = DT.Rows[0]["username"].ToString();
            }


            txtidcustomuser.Text = "";
        }
Exemplo n.º 5
0
        public void FillRegistryData()
        {
            string idregistryreference = Request.Form["txtidregistryreference"];

            if (idregistryreference == null || idregistryreference == "")
            {
                lblError.Text = "";
                return;
            }
            string filter;

            string[] arr = idregistryreference.Split('|');

            string idreg    = arr[0];
            string idregref = arr[1];

            DataAccess  Conn = (DataAccess)Session["DBUserConn"];
            QueryHelper QHS;

            QHS = Conn.GetQueryHelper();

            filter = QHS.AppAnd(QHS.CmpEq("idregistryreference", idregref), QHS.CmpEq("idreg", idreg));

            DataTable DT = Conn.RUN_SELECT("registryreference", "*", null, filter, null, false);

            if (DT == null || DT.Rows.Count == 0)
            {
                lblError.Text = "Problema sul DB di sistema.";
                return;
            }

            txtlogin.Text = DT.Rows[0]["userweb"].ToString();
            txtidregistryreference.Text = "";
            return;
        }
Exemplo n.º 6
0
        //string[] mykey = new string[] { "idcsa_import", "idcsa_agency"};
        //public override string[] primaryKey() {
        //    return mykey;
        //}
        public override string GetStaticFilter(string ListingType)
        {
            string filteresercizio;
            string filtertipo = "";

            filteresercizio = QHS.CmpEq("yimport", GetSys("esercizio"));
            if (ListingType == "versamentiannuali")
            {
                return(filteresercizio);
            }
            //switch (ListingType) {
            //    case "ritenuta":
            //        filtertipo = QHS.CmpEq("kind", "Ritenuta");
            //        break;
            //    case "contributo":
            //        filtertipo = QHS.CmpEq("kind", "Contributo");
            //        break;
            //    case "recupero":
            //        filtertipo = QHS.CmpEq("kind","Recupero");
            //        break;
            //    case "versamentiannuali":
            //        filtertipo = QHS.CmpEq("kind", "Voce CSA");
            //        break;
            //}

            if (ListingType == "versamentiannuali")
            {
                return(QHS.AppAnd(filteresercizio));
            }

            return(base.GetStaticFilter(ListingType));
        }
Exemplo n.º 7
0
        public override DataRow SelectByCondition(string filter, string searchtable)
        {
            if (edit_type == "treealle" || edit_type == "treealls" ||
                edit_type == "treeallenew" || edit_type == "treeallsnew"
                )
            {
                return(base.SelectByCondition(filter, "finview"));
            }

            //string filternoupb= removefilterupb(filter);
            //int ResultCount = Conn.RUN_SELECT_COUNT("finusable", filternoupb, true);

            int ResultCount = Conn.RUN_SELECT_COUNT("finview", QHS.AppAnd(filter, QHS.CmpEq("flagusable", "S")), true);

            if (ResultCount != 1)
            {
                return(null);
            }

            DataTable T2 = Conn.RUN_SELECT("finview", null, null, filter, null, true);

            if (T2 == null)
            {
                return(null);
            }
            if (T2.Rows.Count == 0)
            {
                return(null);
            }
            return(CheckSelectRow(T2.Rows[0]));
        }
Exemplo n.º 8
0
        public override void SetDefaults(DataTable PrimaryTable)
        {
            base.SetDefaults(PrimaryTable);
            SetDefault(PrimaryTable, "ypro", GetSys("esercizio").ToString());
            SetDefault(PrimaryTable, "adate", GetSys("datacontabile"));
            //DataTable TT = Conn.RUN_SELECT("config","flagfruitful",null,
            //    "(ayear="+QueryCreator.quotedstrvalue(GetSys("esercizio"),false)+ ")",null,false);
            //int flag = CfgFn.GetNoNullInt32(PrimaryTable.Columns["flag"].DefaultValue);
            //if ((TT.Rows.Count != 0) && (TT != null)) {
            //    flag = flag & 0xF7;
            //    if (TT.Rows[0]["flagfruitful"].ToString().ToUpper() == "F") {
            //        flag = flag + 0x08;  //def. Fruttifero
            //    }
            //    SetDefault(PrimaryTable,"flag", flag);
            //}
            if (flagautostampa == null)
            {
                flagautostampa = Conn.DO_READ_VALUE("config",
                                                    QHS.CmpEq("ayear", GetSys("esercizio")),
                                                    "proceeds_flagautoprintdate");
            }

            if ((flagautostampa != null) && (flagautostampa.ToString().ToUpper() == "S"))
            {
                SetDefault(PrimaryTable, "printdate", GetSys("datacontabile"));
            }
        }
Exemplo n.º 9
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);
        }
Exemplo n.º 10
0
        private string veroTipoFatturaAv(object idInvKind)
        {
            if (veroTipo.ContainsKey(idInvKind.ToString()))
            {
                return(veroTipo[idInvKind.ToString()]);
            }
            string    filterreg  = QHS.CmpEq("idinvkind", idInvKind);
            DataTable invRegKind = Conn.RUN_SELECT("invoicekindregisterkind", "*", null, filterreg, null, false);

            DataRow[] registerToLink = invRegKind.Select();
            bool      acquisto       = false;

            foreach (DataRow iReg in registerToLink)
            {
                object regClass = Conn.DO_READ_VALUE("ivaregisterkind",
                                                     QHS.CmpEq("idivaregisterkind", iReg["idivaregisterkind"]),
                                                     "registerclass");
                if (regClass.ToString().ToUpper() == "A")
                {
                    acquisto = true;
                }
            }
            veroTipo[idInvKind.ToString()] = (acquisto ? "A" : "V");
            return(veroTipo[idInvKind.ToString()]);
        }
Exemplo n.º 11
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);
        }
Exemplo n.º 12
0
        public override DataRow SelectByCondition(string filter, string searchtable)
        {
            if (edit_type == "treeall")
            {
                return(base.SelectByCondition(filter, "account"));
            }
            int ResultCount = 0;

            if (edit_type == "treeminusable")
            {
                string filterenablebudgetprev = QHS.NullOrEq("flagenablebudgetprev", "S");
                filter      = QHS.AppAnd(filter, filterenablebudgetprev);
                ResultCount = Conn.RUN_SELECT_COUNT("accountminusable", filter, true);
            }
            else
            {
                ResultCount = Conn.RUN_SELECT_COUNT("accountusable", filter, true);
            }

            if (ResultCount != 1)
            {
                return(null);
            }
            DataTable T2 = Conn.RUN_SELECT("account", null, null, filter, null, true);

            if (T2 == null)
            {
                return(null);
            }
            if (T2.Rows.Count == 0)
            {
                return(null);
            }
            return(CheckSelectRow(T2.Rows[0]));
        }
Exemplo n.º 13
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));
        }
Exemplo n.º 14
0
        public override string GetStaticFilter(string ListingType)
        {
            string filteresercizio;
            string filtertipo = "";

            filteresercizio = QHS.CmpEq("ayear", GetSys("esercizio"));
            if (ListingType == "elenco")
            {
                return(filteresercizio);
            }
            switch (ListingType)
            {
            case "ritenuta":
                filtertipo = QHS.CmpEq("kind", "Ritenuta");
                break;

            case "contributo":
                filtertipo = QHS.CmpEq("kind", "Contributo");
                break;

            case "recupero":
                filtertipo = QHS.CmpEq("kind", "Recupero");
                break;
            }

            if ((ListingType == "ritenuta") || (ListingType == "contributo") || (ListingType == "recupero"))
            {
                return(QHS.AppAnd(filteresercizio, filtertipo));
            }

            return(base.GetStaticFilter(ListingType));
        }
Exemplo n.º 15
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);
        }
Exemplo n.º 16
0
        public override void SetDefaults(DataTable PrimaryTable)
        {
            base.SetDefaults(PrimaryTable);
            SetDefault(PrimaryTable, "flag", 0);
            //SetDefault(PrimaryTable, "fulfilled", "N");
            //SetDefault(PrimaryTable, "autotaxflag", "N");
            //SetDefault(PrimaryTable, "autoclawbackflag", "N");

            object idTrattamentoSpesePred = Conn.DO_READ_VALUE("chargehandling", QHS.BitSet("flag", 1), "idchargehandling");

            if ((idTrattamentoSpesePred != null) && (PrimaryTable.Columns.Contains("idchargehandling")))
            {
                SetDefault(PrimaryTable, "idchargehandling", idTrattamentoSpesePred);
            }

            if (PrimaryTable.ExtendedProperties["app_default"] != null)
            {
                Hashtable H = (Hashtable)PrimaryTable.ExtendedProperties["app_default"];
                foreach (string field in new string[] { "idexp", "iban",
                                                        "iddeputy", "refexternaldoc",
                                                        "idregistrypaymethod", "idpaymethod",
                                                        "idbank", "idcab", "cin", "cc", "paymentdescr", "biccode", "extracode",
                                                        "paymethod_allowdeputy", "paymethod_flag", "flag", "idchargehandling" })
                {
                    if ((H[field] != null) && (H[field] != DBNull.Value) && (PrimaryTable.Columns.Contains(field)))
                    {
                        SetDefault(PrimaryTable, field, H[field]);
                    }
                }
                return;
            }
        }
Exemplo n.º 17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string idlist = Request.QueryString["idlist"];

        if (idlist == null || idlist == "")
        {
            return;
        }

        DataAccess  Conn = GetVars.GetUserConn(Page);
        QueryHelper QHS;

        QHS = Conn.GetQueryHelper();
        string    filter = QHS.CmpEq("idlist", idlist);
        DataTable DT     = Conn.RUN_SELECT("list", "pic,picext", null, filter, null, false);

        if (DT.Rows.Count == 0)
        {
            return;
        }
        DataRow DR = DT.Rows[0];

        if (DR["pic"].Equals(DBNull.Value))
        {
            return;
        }
        string fileext = DR["picext"].ToString();

        Page.Response.ContentType = "image/" + fileext;
        Page.Response.BinaryWrite((byte[])DR["pic"]);

        Page.Response.End();
    }
Exemplo n.º 18
0
    public override void AfterLink(bool firsttime, bool formToLink)
    {
        fintree.SelectedNodeStyle.BackColor = System.Drawing.Color.Gray;

        Meta.CanSave       = false;
        Meta.CanInsert     = false;
        Meta.SearchEnabled = false;
        fintree.Tag        = "finview." + Meta.edit_type;
        string param           = Meta.ExtraParameter as string;
        string filterEsercizio = QHS.CmpEq("ayear", Meta.GetSys("esercizio"));
        string filter          = GetData.MergeFilters(filterEsercizio, param);
        string oldfilter       = GetData.MergeFilters(null, DS.finlevel);

        if (oldfilter == null)
        {
            GetData.SetStaticFilter(DS.finlevel, filterEsercizio);
        }



        GetData.CacheTable(DS.finlevel);

        if (Meta.edit_type != "treeeupbnew" && Meta.edit_type != "treesupbnew")
        {
            GetData.SetStaticFilter(DS.finview, filter);
        }

        GetData.SetSorting(DS.finview, "printingorder");
    }
Exemplo n.º 19
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);
        }
Exemplo n.º 20
0
 void SetCodice()
 {
     //MetaData Meta = MetaData.GetMetaData(this);
     if (Meta.EditMode)
     {
         return;
     }
     btnCodice.Enabled  = (cmbTipo.SelectedIndex > 0);
     txtCodice.ReadOnly = (cmbTipo.SelectedIndex <= 0);
     if (cmbTipo.SelectedIndex <= 0)
     {
         txtCodice.Text      = "";
         txtDescrizione.Text = "";
     }
     else
     {
         string filter = QHS.CmpEq("idsorkind", cmbTipo.SelectedValue);
         btnCodice.Tag = "manage.sorting.tree." + filter;
         //label per il form di selezione della voce di classificazione +"."+ filtro
         DS.sorting.ExtendedProperties[MetaData.ExtraParams] = filter;
         //AutoManage.txtCodiceClass.tree
         gboxclass.Tag = "AutoManage.txtCodice.tree." + filter;
         MetaData.GetMetaData(this).SetAutoMode(gboxclass);
     }
 }
Exemplo n.º 21
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);
        }
Exemplo n.º 22
0
 public Class_SelectionManager(MetaData Meta, TextBox TxtCode, TextBox TxtTitle, object idsorkind)
     :
     base(Meta, TxtCode, "sortcode", "idsor", "sorting")
 {
     this.TTitle    = TxtTitle;
     this.idsorkind = idsorkind;
     SetFilter(QHS.CmpEq("idsorkind", idsorkind));
 }
Exemplo n.º 23
0
 public override string GetStaticFilter(string ListingType)
 {
     if (ListingType == "default")
     {
         return(QHS.CmpEq("yvar", GetSys("esercizio")));
     }
     return(base.GetStaticFilter(ListingType));
 }
Exemplo n.º 24
0
 public override string GetStaticFilter(string ListingType)
 {
     if (ListingType == "lista")
     {
         return(QHS.CmpEq("ypro", Conn.GetSys("esercizio")));
     }
     return(base.GetStaticFilter(ListingType));
 }
Exemplo n.º 25
0
 public override void SetDefaults(DataTable PrimaryTable)
 {
     base.SetDefaults(PrimaryTable);
     SetDefault(PrimaryTable, "extraallowance", 0.0);
     SetDefault(PrimaryTable, "advancepercentage", 0.0);
     SetDefault(PrimaryTable, "idcurrency", Conn.DO_READ_VALUE("currency", QHS.CmpEq("codecurrency", "EUR"), "idcurrency"));
     SetDefault(PrimaryTable, "exchangerate", 1.0);
     SetDefault(PrimaryTable, "flag_geo", "I");
 }
Exemplo n.º 26
0
 public override string GetStaticFilter(string ListingType)
 {
     if ((ListingType == "default") || (ListingType == "tree") || (ListingType == "treall"))
     {
         string filteresercizio = QHS.CmpEq("ayear", GetSys("esercizio"));
         return(filteresercizio);
     }
     return(base.GetStaticFilter(ListingType));
 }
Exemplo n.º 27
0
 public override string GetStaticFilter(string ListingType)
 {
     if (ListingType == "listaestesa")
     {
         string filteresercizio = QHS.CmpEq("yentry", GetSys("esercizio"));
         return(filteresercizio);
     }
     return(base.GetStaticFilter(ListingType));
 }
Exemplo n.º 28
0
        private static int GetMaxNpro_Treasurer(DataRow R, DataAccess Conn)
        {
            QueryHelper QHS;

            QHS = Conn.GetQueryHelper();
            var    qhc         = new CQueryHelper();
            object idtreasurer = R["idtreasurer"];

            if ((idtreasurer == DBNull.Value) || (CfgFn.GetNoNullInt32(idtreasurer) == 0))
            {
                return(-1);
            }
            object flagautondoc_treasurer = null;

            if (enable_ndoc_treasurers.ContainsKey((int)idtreasurer))
            {
                flagautondoc_treasurer = enable_ndoc_treasurers[(int)idtreasurer];
            }
            else
            {
                if (R.Table.DataSet.Tables.Contains("treasurer") &&
                    R.Table.DataSet.Tables["treasurer"].Columns.Contains("enable_ndoc_treasurer")
                    )
                {
                    DataTable ttr     = R.Table.DataSet.Tables["treasurer"];
                    var       foundTr = ttr.Select(qhc.CmpEq("idtreasurer", idtreasurer));
                    if (foundTr.Length > 0)
                    {
                        flagautondoc_treasurer = foundTr[0]["enable_ndoc_treasurer"];
                        enable_ndoc_treasurers[(int)idtreasurer] = flagautondoc_treasurer;
                    }
                }
            }

            if (flagautondoc_treasurer == null)
            {
                flagautondoc_treasurer = Conn.DO_READ_VALUE("treasurer", QHS.CmpEq("idtreasurer", idtreasurer),
                                                            "enable_ndoc_treasurer");
                enable_ndoc_treasurers[(int)idtreasurer] = flagautondoc_treasurer;
            }

            if ((flagautondoc_treasurer != null) && (flagautondoc_treasurer != DBNull.Value) &&
                (flagautondoc_treasurer.ToString().ToUpper() == "S"))
            {
                int numiniziale = 0;

                string sqlmax = "SELECT ISNULL(MAX(npro_treasurer)," + numiniziale.ToString() +
                                ") + 1 FROM proceeds WHERE "
                                + QHS.AppAnd(QHS.CmpEq("idtreasurer", idtreasurer), QHS.CmpEq("ypro", R["ypro"]));

                DataTable t = Conn.SQLRunner(sqlmax, true, 0);
                return(CfgFn.GetNoNullInt32(t.Rows[0][0]));
            }

            return(-1);
        }
Exemplo n.º 29
0
        override public DataRow Get_New_Row(DataRow ParentRow, DataTable T)
        {
            if (edit_type == "default")
            {
                if (ParentRow != null)
                {
                    SetDefault(T, "idfin", ParentRow["idfin"]);
                    SetDefault(T, "paridfin", ParentRow["paridfin"]);
                    SetDefault(T, "codefin", ParentRow["codefin"]);
                    SetDefault(T, "finance", ParentRow["finance"]);
                }
            }
            if (edit_type == "previsionupb")
            {
                if (ParentRow != null)
                {
                    SetDefault(T, "idfin", ParentRow["idfin"]);
                    SetDefault(T, "paridfin", ParentRow["paridfin"]);
                    SetDefault(T, "codefin", ParentRow["codefin"]);
                    SetDefault(T, "finance", ParentRow["title"]);
                    SetDefault(T, "flag", ParentRow["flag"]);
                    SetDefault(T, "nlevel", ParentRow["nlevel"]);

                    int    flag    = CfgFn.GetNoNullInt32(ParentRow["flag"]);
                    object finpart = DBNull.Value;
                    if ((flag & 1) == 1)
                    {
                        finpart = "S";
                    }
                    else
                    {
                        finpart = "E";
                    }
                    SetDefault(T, "finpart", finpart);

                    string filterfinlevel = QHS.AppAnd(QHS.CmpEq("ayear", Conn.GetSys("esercizio")), QHS.CmpEq("nlevel", ParentRow["nlevel"]));
                    object leveldescr     = Conn.DO_READ_VALUE("finlevel", filterfinlevel, "description");
                    SetDefault(T, "leveldescr", leveldescr);
                }
            }

            if (edit_type == "previsionfin")
            {
                if (ParentRow != null)
                {
                    SetDefault(T, "idupb", ParentRow["idupb"]);
                    SetDefault(T, "paridupb", ParentRow["paridupb"]);
                    SetDefault(T, "codeupb", ParentRow["codeupb"]);
                    SetDefault(T, "upb", ParentRow["title"]);
                }
            }

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

            return(R);
        }
Exemplo n.º 30
0
        public DataTable getContrattiConProblemi()
        {
            string query = @"--select * from tablename where oldtable='service'
--select * from colname where oldcol='rec770kind'
--più di un parasubcontract non conguagliato per lo stesso creditore
	select distinct ce1.idcon
	from payroll ce1 
	join parasubcontract co1 on ce1.flagbalance='S' and ce1.idcon=co1.idcon and ce1.disbursementdate is null and fiscalyear="     + GetSys("esercizio") + @"
	join payroll ce2 on ce2.flagbalance='S' and ce1.idpayroll<>ce2.idpayroll and ce2.disbursementdate is null and ce2.fiscalyear=ce1.fiscalyear
	join parasubcontract co2 on ce2.idcon=co2.idcon and co1.idreg=co2.idreg
union
--contratti con cud che puntano allo stesso altro parasubcontract
	select cud1.idcon
	from exhibitedcud cud1
	join parasubcontractyear on parasubcontractyear.idcon=cud1.idcon and ayear="     + QHS.quote(GetSys("esercizio")) + @"
	join exhibitedcud cud2
		on cud1.idlinkedcon=cud2.idlinkedcon and (cud1.idcon<>cud2.idcon or cud1.idexhibitedcud<>cud2.idexhibitedcud)
union
--contratti che non puntano ad un parasubcontract precedente
	select c1.idcon
	from parasubcontract c1
	join parasubcontractyear ic1 on c1.idcon=ic1.idcon and ic1.ayear="     + QHS.quote(GetSys("esercizio")) + @"
	join payroll on flagbalance='S' and disbursementdate is not null and fiscalyear=ic1.ayear and payroll.idcon<>c1.idcon
    JOIN service ON service.idser = c1.idser
	join parasubcontract c2 on c2.idcon=payroll.idcon and c2.idreg=c1.idreg
	where not exists (select * from exhibitedcud where exhibitedcud.idlinkedcon=payroll.idcon)
    AND ISNULL(service.certificatekind,'') = 'U'
	and (not exists (select * from payroll c2 where c2.idcon=c1.idcon and flagbalance='S' and disbursementdate is not null)
	or exists (select * from exhibitedcud cp where cp.idcon=c1.idcon))
union
--contratti conguagliati che hanno cud che non puntano a nulla
	select distinct exhibitedcud.idcon
	from exhibitedcud
	where idlinkedcon is null and exhibitedcud.fiscalyear="     + QHS.quote(GetSys("esercizio")) + @"
	and (cfotherdeputy is null or cfotherdeputy=
	(select cf from license))
union
--contratti dello stesso creditore tutti conguagliati e senza cud
select c1.idcon from parasubcontract c1
join parasubcontractyear i1 on c1.idcon=i1.idcon and ayear=" + QHS.quote(GetSys("esercizio")) + @"
where not exists (
	select * from parasubcontract c2 join payroll 
	on payroll.idcon=c2.idcon and payroll.fiscalyear=i1.ayear and c2.idreg=c1.idreg and payroll.flagbalance='S' 
	and (payroll.disbursementdate is null or exists (select * from exhibitedcud where exhibitedcud.idcon=c2.idcon))
) and (select count(*) from parasubcontract c3 join parasubcontractyear i3 on c3.idcon=i3.idcon and i3.ayear=i1.ayear and c3.idreg=c1.idreg)>1
union
--contratti di creditori che erano stati pagati col wizard
	select distinct idcon from parasubcontract
	join expense on parasubcontract.idreg=expense.idreg
	join service on expense.idser=service.idser and rec770kind='G'
	join expenseyear on expense.idexp=expenseyear.idexp and expenseyear.ayear="     + GetSys("esercizio") + @"
	join expensetax on expense.idexp=expensetax.idexp
	and not exists (select * from expensepayroll where expense.idexp like idexp+'%')"    ;

            return(Conn.SQLRunner(query));
        }