public ActionResult index(tblJobMaster _model, string shour, string ehour, string smin, string emin, string sampm, string eampm) { int adminId = Convert.ToInt16(Session["AdminId"]); jobServices _services = new jobServices(); contactServices _ser = new contactServices(); ViewData["users"] = _ser.GetaAllContactsByAdminId(adminId); ViewData["type"] = _services.getAllJobtypes(adminId); ViewData["status"] = _services.getAllStatus(); var date1 = _model.StartDate.Value.Date.ToShortDateString() + " " + shour + ":" + smin + ":00 " + sampm; var date2 = _model.EndDate.Value.Date.ToShortDateString() + " " + ehour + ":" + emin + ":00 " + eampm; _model.EndDate = Convert.ToDateTime(date2); _model.StartDate = Convert.ToDateTime(date1); if (_model.EndDate < _model.StartDate) { ViewData["error"] = "Start Date Can't be grater then End date"; } else { var msg = _services.AddNewjob(_model, adminId); if (msg.Contains("Error")) { ViewData["error"] = msg; return(View("job", _model)); } else { TempData["error"] = msg; return(RedirectToAction("GetJobs")); } } return(View("job", _model)); }
public ActionResult statusList() { StatusViewModel _model = new Models.StatusViewModel(); jobServices _services = new jobServices(); _model = _services.getAllStatus(); if (TempData["error"] != null) { _model.Error = TempData["error"].ToString(); } return(View(_model)); }
public ActionResult MyJobs() { int adminId = Convert.ToInt16(Session["AdminId"]); CalenderJobs _model = new CalenderJobs(); jobServices _ser = new jobServices(); jobServices _services = new jobServices(); contactServices _conser = new contactServices(); ViewData["users"] = _conser.GetaAllContactsByAdminId(adminId); ViewData["type"] = _services.getAllJobtypes(adminId); ViewData["status"] = _services.getAllStatus(); _model = _ser.GetAllTodayTskname(adminId, DateTime.Now); return(View(_model)); }
public ActionResult index(int?id, int?statusId) { int adminId = Convert.ToInt16(Session["AdminId"]); tblJobMaster _model = new tblJobMaster(); jobServices _services = new jobServices(); contactServices _ser = new contactServices(); ViewData["users"] = _ser.GetaAllContactsByAdminId(adminId); ViewData["type"] = _services.getAllJobtypes(adminId); ViewData["status"] = _services.getAllStatus(); ViewData["statusId"] = statusId ?? 0; if (id.HasValue) { _model = _services.GetjobbyId(id.Value); return(View("editjob", _model)); } if (TempData["error"] != null) { ViewData["error"] = TempData["error"].ToString(); } return(View("job", _model)); }