コード例 #1
0
        public IActionResult RatesPost()
        {
            IEnumerable <RatesModel> model = ParseResultsForm(Request.Form);

            SQLData.SetRates(model);

            return(RedirectToAction("Rates"));
        }
コード例 #2
0
        public IActionResult Index()
        {
            IndexViewModel model = new IndexViewModel();

            ViewBag.Info1 = SQLData.GetData(1);
            ViewBag.Info2 = SQLData.GetData(2);
            ViewBag.Info3 = SQLData.GetData(3);

            ViewBag.Color1 = ((int)ViewBag.Info1 % 2 == 0 ? "AA0000" : "00AA00");
            ViewBag.Color2 = ((int)ViewBag.Info2 % 2 == 0 ? "AA0000" : "00AA00");
            ViewBag.Color3 = ((int)ViewBag.Info3 % 2 == 0 ? "AA0000" : "00AA00");

            model.SPParameters.Add(String.Empty);
            model.SPParameters.Add(String.Empty);
            model.SPParameters.Add(String.Empty);

            return(View(model));
        }
コード例 #3
0
        public IActionResult IndexPost(IndexViewModel model)
        {
            if (model.Button1 != null)
            {
                SQLData.RunProcedure(model.SPParameters[0], 1);
            }

            if (model.Button2 != null)
            {
                SQLData.RunProcedure(model.SPParameters[1], 2);
            }

            if (model.Button3 != null)
            {
                SQLData.RunProcedure(model.SPParameters[2], 3);
            }

            return(RedirectToAction("Index"));
        }
コード例 #4
0
        public IActionResult Rates()
        {
            List <RatesModel> model = SQLData.GetRates();

            return(View(model));
        }