public ActionResult ConvertDataToCSV(ViewModel model) { var database = new Database(); var arr = database.Histories.ToArray(); return Json(new {result = arr}, JsonRequestBehavior.AllowGet); }
public ActionResult SelectCompressor(ViewModel model) { var database = new Database(); var dateTime = DateTime.Now; string Uname = (string)Session["userName"]; database.Histories.Add(new History { Uname = "oleh", LastActivity = dateTime.ToLongDateString() + dateTime.ToLongTimeString(), ActivityType = "Selected compressor" }); database.SaveChanges(); var compressor = database.Compressor.Where(c => c.PressIn == model.First.PressIn); return Json(new {resp = compressor, success = true}, JsonRequestBehavior.AllowGet); }