public static void Process(ShippingAddressCommand command, Page parent)
 {
     switch (command.Mode)
     {
     case ShippingAddressCommandType.ADD:
         var cntrl = new AddEditShippingControl();
         //pass (int)command as querystring to control or set property directly
         return;
     }
 }
        public void RenderCommandCentricView(ShippingAddressCommand command)
        {
            SourceCommand = command;
            switch (SourceCommand.Mode)
            {
            case ShippingAddressCommandType.ADD:
                RenderAddShippingView();
                return;

            case ShippingAddressCommandType.EDIT:
                RenderEditShippingView();
                return;

            case ShippingAddressCommandType.DELETE:
                RenderDeleteShippingView();
                return;
            }
        }
        public void OnShippingAddressBeingDeleted(object sender, EventArgs e)
        {
            lblDeleteHeader.Text = GetLocalResourceObject("lblDeleteHeaderResource1.Text") as string;
            //this.btnContinue.Text = GetLocalResourceObject("btnContinueDelete") as string;
            //btnContinue.Text = GetLocalResourceObject("btnContinueDelete") as string;
            btnContinue.Enabled = true;
            blErrors.Items.Clear();

            SourceCommand = new ShippingAddressCommand(ShippingAddressCommandType.DELETE);
            loadControls();
            var arg = e as ShippingAddressEventArgs;

            if (arg != null)
            {
                WorkedUponAddress = arg.ShippingAddress;
                RenderDeleteShippingView();
                //ProcessDeleteShippingSubmit();
            }
            ViewState[POPUPSHOWN] = true;
        }
        public void OnShippingAddressBeingChanged(object sender, EventArgs e)
        {
            lblHeader.Text = GetLocalResourceObject("lblEditHeaderResource1.Text") as string;
            //this.btnContinue.Text = GetLocalResourceObject("btnContinueContinue") as string;
            btnContinue.Enabled = true;
            blErrors.Items.Clear();

            //Set the MODE & Load respective controlset
            SourceCommand = new ShippingAddressCommand(ShippingAddressCommandType.EDIT);
            loadControls();

            var arg = e as ShippingAddressEventArgs;

            if (arg != null)
            {
                OldAddress                  = arg.ShippingAddress;
                WorkedUponAddress           = arg.ShippingAddress;
                hfDiableSavedCheckbox.Value = arg.DisableSaveAddressCheckbox.ToString();
                RenderEditShippingView();
            }
            ViewState[POPUPSHOWN] = true;
        }