public ActionResult DreamSubmit(DreamGridDisplayModel dreamModel) { var _service = new DreamService(); var dreamTable=new tbDream(); ProfileService profileService = new ProfileService(); dreamTable.EMPID = HttpContext.User.Identity.Name ?? string.Empty; dreamTable.EMPNAME = profileService.getEmpName(HttpContext.User.Identity.Name) == null ? String.Empty : profileService.getEmpName(HttpContext.User.Identity.Name); //dreamTable.LOCATION = profileService.getPhone(empID) == null ? String.Empty : profileService.getPhone(empID); dreamTable.LOCATION = profileService.getLocation(HttpContext.User.Identity.Name) == null ? String.Empty : profileService.getLocation(HttpContext.User.Identity.Name); dreamTable.DTITLE=dreamModel.DreamTitle ?? string.Empty; dreamTable.DDESCRIPTION = dreamModel.DreamDescription ?? string.Empty; dreamTable.SUBMITTEDDATE = DateTime.Now; dreamTable.STATUSID = 1; _service.DreamFormSubmit(dreamTable); return View(); }
public JsonResult DreamGridData() { int page = int.Parse(Request.QueryString["page"]); int rows = int.Parse(Request.QueryString["rows"]); var _service = new DreamService(); var gridData = _service.DreamGridDisplay(); var jsonData = new { total = gridData.Count / 10, //todo: calculate page = page, records = gridData.Count, rows = (from data in gridData select new { id = data.DreamId, cell = new string[] { data.DreamId.ToString(), data.DreamTitle ?? "", data.DreamDescription ?? "", data.EmpId ?? "", data.EmpName ?? "", data.Location?? "", data.SubmittedDate ?? string.Empty, getStatus(int.Parse(data.Status)) ?? "", data.ContactPerson ?? "" } }).Skip((page) * rows - rows).Take(rows).ToArray() }; return Json(jsonData, JsonRequestBehavior.AllowGet); }
public JsonResult DreamFormBind(String id) { var _service = new DreamService(); var modelDataToReturn= _service.DreamFormBind(id); return Json(modelDataToReturn, JsonRequestBehavior.AllowGet); }
public ActionResult DreamView(DreamGridDisplayModel dreamModel) { var _service = new DreamService(); _service.DreamFormUpdate(dreamModel); return View(dreamModel); }