/// <summary> /// Adds new user role. /// </summary> protected void frmRole_ItemInserting(object sender, FormViewInsertEventArgs e) { if (Page.IsValid) { GroupDAO gd = new GroupDAO(); string nazwa = ((TextBox)frmRole.FindControl("txtNazwa")).Text; string skrot = ((TextBox)frmRole.FindControl("txtSkrot")).Text; gd.CreateGroup(nazwa, skrot, false, 0); gvGroupsList.DataBind(); frmRole.ChangeMode(FormViewMode.ReadOnly); frmRole.Visible = false; } }
/// <summary> /// Adds new users group. /// </summary> protected void frmGroup_ItemInserting(object sender, FormViewInsertEventArgs e) { if (Page.IsValid) { GroupDAO gd = new GroupDAO(); string nazwa = ((TextBox)frmGroup.FindControl("txtNazwa")).Text; string skrot = ((TextBox)frmGroup.FindControl("txtSkrot")).Text; int idRodzica = int.Parse(((DropDownList)frmGroup.FindControl("ddlParentGroup")).SelectedItem.Value); gd.CreateGroup(nazwa, skrot, true, idRodzica); gvGroupsList.DataBind(); frmGroup.ChangeMode(FormViewMode.ReadOnly); frmGroup.Visible = false; } }