コード例 #1
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]));
        }
コード例 #2
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);
        }
コード例 #3
0
    public void FillShowcases()
    {
        DataTable TStore = Conn.RUN_SELECT("store", "*", null,
                                           QHS.AppAnd(QHS.NullOrEq("active", "S"), Conn.Security.SelectCondition("store", true)),
                                           null, false);

        //DataTable DT = DataAccess.RUN_SELECT(Conn, "showcase", "*", "title asc", null, false);
        string Query = " SELECT showcase.idshowcase as idshowcase, showcase.idstore as idstore, showcase.title as title FROM showcase JOIN store ";

        Query += " on (showcase.idstore = store.idstore) WHERE store.active='S'";

        DataTable DT = Conn.SQLRunner(Query);

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

        //Cancella le vetrine non associate a magazzini autorizzati
        foreach (DataRow r in DT.Select())
        {
            string search = QHS.CmpEq("idstore", r["idstore"]);
            if (TStore.Select(search).Length > 0)
            {
                continue;
            }
            r.Delete();
        }
        DT.AcceptChanges();


        foreach (DataRow DR in DT.Rows)
        {
            string   Label   = DR["title"].ToString();
            string   id      = DR["idshowcase"].ToString();
            string   idstore = DR["idstore"].ToString();
            hwButton HB      = new hwButton();
            HB.ID       = "btnShowcase_" + id + "_" + idstore;
            HB.CssClass = "showcasebutton";

            /*
             * HB.Style.Add("border", "0px");
             * HB.Style.Add("background-color", "white");
             * HB.Style.Add("cursor", "hand");
             * HB.Style.Add();
             */
            HB.Tag  = "showcase." + id + "." + idstore;
            HB.Text = Label;

            showcases.Controls.Add(HB);
            HtmlGenericControl br = new HtmlGenericControl("br");
            showcases.Controls.Add(br);
        }
    }
コード例 #4
0
        public override string GetStaticFilter(string ListingType)
        {
            int eserc = CfgFn.GetNoNullInt32(GetSys("esercizio"));

            return(QHS.NullOrEq("ayear", eserc));
        }