Exemplo n.º 1
0
        public ActionResult Index()
        {
            MsgBoxViewModel model     = new MsgBoxViewModel();
            string          Gonderici = HttpContext.User.Identity.GetUserId();

            model.UserId = Gonderici;
            var GecmisSohbetGiden = ent.Gorusmeler.Where(g => g.GondericiId == Gonderici).Select(go => go.AliciId).Distinct().ToList();
            var usermanager       = IdentityTools.NewUserManager();
            List <ApplicationUser> Kullanicilar = new List <ApplicationUser>();

            foreach (var id in GecmisSohbetGiden)
            {
                var kullanici = usermanager.FindById(id);
                Kullanicilar.Add(kullanici);
            }
            var GecmisSohbetGelen = ent.Gorusmeler.Where(g => g.AliciId == Gonderici).Select(go => go.GondericiId).Distinct().ToList();

            foreach (var id in GecmisSohbetGelen)
            {
                var kullanici = usermanager.FindById(id);
                if (Kullanicilar.Contains(kullanici))
                {
                    continue;
                }
                else
                {
                    Kullanicilar.Add(kullanici);
                }
            }
            model.Kullanicilar = Kullanicilar.Reverse <ApplicationUser>().ToList(); //güncel konuşmanın geçmiş listesinde başa gelmesi için.
            return(View(model));
        }
Exemplo n.º 2
0
Arquivo: Msg.cs Projeto: LimGoSky/ZFS
        /// <summary>
        /// 弹出窗口
        /// </summary>
        /// <param name="notify">类型</param>
        /// <param name="msg">文本信息</param>
        /// <returns></returns>
        private static async Task <bool> Show(Notify notify, string msg, bool Host = true)
        {
            string Icon  = string.Empty;
            string Color = string.Empty;
            bool   Hide  = true;

            switch (notify)
            {
            case Notify.Error:
                Icon  = "\xe676";
                Color = "#FF4500";
                break;

            case Notify.Warning:
                Icon  = "\xe623";
                Color = "#FF8247";
                break;

            case Notify.Info:
                Icon  = "\xe764";
                Color = "#1C86EE";
                break;

            case Notify.Question:
                Icon  = "\xe6bd";
                Color = "#20B2AA";
                Hide  = false;
                break;
            }

            if (Host)
            {
                MsgHostBoxViewModel msgBox = new MsgHostBoxViewModel();
                var dialog = ServiceProvider.Instance.Get <IModelDialog>("MsgHostBoxViewDlg");
                dialog.BindViewModel(new MsgHostBoxViewModel()
                {
                    Msg = msg, Icon = Icon, Color = Color, BtnHide = Hide
                });
                var TaskResult = await dialog.ShowDialog(null, msgBox.ExtendedClosingEventHandler);

                if (TaskResult)
                {
                    return(true);
                }
                return(false);
            }
            else
            {
                MsgBoxViewModel msgBox = new MsgBoxViewModel();
                var             dialog = ServiceProvider.Instance.Get <IModelDialog>("MsgBoxViewDlg");
                dialog.BindViewModel(new MsgBoxViewModel()
                {
                    Msg = msg, Icon = Icon, Color = Color, BtnHide = Hide
                });
                var TaskResult = await dialog.ShowDialog();

                if (TaskResult)
                {
                    return(true);
                }
                return(false);
            }
        }