Example #1
0
 /// <summary>
 /// Create a new GroupPersonLink object.
 /// </summary>
 /// <param name="idGroupPersonLink">Initial value of the idGroupPersonLink property.</param>
 /// <param name="idGroup">Initial value of the idGroup property.</param>
 /// <param name="idPerson">Initial value of the idPerson property.</param>
 public static GroupPersonLink CreateGroupPersonLink(global::System.Int32 idGroupPersonLink, global::System.Int32 idGroup, global::System.Int32 idPerson)
 {
     GroupPersonLink groupPersonLink = new GroupPersonLink();
     groupPersonLink.idGroupPersonLink = idGroupPersonLink;
     groupPersonLink.idGroup = idGroup;
     groupPersonLink.idPerson = idPerson;
     return groupPersonLink;
 }
Example #2
0
        protected void btnAddPerson_Click(object sender, EventArgs e)
        {
            if (!this.ownerPage.CheckUserActionPermission(ETEMEnums.SecuritySettings.GroupPersonAddDelete, false))
            {
                return;
            }

            if (this.acAddPersonForGroup.SelectedValueINT != Constants.INVALID_ID && this.acAddPersonForGroup.SelectedValueINT != null && !string.IsNullOrEmpty(this.hdnRowMasterKey.Value))
            {
                GroupPersonLink groupPersonLink = new GroupPersonLink();
                CallContext resultContext = new CallContext();

                if (this.CurrentEntityMasterID == Constants.INVALID_ID_STRING || string.IsNullOrEmpty(CurrentEntityMasterID))
                {
                    this.CurrentEntityMasterID = this.hdnRowMasterKey.Value;
                }

                //дублиране на лицата за известяване
                bool isUniquePerson = this.AdminClientRef.IsUniqueRecordGroupPersonLink(Int32.Parse(this.CurrentEntityMasterID), this.acAddPersonForGroup.SelectedValueINT.Value);

                if (!isUniquePerson)
                {
                    resultContext.ResultCode = ETEMEnums.ResultEnum.Error;
                    this.lbResultContext.Text = String.Format(BaseHelper.GetCaptionString("Not_Unique_Records"), this.CurrentEntityMasterID);
                    return;
                }

                groupPersonLink.idGroup = Int32.Parse(this.CurrentEntityMasterID);
                groupPersonLink.idPerson = this.acAddPersonForGroup.SelectedValueINT.Value;

                resultContext.CurrentConsumerID = this.ownerPage.UserProps.IdUser;
                resultContext = this.AdminClientRef.GroupPersonLinkSave(groupPersonLink, resultContext);

                this.acAddPersonForGroup.SelectedValue = Constants.INVALID_ID_STRING;
                this.acAddPersonForGroup.Text = string.Empty;

                this.gvGroupPerson.DataSource = this.ownerPage.AdminClientRef.GetGroupPersonLinkDataViewByGroupID(Int32.Parse(this.CurrentEntityMasterID));
                this.gvGroupPerson.DataBind();
            }
        }
Example #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the GroupPersonLinks EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToGroupPersonLinks(GroupPersonLink groupPersonLink)
 {
     base.AddObject("GroupPersonLinks", groupPersonLink);
 }