protected void btnSave_Click(object sender, EventArgs e) { try { if (!(lstSelected.Items.Count > 0)) { infobar.InnerText = "Please select at least one inclusion group"; infobar.Visible = true; return; } if (OfferEligibilePointsCondition == null) { OfferEligibilePointsCondition = new CMS.AMS.Models.PointsCondition(); } if (OfferEligibilePointsCondition.ConditionID == 0) { OfferEligibilePointsCondition.JoinTypeID = CMS.AMS.Models.JoinTypes.And; } if (chkDisallow_Edit.Visible) { OfferEligibilePointsCondition.DisallowEdit = chkDisallow_Edit.Checked; } OfferEligibilePointsCondition.Deleted = false; OfferEligibilePointsCondition.ConditionID = ConditionID; OfferEligibilePointsCondition.ConditionTypeID = ConditionTypeID; OfferEligibilePointsCondition.EngineID = EngineID; //OfferEligibilePointsCondition.PointsConditionID = PointsConditionID; OfferEligibilePointsCondition.RequiredFromTemplate = false; OfferEligibilePointsCondition.Quantity = txtValueNeeded.Text.ConvertToInt32(); OfferEligibilePointsCondition.ProgramID = lstSelected.Items[0].Value.ConvertToLong(); if (OfferEligibilePointsCondition.Quantity == 0) { infobar.InnerText = Copient.PhraseLib.Lookup("pointscondition.invalidValueNeeded", LanguageID); infobar.Visible = true; } else { m_Offer.CreateUpdateOfferEligiblePointsCondition(OfferID, EngineID, OfferEligibilePointsCondition); m_Offer.UpdateOfferStatusToModified(OfferID, EngineID, CurrentUser.AdminUser.ID); m_OAWService.ResetOfferApprovalStatus(OfferID); historyString = PhraseLib.Lookup("history.CustomerPointConditionEdit", LanguageID) + ":" + lstSelected.Items[0].Text + " requires " + txtValueNeeded.Text.ConvertToInt32(); WriteToActivityLog(); ScriptManager.RegisterStartupScript(this, this.GetType(), "Close", "CloseModel()", true); } } catch (Exception ex) { infobar.InnerText = ErrorHandler.ProcessError(ex); infobar.Visible = true; } }