Esempio n. 1
0
        public CallContext GroupPersonLinkSave(GroupPersonLink groupPersonLink, CallContext resultContext)
        {
            resultContext.securitySettings = ETEMEnums.SecuritySettings.GroupSave;
            resultContext = new GroupPersonLinkBL().EntitySave <Setting>(groupPersonLink, resultContext);

            return(resultContext);
        }
Esempio n. 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();
            }
        }