Exemplo n.º 1
0
        /// <summary>
        /// Itenta obtener la configuración del usuario (cliente) y pregunta por uno nuevo si no encuentra configuración previa
        /// </summary>
        /// <returns>True si el usuario se configuro exitosamente</returns>
        public bool ConfigureCustomer()
        {
            bool existCustomerConfiguration = CheckCustomerConfiguration();

            if (!existCustomerConfiguration)
            {
                try
                {
                    SessionManagerClient sessionManagerClient = new SessionManagerClient(SessionManagerClient.CreateDefaultBinding(), new EndpointAddress(UtnEmall.Client.SmartClientLayer.Connection.ServerUri + "SessionManager"));
                    sessionManagerClient.ValidateCustomer("", "");

                    CustomerConfigurationForm customerConfigurationForm = new CustomerConfigurationForm();
                    customerConfigurationForm.Owner = mainMenu;
                    customerConfigurationForm.ShowDialog();
                }
                catch (TargetInvocationException invocationException)
                {
                    Debug.WriteLine(invocationException.Message);
                    HelpForm helpForm = new HelpForm(global::PresentationLayer.GeneralResources.ServerNotFoundHelp);
                    helpForm.ShowDialog();
                    return(false);
                }
                catch (CommunicationException communicationError)
                {
                    Debug.WriteLine(communicationError.Message);
                    HelpForm helpForm = new HelpForm(global::PresentationLayer.GeneralResources.ServerNotFoundHelp);
                    helpForm.ShowDialog();
                    return(false);
                }
            }
            return(true);
        }
        /// <summary>
        /// Método llamado cuando se selecciona "Seleccionar".
        /// Abre el formulario adecuado de acuerdo a la selección del usuario.
        /// </summary>
        /// <param name="sender">
        /// El objeto que genero el evento
        /// </param>
        /// <param name="e">
        /// Un objeto que contiene información sobre el evento
        /// </param>
        private void menuItemSelect_Click(object sender, EventArgs e)
        {
            ListViewItem itemSelected = listViewConfigurationOption.FocusedItem;

            if (itemSelected == null)
            {
                return;
            }

            switch (itemSelected.Index)
            {
            case 0:
                MallConfigurationForm mallConfigurationForm = new MallConfigurationForm();
                mallConfigurationForm.Owner = this;
                mallConfigurationForm.ShowDialog();
                break;

            case 1:
                CustomerConfigurationForm customerConfigurationForm = new CustomerConfigurationForm();
                customerConfigurationForm.Owner = this;
                customerConfigurationForm.ShowDialog();
                break;

            case 2:
                HelpForm helpForm = new HelpForm(global::PresentationLayer.GeneralResources.ConfigurationHelp);
                helpForm.ShowDialog();
                break;

            default: break;
            }
        }
Exemplo n.º 3
0
        private void menuItemSelect_Click(object sender, EventArgs e)
        {
            try
            {
                ListViewItem itemSelected = listViewOptions.FocusedItem;

                if (itemSelected == null)
                {
                    return;
                }

                switch (itemSelected.Index)
                {
                // Servicios
                case 0:
                    ServicesForm servicesForm = new ServicesForm();
                    servicesForm.Owner = this;
                    servicesForm.ShowDialog();
                    break;

                // Ayuda
                case 1:
                    HelpForm helpForm = new HelpForm(global::PresentationLayer.GeneralResources.ApplicationHelp);
                    helpForm.Owner = this;
                    helpForm.ShowDialog();
                    break;

                // Perfil
                case 2:
                    ProfileForm perfilForm = new ProfileForm();
                    perfilForm.Owner = this;
                    perfilForm.ShowDialog();
                    break;

                // Configuración
                case 3:
                    ConfigurationForm configurationForm = new ConfigurationForm();
                    configurationForm.Owner = this;
                    configurationForm.ShowDialog();
                    break;

                default: break;
                }
            }
            catch (Exception error)
            {
                Debug.WriteLine(error.Message);
            }
        }