コード例 #1
0
ファイル: Profile.ascx.cs プロジェクト: borisov90/Projects
        protected void btnAddValidation_Click(object sender, EventArgs e)
        {
            if (this.tbxValidationRequirements.Text.Trim() != string.Empty && !string.IsNullOrEmpty(this.hdnRowMasterKey.Value))
            {
                ProfileSettingValidation profileSettingValidation = new ProfileSettingValidation();
                CallContext resultContext = new CallContext();

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

                profileSettingValidation.idProfileSetting      = Int32.Parse(this.CurrentEntityMasterID);
                profileSettingValidation.ValidationRequirement = this.tbxValidationRequirements.Text;
                resultContext = this.ownerPage.CostCalculationRef.ProfileSettingValidationSave(profileSettingValidation, resultContext);

                if (resultContext.ResultCode == ETEMEnums.ResultEnum.Success)
                {
                    this.tbxValidationRequirements.Text = string.Empty;

                    this.gvValidation.DataSource = this.ownerPage.CostCalculationRef.GetProfileSettingValidationByIDProfile(Int32.Parse(this.CurrentEntityMasterID));
                    this.gvValidation.DataBind();
                }
            }
        }
コード例 #2
0
ファイル: Profile.ascx.cs プロジェクト: borisov90/Projects
        protected void btnRemoveValidation_Click(object sender, EventArgs e)
        {
            List <ProfileSettingValidation> listProfileSettingValidation = new List <ProfileSettingValidation>();
            CallContext resultContext = new CallContext();

            foreach (GridViewRow row in this.gvValidation.Rows)
            {
                HiddenField hdnProfileSettingValidation = row.FindControl("hdnProfileSettingValidation") as HiddenField;
                CheckBox    chbxRemoveValidation        = row.FindControl("chbxRemoveValidation") as CheckBox;

                if (chbxRemoveValidation.Checked)
                {
                    ProfileSettingValidation profileSettingValidation = this.ownerPage.CostCalculationRef.GetProfileSettingValidationById(hdnProfileSettingValidation.Value.ToString());
                    listProfileSettingValidation.Add(profileSettingValidation);
                }
            }

            if (listProfileSettingValidation.Count > 0)
            {
                //изтриваме ProfileSettingValidation
                resultContext = new CallContext();
                resultContext = this.ownerPage.CostCalculationRef.ProfileSettingValidationRemove(listProfileSettingValidation, resultContext);
            }

            this.gvValidation.DataSource = this.ownerPage.CostCalculationRef.GetProfileSettingValidationByIDProfile(Int32.Parse(this.hdnRowMasterKey.Value));
            this.gvValidation.DataBind();
        }
コード例 #3
0
        public CallContext ProfileSettingValidationSave(ProfileSettingValidation entity, CallContext resultContext)
        {
            resultContext.securitySettings = ETEMEnums.SecuritySettings.ProfileSettingValidationSave;
            CallContext resContext = new ProfileSettingValidationBL().EntitySave <ProfileSettingValidation>(entity, resultContext);

            return(resContext);
        }