private void GetOfferTCProgramCondition() { if (ConditionID > 0) { OfferTCProgramCondition = m_TCProgramCondition.GetConditionByID(ConditionID); } if (OfferTCProgramCondition == null) { OfferTCProgramCondition = new TCProgramCondition(); } else { SavedTCProgram = OfferTCProgramCondition.TCProgram; IncludedTCProgram = OfferTCProgramCondition.TCProgram; chkDisallow_Edit.Checked = OfferTCProgramCondition.DisallowEdit; } }
protected void btnSave_Click(object sender, EventArgs e) { try { if (!(lstSelected.Items.Count > 0)) { infobar.InnerText = PhraseLib.Lookup("CPE-rew-membership.selectpoints", LanguageID); infobar.Visible = true; return; } if (OfferTCProgramCondition == null) { OfferTCProgramCondition = new TCProgramCondition(); } ConditionTypeID = m_TCProgramCondition.GetTCConditionTypeID(Engine); if (chkDisallow_Edit.Visible) { OfferTCProgramCondition.DisallowEdit = chkDisallow_Edit.Checked; } OfferTCProgramCondition.Deleted = false; OfferTCProgramCondition.ConditionID = ConditionID; OfferTCProgramCondition.ConditionTypeID = ConditionTypeID; OfferTCProgramCondition.EngineID = (int)Engine; OfferTCProgramCondition.RequiredFromTemplate = false; OfferTCProgramCondition.ProgramID = lstSelected.Items[0].Value.ConvertToLong(); m_Offer.CreateUpdateOfferTrackableCouponCondition(OfferID, Engine, OfferTCProgramCondition); // Only update the program expiration when the expiration feature is off // or the program expiration type is offer end date if (!bExpireDateEnabled || (IncludedTCProgram.TCExpireType == 1)) { m_TCProgram.UpdateTCProgramExpiryDate(OfferTCProgramCondition.ProgramID.ConvertToInt32(), Offer.EndDate); } m_Offer.UpdateOfferStatusToModified(OfferID, (int)Engine, CurrentUser.AdminUser.ID); m_OAWService.ResetOfferApprovalStatus(OfferID); historyString = PhraseLib.Lookup("history.CustomerTrackableCouponConditionEdit", LanguageID) + ":" + lstSelected.Items[0].Text; m_ActivityLog.Activity_Log(ActivityTypes.Offer, OfferID.ConvertToInt32(), CurrentUser.AdminUser.ID, historyString); ScriptManager.RegisterStartupScript(this, this.GetType(), "Close", "CloseModel()", true); } catch (Exception ex) { infobar.InnerText = ErrorHandler.ProcessError(ex); infobar.Visible = true; } }