public override void UserControlLoad() { SetEmptyValues(); ClearResultContext(this.lbResultContext); this.currentEntity = this.ownerPage.AdminClientRef.GetGroupByID(Convert.ToInt32(this.CurrentEntityMasterID)); if (this.currentEntity != null) { this.hdnRowMasterKey.Value = this.CurrentEntityMasterID; this.tbxGroupName.Text = this.currentEntity.GroupName.ToString(); this.acAddPersonForGroup.SelectedValue = Constants.INVALID_ID_STRING; this.acAddPersonForGroup.Text = string.Empty; this.chbxSharedAccess.Checked = Convert.ToBoolean(this.currentEntity.SharedAccess); this.btnAddPerson.Enabled = true; this.btnDeletePerson.Enabled = true; //Известие до this.gvGroupPerson.DataSource = this.ownerPage.AdminClientRef.GetGroupPersonLinkDataViewByGroupID(Int32.Parse(this.CurrentEntityMasterID)); this.gvGroupPerson.DataBind(); } else { SetEmptyValues(); } this.pnlGroupData.Visible = true; this.pnlGroupData.Focus(); }
protected void btnSave_Click(object sender, EventArgs e) { if (!this.ownerPage.CheckUserActionPermission(ETEMEnums.SecuritySettings.GroupSave, false)) { return; } if (string.IsNullOrEmpty(this.hdnRowMasterKey.Value) || this.hdnRowMasterKey.Value == Constants.INVALID_ID_STRING) { this.currentEntity = new Group(); } else { this.currentEntity = this.ownerPage.AdminClientRef.GetGroupByID(Convert.ToInt32(this.hdnRowMasterKey.Value)); if (this.currentEntity == null) { this.lbResultContext.Text = String.Format(BaseHelper.GetCaptionString("Entity_Group_Not_Found_By_ID"), this.hdnRowMasterKey.Value); string falseResult = String.Format(BaseHelper.GetCaptionString("Entity_is_not_update")); this.ownerPage.FormLoad(); return; } } currentEntity.GroupName = this.tbxGroupName.Text; currentEntity.SharedAccess = this.chbxSharedAccess.Checked; CallContext resultContext = new CallContext(); resultContext.CurrentConsumerID = this.ownerPage.UserProps.IdUser; resultContext = this.ownerPage.AdminClientRef.GroupSave(currentEntity, resultContext); if (this.ownerPage.CallContext.ResultCode == ETEMEnums.ResultEnum.Success) { this.CurrentEntityMasterID = resultContext.EntityID; UserControlLoad(); RefreshParent(); } CheckIfResultIsSuccess(this.lbResultContext); lbResultContext.Text = resultContext.Message; ; }
/// <summary> /// Create a new Group object. /// </summary> /// <param name="idGroup">Initial value of the idGroup property.</param> /// <param name="groupName">Initial value of the GroupName property.</param> public static Group CreateGroup(global::System.Int32 idGroup, global::System.String groupName) { Group group = new Group(); group.idGroup = idGroup; group.GroupName = groupName; return group; }
/// <summary> /// Deprecated Method for adding a new object to the Groups EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToGroups(Group group) { base.AddObject("Groups", group); }