Exemplo n.º 1
0
        public async Task <IActionResult> NewList()
        {
            var model = new NewListView();

            model.List        = new DistributionList();
            model.List.Port   = 110;
            model.ListTypes   = model.Type.ToSelectList();
            model.List.UseSsl = false;
            model.List.Type   = (int)DistributionListTypes.Internal;

            model.Users = await _departmentsService.GetAllUsersForDepartmentAsync(DepartmentId, true);

            return(View(model));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 显示目录
        /// </summary>
        public void ListShow()
        {
            Thread thread = new Thread(new ThreadStart(delegate
            {
                //跳转到指定的项
                KeyValuePair <int, string> keyValuePair = new KeyValuePair <int, string>(NewPages, NewId[NewPages]);

                this.Dispatcher.BeginInvoke(new Action(() =>
                {
                    //目录赋值
                    NewListView.ItemsSource = NewId;
                    NewListView.Visibility  = Visibility.Visible;

                    //跳转
                    NewListView.ScrollIntoView(keyValuePair);
                }));
            }));

            thread.IsBackground = true;
            thread.Start();
        }
Exemplo n.º 3
0
        public async Task <IActionResult> NewList(NewListView model, IFormCollection collection, CancellationToken cancellationToken)
        {
            model.Users = await _departmentsService.GetAllUsersForDepartmentAsync(DepartmentId, true);

            model.ListTypes = model.Type.ToSelectList();

            var result = await _distributionListsService.GetDistributionListByAddressAsync(model.List.EmailAddress);

            if (result != null)
            {
                ModelState.AddModelError("List.EmailAddress", "Email address already in use, please try another one");
            }

            if (ModelState.IsValid)
            {
                model.List.DepartmentId = DepartmentId;
                model.List.Members      = new Collection <DistributionListMember>();
                model.List.Type         = (int)DistributionListTypes.Internal;

                if (collection.ContainsKey("listMembers"))
                {
                    var userIds = collection["listMembers"].ToString().Split(char.Parse(","));

                    foreach (var userId in userIds)
                    {
                        var member = new DistributionListMember();
                        member.UserId = userId;

                        model.List.Members.Add(member);
                    }
                }

                await _distributionListsService.SaveDistributionListAsync(model.List, cancellationToken);

                return(RedirectToAction("Index", "DistributionLists", new { Area = "User" }));
            }

            return(View(model));
        }
Exemplo n.º 4
0
        void ReleaseDesignerOutlets()
        {
            if (btnAceptarCantidad != null)
            {
                btnAceptarCantidad.Dispose();
                btnAceptarCantidad = null;
            }

            if (btnAceptarNuevaLista != null)
            {
                btnAceptarNuevaLista.Dispose();
                btnAceptarNuevaLista = null;
            }

            if (btnBadPrice != null)
            {
                btnBadPrice.Dispose();
                btnBadPrice = null;
            }

            if (btnCerrarLista != null)
            {
                btnCerrarLista.Dispose();
                btnCerrarLista = null;
            }

            if (btnCerrarNombreNL != null)
            {
                btnCerrarNombreNL.Dispose();
                btnCerrarNombreNL = null;
            }

            if (btnFacebook != null)
            {
                btnFacebook.Dispose();
                btnFacebook = null;
            }

            if (btnLista != null)
            {
                btnLista.Dispose();
                btnLista = null;
            }

            if (btnMapa != null)
            {
                btnMapa.Dispose();
                btnMapa = null;
            }

            if (btnMas != null)
            {
                btnMas.Dispose();
                btnMas = null;
            }

            if (btnMenos != null)
            {
                btnMenos.Dispose();
                btnMenos = null;
            }

            if (btnNuevaLista != null)
            {
                btnNuevaLista.Dispose();
                btnNuevaLista = null;
            }

            if (cmpCantidad != null)
            {
                cmpCantidad.Dispose();
                cmpCantidad = null;
            }

            if (cmpNewList != null)
            {
                cmpNewList.Dispose();
                cmpNewList = null;
            }

            if (imgProducto != null)
            {
                imgProducto.Dispose();
                imgProducto = null;
            }

            if (imgTienda != null)
            {
                imgTienda.Dispose();
                imgTienda = null;
            }

            if (lblDescripcion != null)
            {
                lblDescripcion.Dispose();
                lblDescripcion = null;
            }

            if (lblNombre != null)
            {
                lblNombre.Dispose();
                lblNombre = null;
            }

            if (lblPrecio != null)
            {
                lblPrecio.Dispose();
                lblPrecio = null;
            }

            if (lblTiendaDireccion != null)
            {
                lblTiendaDireccion.Dispose();
                lblTiendaDireccion = null;
            }

            if (lblTiendaDistancia != null)
            {
                lblTiendaDistancia.Dispose();
                lblTiendaDistancia = null;
            }

            if (lblTiendaNombre != null)
            {
                lblTiendaNombre.Dispose();
                lblTiendaNombre = null;
            }

            if (lblVigencia != null)
            {
                lblVigencia.Dispose();
                lblVigencia = null;
            }

            if (ListsView != null)
            {
                ListsView.Dispose();
                ListsView = null;
            }

            if (NewListView != null)
            {
                NewListView.Dispose();
                NewListView = null;
            }

            if (QuantityView != null)
            {
                QuantityView.Dispose();
                QuantityView = null;
            }

            if (bannerImage != null)
            {
                bannerImage.Dispose();
                bannerImage = null;
            }

            if (tblLists != null)
            {
                tblLists.Dispose();
                tblLists = null;
            }
        }