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); }
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(); }
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)); }
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)); }