Inheritance: PageModel
コード例 #1
0
ファイル: HelpController.cs プロジェクト: Lee-Peter/BrnShop-1
        public ActionResult EditHelp(HelpModel model, int id = -1)
        {
            HelpInfo helpInfo = AdminHelps.GetHelpById(id);

            if (helpInfo == null)
            {
                return(PromptView("帮助不存在"));
            }

            if (ModelState.IsValid)
            {
                helpInfo.Pid          = model.Pid;
                helpInfo.Title        = model.HelpTitle;
                helpInfo.Url          = model.Url == null ? "" : model.Url;
                helpInfo.Description  = model.Description ?? "";
                helpInfo.DisplayOrder = model.DisplayOrder;

                AdminHelps.UpdateHelp(helpInfo);
                AddMallAdminLog("修改帮助", "修改帮助,帮助ID为:" + id);
                return(PromptView("帮助修改成功"));
            }

            Load();
            return(View(model));
        }
コード例 #2
0
        public ActionResult Help(HelpModel model)
        {
            if (ModelState.IsValid) {

                User user = Users.GetLoggedInUser();
                List<string> emails = new List<string>() {"*****@*****.**","*****@*****.**","*****@*****.**", "*****@*****.**"};
                string lang = Users.GetUserLanguage();

                if (lang == "zh-TW" || lang == "zh-CN") {
                    emails.Add("*****@*****.**");
                }

                string message =
                    ((user != null)  ? "ID: " + user.UserID + " https://online.dts.edu/admin/users/edituser/" + user.UserID + "\n" : "") +
            @"
            Name: " + model.Name + @"
            Email: " + model.Email + @"
            Message:
            " + model.Message +

            "\n\nUser Agent: " + Request.UserAgent;

                Emails.SendEmail(model.Email, emails, "Help Request", message);

                model.IsSubmitted = true;
            }

            return View(model);
        }
コード例 #3
0
ファイル: HelpController.cs プロジェクト: Lee-Peter/BrnShop-1
        public ActionResult AddHelp()
        {
            HelpModel model = new HelpModel();

            Load();
            return(View(model));
        }
コード例 #4
0
 public void TestInitialize()
 {
     _eventAggregatorMock = new Mock <IEventAggregator>();
     _helpChangedEvent    = new HelpChangedEvent();
     _eventAggregatorMock.Setup(it => it.GetEvent <HelpChangedEvent>()).Returns(_helpChangedEvent);
     _target = new HelpModel(_eventAggregatorMock.Object);
 }
コード例 #5
0
        public MainWindowViewModel()
        {
            HelpModel = new HelpModel();
            HelpModel.HelpDataContext();

            RecvModel = new RecvModel();
            RecvModel.RecvDataContext();

            SendModel = new SendModel();
            SendModel.SendDataContext();

            SerialPortModel = new SerialPortModel();
            SerialPortModel.SerialPortDataContext();

            DepictInfo = "串行端口调试助手";

            TimerModel = new TimerModel();
            TimerModel.TimerDataContext();

            HexSend  = false;
            AutoSend = false;
            InitAutoSendTimer();

            SaveRecv = false;
        }
コード例 #6
0
 public HelpPage()
 {
     this.InitializeComponent();
     rootPage  = (Application.Current as App).CurrentMain;
     ViewModel = new HelpModel();
     rootPage.UpdateTitle(HelpModel.Title);
     rootPage.NavigateWithMenuUpdate(typeof(HelpPage));
 }
コード例 #7
0
        public ActionResult Help()
        {
            HelpModel model = new HelpModel();
            User user = Users.GetLoggedInUser();

            if (user != null) {
                model.Email = user.Email;
                model.Name = user.FormattedName;
            }

            return View(model);
        }
コード例 #8
0
        public async Task <ActionResult <bool> > SendHelpEmail([FromBody] HelpModel helpModel)
        {
            if (helpModel == null)
            {
                return(StatusCode(400));
            }

            if (helpModel.Subject == null || helpModel.Message == null)
            {
                return(StatusCode(400));
            }

            return(Ok(await _helpManager.SendHelpEmail(helpModel.Subject, helpModel.Message)));
        }
コード例 #9
0
        public MainWindowViewModel()
        {
            TCPServerModel = new TCPServerModel();
            TCPServerModel.TCPServerDataContext();

            TCPClientModel = new TCPClientModel();
            TCPClientModel.TCPClientDataContext();

            UDPServerModel = new UDPServerModel();
            UDPServerModel.UDPServerDataContext();

            UDPClientModel = new UDPClientModel();
            UDPClientModel.UDPClientDataContext();

            SendModel = new SendModel();
            SendModel.SendDataContext();

            RecvModel = new RecvModel();
            RecvModel.RecvDataContext();

            TimerModel = new TimerModel();
            TimerModel.TimerDataContext();

            HelpModel = new HelpModel();
            HelpModel.HelpDataContext();

            TCPServerHexSend  = false;
            TCPServerSaveRecv = false;
            TCPServerAutoSend = false;
            TCPServerInitAutoSendTimer();

            TCPClientHexSend  = false;
            TCPClientSaveRecv = false;
            TCPClientAutoSend = false;
            TCPClientInitAutoSendTimer();

            UDPServerHexSend  = false;
            UDPServerSaveRecv = false;
            UDPServerAutoSend = false;
            UDPServerInitAutoSendTimer();

            UDPClientHexSend  = false;
            UDPClientSaveRecv = false;
            UDPClientAutoSend = false;
            UDPClientInitAutoSendTimer();

            DepictInfo = string.Format(cultureInfo, "网络端口调试助手");
        }
コード例 #10
0
        public ActionResult AdminSiteHelp(string pageName)
        {
            if (string.IsNullOrEmpty(pageName))
            {
                pageName = "IntroductionPage.html";
            }
            var bodyNode = GetBodyTagNodeFromPage(pageName);
            var model    = new HelpModel
            {
                MainContent = bodyNode != null ? bodyNode.OuterXml : ""
            };

            if (Request.IsAjaxRequest())
            {
                return(PartialView("AdminSiteHelpPartial", model));
            }
            return(View(model));
        }
コード例 #11
0
ファイル: HelpController.cs プロジェクト: Lee-Peter/BrnShop-1
        public ActionResult AddHelp(HelpModel model)
        {
            if (ModelState.IsValid)
            {
                HelpInfo helpInfo = new HelpInfo()
                {
                    Pid          = model.Pid,
                    Title        = model.HelpTitle,
                    Url          = model.Url == null ? "" : model.Url,
                    Description  = model.Description ?? "",
                    DisplayOrder = model.DisplayOrder
                };

                AdminHelps.CreateHelp(helpInfo);
                AddMallAdminLog("添加帮助", "添加帮助,帮助为:" + model.HelpTitle);
                return(PromptView("帮助添加成功"));
            }
            Load();
            return(View(model));
        }
コード例 #12
0
ファイル: HelpController.cs プロジェクト: Lee-Peter/BrnShop-1
        public ActionResult EditHelp(int id = -1)
        {
            HelpInfo helpInfo = AdminHelps.GetHelpById(id);

            if (helpInfo == null)
            {
                return(PromptView("帮助不存在"));
            }

            HelpModel model = new HelpModel();

            model.Pid          = helpInfo.Pid;
            model.HelpTitle    = helpInfo.Title;
            model.Url          = helpInfo.Url;
            model.Description  = helpInfo.Description;
            model.DisplayOrder = helpInfo.DisplayOrder;
            Load();

            return(View(model));
        }
コード例 #13
0
        public ActionResult Help(HelpModel model, IPrincipal user)
        {
            if (ModelState.IsValid)
            {
                MembershipUser muser = Membership.GetUser(user.Identity.Name);

                // send email
                if (muser != null)
                {
                    var message = new MailMessage
                    {
                        Subject = model.Category + ": " + model.Subject,
                        Body    = model.Description + "\r\n\r\n" + muser.Email
                    };
                    message.To.Add(ConfigurationManager.AppSettings["InfoEmailAccount"]);
                    message.From = new MailAddress(muser.Email);
                    SendEmail(message);
                }

                return(RedirectToAction("Help"));
            }

            return(View(model));
        }
コード例 #14
0
        /// <summary>
        /// Возвращает ВСЮ HTML разментку страници с описанием
        /// </summary>
        /// <param name="pageName">Имя страници, которую нужно достать</param>
        public ActionResult ElementDescriptionPageHTML(string pageName)
        {
            XmlNode html = null;

            if (idPages.ContainsKey(pageName))
            {
                html = GetBodyTagNodeFromPage(idPages[pageName]);
            }
            else
            {
                var node = idPages.FirstOrDefault(x => x.Value == pageName).Value;
                if (node != null)
                {
                    html = GetBodyTagNodeFromPage(node);
                }
            }

            var model = new HelpModel
            {
                MainContent = html != null ? html.OuterXml : ""
            };

            return(View(model));
        }
コード例 #15
0
ファイル: HomeController.cs プロジェクト: Gajotres100/CSP
        public async Task <IActionResult> About(string ssoID, string token, string culture)
        {
            var model = new HelpModel();
            var def   = Request.HttpContext.Features.Get <IRequestCultureFeature>();
            // Culture contains the information of the requested culture
            var culture2 = def.RequestCulture.Culture;

            ViewData["Message"] = " ";


            ApiService = _configuration["ApiUrl"];

            using (var clientapi = new HttpClient())
            {
                // user data
                var url = ApiService + "api/user?ssoId=" + ssoID;
                //add header bearer Authorization
                clientapi.DefaultRequestHeaders.Add("Authorization", String.Format("Bearer {0}", token));
                var uriUser = new Uri(url);

                var responseUser = await clientapi.GetAsync(uriUser);

                var jsonUser = await responseUser.Content.ReadAsStringAsync(); //This is working

                // var Userdata = JsonConvert.DeserializeObject<User>(json);
                var user = JsonConvert.DeserializeObject <RootObject>(jsonUser);
                model.Fulluser  = user.User.firstName + " " + user.User.lastName;
                model.ssoId     = ssoID;
                model.token     = token;
                model.Culture   = culture.ToString();
                model.clientUrl = _configuration["MKPLink"];
            }


            return(View(model));
        }
コード例 #16
0
ファイル: HelpController.cs プロジェクト: sondreb/QBitNinja
        public ActionResult Index()
        {
            var sb    = new StringBuilder();
            var model = new HelpModel
            {
                Routes = new[]
                {
                    new RouteModel
                    {
                        Template = "blocks/[blockId|height|tip]?format=[json|raw]&headeronly=[false|true]",
                        Samples  = new RouteSample[]
                        {
                            "blocks/0000000000000000119fe3f65fd3038cbe8429ad2cf7c2de1e5e7481b34a01b4",
                            "blocks/321211",
                            "blocks/tip",
                            "blocks/tip-1",
                            "blocks/tip?format=json",
                            "blocks/tip?format=json&headeronly=true",
                            "blocks/tip?format=raw",
                            "blocks/tip?format=raw&headeronly=true",
                            "blocks/tip?format=raw&headeronly=true&extended=true",
                        }
                    },
                    new RouteModel
                    {
                        Template = "blocks/[blockFeature]/header",
                        Samples  = new RouteSample[]
                        {
                            "blocks/tip/header"
                        }
                    },
                    new RouteModel
                    {
                        Template = "transactions/[txId]?format=[json|raw]&headeronly=[false|true]",
                        Samples  = new RouteSample[]
                        {
                            "transactions/38d4cfeb57d6685753b7a3b3534c3cb576c34ca7344cd4582f9613ebf0c2b02a",
                            "transactions/38d4cfeb57d6685753b7a3b3534c3cb576c34ca7344cd4582f9613ebf0c2b02a?format=json",
                            "transactions/38d4cfeb57d6685753b7a3b3534c3cb576c34ca7344cd4582f9613ebf0c2b02a?format=json&headeronly=true",
                            "transactions/38d4cfeb57d6685753b7a3b3534c3cb576c34ca7344cd4582f9613ebf0c2b02a?format=raw",
                            "transactions/38d4cfeb57d6685753b7a3b3534c3cb576c34ca7344cd4582f9613ebf0c2b02a?format=raw&headeronly=true",
                        }
                    },
                    new RouteModel
                    {
                        Template = "balances/[address]?unspentOnly=[false|true]&from=[blockFeature]&to=[blockFeature]&continuation=[continuation]&colored=[false|true]",
                        Samples  = new RouteSample[]
                        {
                            "balances/15sYbVpRh6dyWycZMwPdxJWD4xbfxReeHe",
                            "balances/15sYbVpRh6dyWycZMwPdxJWD4xbfxReeHe?unspentonly=true",
                            "balances/1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp?from=336410&until=336000",
                            "balances/1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp?from=tip&until=336000"
                        }
                    },
                    new RouteModel
                    {
                        Template = "balances/[coloredaddress]?unspentOnly=[false|true]&from=[blockFeature]&to=[blockFeature]&continuation=[continuation]",
                        Samples  = new RouteSample[]
                        {
                            "balances/akEBcY5k1dn2yeEdFnTMwdhVbHxtgHb6GGi",
                            "balances/akEBcY5k1dn2yeEdFnTMwdhVbHxtgHb6GGi?unspentonly=true",
                            "balances/akEBcY5k1dn2yeEdFnTMwdhVbHxtgHb6GGi?from=336410&until=336000",
                            "balances/akEBcY5k1dn2yeEdFnTMwdhVbHxtgHb6GGi?from=tip&until=336000"
                        }
                    },
                    new RouteModel
                    {
                        Template = "balances/[address]/summary?at=[blockFeature]&colored=[false|true]",
                        Samples  = new RouteSample[]
                        {
                            "balances/15sYbVpRh6dyWycZMwPdxJWD4xbfxReeHe/summary",
                            "balances/15sYbVpRh6dyWycZMwPdxJWD4xbfxReeHe/summary?at=318331",
                        }
                    },
                    new RouteModel
                    {
                        Template = "balances/[coloredaddress]/summary?at=[blockFeature]",
                        Samples  = new RouteSample[]
                        {
                            "balances/akEBcY5k1dn2yeEdFnTMwdhVbHxtgHb6GGi/summary",
                            "balances/akEBcY5k1dn2yeEdFnTMwdhVbHxtgHb6GGi/summary?at=318331",
                        }
                    },
                    new RouteModel
                    {
                        Template = "whatisit/[address|txId|blockId|blockheader|base58|transaction|signature|script|scriptbytes]",
                        Samples  = new[]
                        {
                            new RouteSample("whatisit/15sYbVpRh6dyWycZMwPdxJWD4xbfxReeHe", "P2PKH Address"),
                            new RouteSample("whatisit/02012edcbdf6f8b7d4d315338423196ce1c4251ede5a8c9c1dfff645f67a008935", "Public key"),
                            new RouteSample("whatisit/356facdac5f5bcae995d13e667bb5864fd1e7d59", "Hash pub key"),
                            new RouteSample("whatisit/OP_DUP OP_HASH160 356facdac5f5bcae995d13e667bb5864fd1e7d59 OP_EQUALVERIFY OP_CHECKSIG", "Script"),
                            new RouteSample("whatisit/76a914356facdac5f5bcae995d13e667bb5864fd1e7d5988ac", "Script bytes"),

                            new RouteSample("whatisit/3P2sV4w1ZSk5gr6eePd6U2V56Mx5fT3RkD", "P2SH Address"),
                            new RouteSample("whatisit/ea1bea7de1b975b962adbd57a9e0533449962a80", "Script Hash"),
                            new RouteSample("whatisit/2103f670154f21dd26f558a5718776b3905d19ee83b01592255ea7b472d52d09d8baac", "Script bytes"),

                            new RouteSample("whatisit/d3294938d12105a27a55af9c02864d6f633741bd5c5340a18972935a457275b9", "Transaction id"),

                            new RouteSample("whatisit/0000000000000000080feeba134552a002aeb08e815aad1c41108f680d7b5f58", "Block id"),
                            new RouteSample("whatisit/0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c", "Block header"),
                            new RouteSample("whatisit/335598", "Block height"), //Height
                            new RouteSample("whatisit/3045022100a8a45e762fbda89f16a08de25274257eb2b7d9fbf481d359b28e47205c8bdc2f022007917ee618ae55a8936c75ad603623671f27ce8591010b769718ebc5ff295cf001", "Signature"),
                            new RouteSample("whatisit/what is my future", "Astrology")
                        }
                    },
                    new RouteModel
                    {
                        Template = "Miscellaneous",
                        Samples  = new RouteSample[]
                        {
                            "versionstats",
                            "bip9"
                        }
                    },
                }
            };

            sb.AppendLine("<!DOCTYPE html>");
            sb.AppendLine("<html><head></head><body>");
            sb.AppendLine("More documentation on <a href=\"http://docs.qbitninja.apiary.io/\">http://docs.qbitninja.apiary.io/</a>.");
            sb.AppendLine("<h2>Methods</h2><ul>");
            foreach (var route in model.Routes)
            {
                sb.AppendLine($"<li>{route.Template}");
                sb.AppendLine($"<ul>");
                foreach (var sample in route.Samples)
                {
                    sb.AppendLine($"<li>{sample.Comment ?? ""}");
                    sb.AppendLine($"<a href=\"{sample.Url}\">{sample.Url}</a></li>");
                }
                sb.AppendLine($"</ul></li>");
            }
            sb.AppendLine("</ul>");
            sb.AppendLine("</ul></body></html>");

            return(this.Content(sb.ToString(), "text/html"));
        }
コード例 #17
0
 public WPFUpdateViewModel()
 {
     HelpModel = new HelpModel();
     HelpModel.HelpDataContext();
 }
コード例 #18
0
 public ActionResult Help()
 {
     var model = new HelpModel(this);
     return View("~/Views/RestCore/Help.cshtml", model);
 }