Esempio n. 1
0
        public override string[,] Sel(ref int Arows)
        {
            string sql;
            int i=0;
            CatVsel workDS;

            // get the first suiteable title and return it
            workDS = new CatVsel();
            sql = String.Format("Select * from tdbadmin.tdbv_catsel where s_id = {0} order by bez", tdb.User.Ulangid);
            FillDS(workDS, sql, new string[] { "tdbv_catsel" });
            Arows = workDS.tdbv_catsel.Rows.Count;
            string[,] result = new string[Arows, 2];
            foreach (CatVsel.tdbv_catselRow Rwork in workDS.tdbv_catsel)
            {
                result[i,0] = Convert.ToString(Rwork.CAT_ID);
                result[i,1] = Rwork.BEZ;
                i++;
            }
            return(result);
        }
Esempio n. 2
0
File: Gcat.cs Progetto: oeli/yafra
        public void SetCombo(System.Windows.Forms.ComboBox Acombo)
        {
            DataTable workDT = new DataTable();
            DataRow row;
            CatVsel workDS;

            workDT.Columns.Add("id", typeof(int));
            workDT.Columns.Add("desc");

            workDS = new CatVsel();
            FillDS(workDS, selectionsql, new string[] { "tdbv_catsel" });
            foreach (CatVsel.tdbv_catselRow Rwork in workDS.tdbv_catsel)
            {
                row = workDT.NewRow();
                row["id"]   = Rwork.CAT_ID;
                row["desc"] = Rwork.BEZ;
                workDT.Rows.Add(row);
            }
            if (optional == true)
            {
                row = workDT.NewRow();
                row["id"]   = (int)-1;
                row["desc"] = "";
                workDT.Rows.Add(row);
            }
            Acombo.DataSource  = workDT;
            Acombo.DisplayMember = "desc";
            Acombo.ValueMember  = "id";
        }
Esempio n. 3
0
        public override string GetBez(int Aid)
        {
            string sql;
            CatVsel workDS;

            // get the first suiteable title and return it
            workDS = new CatVsel();
            sql = String.Format("Select * from tdbadmin.tdbv_catsel where cat_id = {0} and s_id = {1}", Aid, tdb.User.Ulangid);
            FillDS(workDS, sql, new string[] { "tdbv_catsel" });
            CatVsel.tdbv_catselRow Rwork = workDS.tdbv_catsel[0];
            id = Rwork.CAT_ID;
            return(Rwork.BEZ);
        }