Пример #1
0
        public ActionResult <Models.About> Get()
        {
            Microsoft.AspNetCore.Http.HttpContext context = Request.HttpContext;
            System.Net.IPAddress   ip    = context.Connection.RemoteIpAddress;
            Dashboard.Models.About about = new Models.About();

            about.Client.Host         = ip.ToString();
            about.Server.current_time = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
            about.Server.Services     = serviceRepo.GetAll();
            return(about);
        }
Пример #2
0
        public void Update_About(Models.About oAbout)
        {
            SqlCommand com = new SqlCommand("Sp_UpdateAbout", con);

            com.CommandType = CommandType.StoredProcedure;
            com.Parameters.AddWithValue("@AboutId", oAbout.AboutId);
            com.Parameters.AddWithValue("@ATitle", oAbout.ATitle);
            com.Parameters.AddWithValue("@Body", oAbout.ABody);
            con.Open();
            com.ExecuteNonQuery();
            con.Close();
        }
Пример #3
0
        public IActionResult Index()
        {
            List <string> _casesStudies = new List <string>();

            _casesStudies.Add("Case Studiy 1");
            Models.About _about = new Models.About()
            {
                Intro       = "This is the intro for the about page",
                CaseStudies = _casesStudies
            };
            return(View(_about));
        }
Пример #4
0
        public JsonResult GetAbout()
        {
            List <Models.About> abouts = new List <Models.About>();

            try
            {
                List <About> aboutList = _repository.GetAbout();
                if (aboutList != null)
                {
                    foreach (var about in aboutList)
                    {
                        Models.About abtObj = _mapper.Map <Models.About>(about);
                        abouts.Add(abtObj);
                    }
                }
            }catch (Exception ex)
            {
                abouts = null;
            }
            return(new JsonResult(abouts));
        }