Esempio n. 1
0
        private void cmdAddRole_Click(object sender, EventArgs e)
        {
            Action <String> callback = delegate(String text)
            {
                DataRow newR = roles.Tables[0].NewRow();
                newR["name"] = text;
                roles.Tables[0].Rows.Add(newR);

                _roles_adapter.Update(roles.Tables[0]);
                newR["id_role"] = (int)new SqlQuery("SELECT id_role FROM [BOBBY_TABLES].ROLES WHERE name = '" + text + "';").ExecuteScalar();;
                roles.AcceptChanges();
            };

            Form nForm = new frmAddNew("Add Role", callback);

            nForm.Owner = this;
            nForm.ShowDialog();
        }
Esempio n. 2
0
        private void cmdAddFeature_Click(object sender, EventArgs e)
        {
            Action <String> callback = delegate(String text)
            {
                DataRow newR = features.Tables[0].NewRow();
                newR["descr"] = text;
                features.Tables[0].Rows.Add(newR);

                _features_adapter.Update(features.Tables[0]);
                newR["id_feature"] = (int)new SqlQuery("SELECT id_feature FROM [BOBBY_TABLES].FEATURES WHERE descr = '" + text + "';").ExecuteScalar();;
                features.AcceptChanges();
            };

            Form nForm = new frmAddNew("Add Feature", callback);

            nForm.Owner = this;
            nForm.ShowDialog();
            this.cboActiveRole_SelectedIndexChanged(new object(), new EventArgs());
        }
Esempio n. 3
0
        private void cmdAddFeature_Click(object sender, EventArgs e)
        {
            Action<String> callback = delegate(String text)
            {
                DataRow newR = features.Tables[0].NewRow();
                newR["descr"] = text;
                features.Tables[0].Rows.Add(newR);

                _features_adapter.Update(features.Tables[0]);
                newR["id_feature"] = (int)new SqlQuery("SELECT id_feature FROM [BOBBY_TABLES].FEATURES WHERE descr = '" + text + "';").ExecuteScalar(); ;
                features.AcceptChanges();
            };

            Form nForm = new frmAddNew("Add Feature", callback);
            nForm.Owner = this;
            nForm.ShowDialog();
            this.cboActiveRole_SelectedIndexChanged(new object(), new EventArgs());
        }
Esempio n. 4
0
        private void cmdAddRole_Click(object sender, EventArgs e)
        {

            Action<String> callback = delegate(String text)
            {
                DataRow newR = roles.Tables[0].NewRow();
                newR["name"] = text;
                roles.Tables[0].Rows.Add(newR);

                _roles_adapter.Update(roles.Tables[0]);
                newR["id_role"] = (int)new SqlQuery("SELECT id_role FROM [BOBBY_TABLES].ROLES WHERE name = '" + text + "';").ExecuteScalar(); ;
                roles.AcceptChanges();
            };

            Form nForm = new frmAddNew("Add Role", callback);
            nForm.Owner = this;
            nForm.ShowDialog();
        }