protected void btnSaveAndClose_Click(object sender, EventArgs e)
 {
     if (SaveShippingMethod())
     {
         Response.Redirect(ReturnUrlTracker.GetReturnUrl());
     }
 }
 protected void btnClose_Click(object sender, EventArgs e)
 {
     if (SaveForm())
     {
         Response.Redirect(ReturnUrlTracker.GetReturnUrl());
     }
 }
Example #3
0
        protected void HandleCommands(object sender, CommandEventArgs e)
        {
            if (e.CommandName == SaveCommand || e.CommandName == SaveAndCloseCommand)
            {
                if (!ApplyValidation())
                {
                    return;
                }

                var updatedId = SaveConfig();
                ctrlAlertMessage.PushAlertMessage(AppLogic.GetString("admin.appconfig.SettingUpdated", AppLogic.GetCurrentCustomer().LocaleSetting), AlertMessage.AlertType.Success);

                if (e.CommandName == SaveAndCloseCommand)
                {
                    Response.Redirect(ReturnUrlTracker.GetReturnUrl());
                }
                else if (ConfigId == null && updatedId != null)
                {
                    Response.Redirect(String.Format("Config.aspx?mode={0}&id={1}", Mode, updatedId));
                }
                else
                {
                    DataBind();
                }
            }
            else if (e.CommandName == DeleteCommand)
            {
                int storeId;
                if (Int32.TryParse((string)e.CommandArgument, out storeId))
                {
                    DeleteConfig(storeId);
                    DataBind();
                }
            }
        }
Example #4
0
 /// <summary>
 /// Handles clicking of the save and close button
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnSaveAndClose_Click(object sender, EventArgs e)
 {
     if (Editing)
     {
         //Update
         if (UpdateExistingCustomerLevel())
         {
             ctrlAlertMessage.PushAlertMessage(AppLogic.GetString("admin.customer.level.UpdateSuccessful", SkinID, ThisCustomer.LocaleSetting), AlertMessage.AlertType.Success);
             Response.Redirect(ReturnUrlTracker.GetReturnUrl());
         }
         else
         {
             ctrlAlertMessage.PushAlertMessage(AppLogic.GetString("admin.customer.level.UpdateFailed", SkinID, ThisCustomer.LocaleSetting), AlertMessage.AlertType.Error);
         }
     }
     else
     {
         //Insert
         if (SaveNewCustomerLevel() != 0)
         {
             ctrlAlertMessage.PushAlertMessage(AppLogic.GetString("admin.customer.level.SaveNewSuccessful", SkinID, ThisCustomer.LocaleSetting), AlertMessage.AlertType.Success);
             Response.Redirect(ReturnUrlTracker.GetReturnUrl());
         }
         else
         {
             ctrlAlertMessage.PushAlertMessage(AppLogic.GetString("admin.customer.level.SaveNewFailed", SkinID, ThisCustomer.LocaleSetting), AlertMessage.AlertType.Error);
         }
     }
 }
 protected void btnSaveAndClose_Click(object sender, EventArgs e)
 {
     if (SaveInventoryRows())
     {
         Response.Redirect(ReturnUrlTracker.GetReturnUrl());
     }
 }
Example #6
0
 protected void btnSaveAndClose_Click(object sender, EventArgs e)
 {
     if (SaveZipTaxes())
     {
         ctlAlertMessage.PushAlertMessage(AppLogic.GetString("admin.zipcode.Updated", ThisCustomer.LocaleSetting), AlertMessage.AlertType.Success);
         Response.Redirect(ReturnUrlTracker.GetReturnUrl());
     }
 }
 protected void btnSaveAndClose_Click(object sender, EventArgs e)
 {
     Page.Validate();
     if (Page.IsValid)
     {
         SaveSalesPrompt();
         Response.Redirect(ReturnUrlTracker.GetReturnUrl());
     }
 }
Example #8
0
        protected void btnSaveAndClose_Click(object sender, EventArgs e)
        {
            var result = SaveOrCreateCustomer();

            if (!result.Item1)
            {
                return;
            }

            Response.Redirect(ReturnUrlTracker.GetReturnUrl());
        }
Example #9
0
 protected void btnSaveAndClose_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         if (UpdateInformation())
         {
             etsMapper.ObjectID = Localization.ParseNativeInt(ViewState["EditingAffiliateID"].ToString());
             etsMapper.Save();
             Response.Redirect(ReturnUrlTracker.GetReturnUrl());
         }
     }
 }
Example #10
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            if (TopicId == null)
            {
                return;
            }

            TopicManager.SetDeleteFlag(TopicId.Value, true);
            AlertMessageDisplay.PushAlertMessage(AppLogic.GetString("admin.topic.deleted", ThisCustomer.LocaleSetting), AlertMessage.AlertType.Success);

            Response.Redirect(ReturnUrlTracker.GetReturnUrl());
        }
Example #11
0
        protected override void OnInit(System.EventArgs e)
        {
            CustomerId = CommonLogic.QueryStringNativeInt("customerid");
            if (CustomerId == 0)
            {
                Response.Redirect(ReturnUrlTracker.GetReturnUrl());
            }

            AdminLocale = AppLogic.GetCurrentCustomer().LocaleSetting;

            base.OnInit(e);
        }
Example #12
0
        protected void btnSaveAndClose_Click(object sender, EventArgs e)
        {
            if (UpdateItems())
            {
                AlertMessageDisplay.PushAlertMessage(AppLogic.GetString("admin.common.Updated", ThisCustomer.LocaleSetting), AlertMessage.AlertType.Success);
            }
            else
            {
                AlertMessageDisplay.PushAlertMessage(AppLogic.GetString("admin.common.UpdateFailed", ThisCustomer.LocaleSetting), AlertMessage.AlertType.Error);
            }

            Response.Redirect(ReturnUrlTracker.GetReturnUrl());
        }
Example #13
0
        protected override void OnInit(System.EventArgs e)
        {
            CustomerId = CommonLogic.QueryStringNativeInt("customerid");
            if (CustomerId == 0)
            {
                Response.Redirect(ReturnUrlTracker.GetReturnUrl());
            }

            AdminLocale = AppLogic.GetCurrentCustomer().LocaleSetting;

            //Hide the Suite field if it's turned off
            dtlAddressList.Fields[7].Visible = AppLogic.AppConfigBool("Address.CollectSuite");

            base.OnInit(e);
        }
Example #14
0
        protected void btnSaveAndClose_Click(object sender, EventArgs e)
        {
            try
            {
                Page.Validate();
                if (!Page.IsValid)
                {
                    return;
                }

                SaveNewsItem();
                Response.Redirect(ReturnUrlTracker.GetReturnUrl());
            }
            catch (ThreadAbortException)
            {
                throw;
            }
            catch (Exception exception)
            {
                ctlAlertMessage.PushAlertMessage(exception.Message, AlertMessage.AlertType.Error);
            }
        }
Example #15
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!IsPostBack)
            {
                pnlCustomerEdit.Visible = true;

                Title
                      = HeaderText.Text
                      = CustomerId == null
                                                ? "admin.customer.CreateNew".StringResource()
                                                : "admin.customer.EditCustomer".StringResource();
            }

            // Prevent showing empty form if customer is marked deleted
            if (CustomerId.HasValue && CustomerIsDeleted(CustomerId))
            {
                pnlCustomerEdit.Visible = false;
                pnlAddressEdit.Visible  = false;

                AlertMessageDisplay.PushAlertMessage(
                    String.Format("admin.customer.CustomerIsMarkedAsDeleted".StringResource(), ReturnUrlTracker.GetReturnUrl()),
                    AlertMessage.AlertType.Warning);

                return;
            }

            if (!IsPostBack)
            {
                InitializeContent();
            }
        }