Пример #1
0
        private void FillTable(int id)
        {
            ViewState["IDMenu"] = id;
            DataSet ds;

            ds = DatabaseConnection.CreateDataset("SELECT * FROM TUSTENAMENU_VIEW WHERE ID=" + id + " AND (" + (int)UC.Modules + " & MODULES)=MODULES");
            DataRow dr = ds.Tables[0].Rows[0];

            MenuText.Text = Root.rm.GetString("Menutxt" + dr["rmvalue"].ToString());
            string[] arryD = dr["accessgroup"].ToString().Split('|');
            dr.Delete();
            ds.Clear();
            string query = String.Empty;

            foreach (string ut in arryD)
            {
                query += "ID=" + ut + " OR ";
            }
            query = query.Substring(7, query.Length - 17);
            ListDip.DataTextField  = "Description";
            ListDip.DataValueField = "id";
            ListDip.DataSource     = DatabaseConnection.CreateDataset("SELECT * FROM GROUPS WHERE " + query);
            ListDip.DataBind();
        }
Пример #2
0
        private void FillTable(string id)
        {
            ViewState["IDGroup"] = id;
            DataSet ds;

            ds = DatabaseConnection.CreateDataset("SELECT * FROM GROUPS WHERE ID=" + id);
            DataRow dr = ds.Tables[0].Rows[0];

            GroupText.Text = dr["Description"].ToString();
            string[] arryD = dr["Dependency"].ToString().Split('|');
            dr.Delete();
            ds.Clear();
            string query = String.Empty;

            foreach (string ut in arryD)
            {
                query += "ID=" + ut + " OR ";
            }
            query = query.Substring(7, query.Length - 17);
            ListDip.DataTextField  = "Description";
            ListDip.DataValueField = "id";
            ListDip.DataSource     = DatabaseConnection.CreateDataset("SELECT * FROM GROUPS WHERE " + query);
            ListDip.DataBind();
        }