コード例 #1
0
 public IActionResult PushCalendar()
 {
     if (String.IsNullOrEmpty(HttpContext.Request.Form["selecteddatestart"].ToString()) || String.IsNullOrEmpty(HttpContext.Request.Form["selecteddateend"].ToString()) || String.IsNullOrEmpty(HttpContext.Request.Form["reason"].ToString()))
     {
         TempData["message"] = "Please fill all the blanks";
         return(RedirectToAction("Index", "Employee"));
     }
     if ((DbUsers.PostDayOff(HttpContext.Request.Form["selecteddatestart"].ToString(), HttpContext.Request.Form["selecteddateend"].ToString(), HttpContext.Request.Form["reason"].ToString(), (JObject.Parse(TempData.Peek("client").ToString())["email"]).ToString(), _context)) == false)
     {
         System.Diagnostics.Debug.WriteLine("ERROR : can't post the day off");
     }
     return(RedirectToAction("Index", "Employee"));
 }