public IActionResult Edit(Delivery delivery)
        {
            var employeeDataString = HttpContext.Session.GetString("employee");

            if (employeeDataString == "")
            {
                return(RedirectToAction("Login", "Auth"));
            }
            else
            {
                Employee employee = JsonConvert.DeserializeObject <Employee>(employeeDataString);

                if (userAccessManager.IsAccessExists(employee.Id, 2))
                {
                    if (ModelState.IsValid)
                    {
                        delivery.ActionBy   = employee.UserName;
                        delivery.ActionTime = DateTime.Now.ToString("F");
                        delivery.ActionDone = ActionAttributes.ActionUpdate;
                        delivery.State      = 1;

                        string updated = deliveryManager.Update(delivery);

                        if (updated.Equals("1"))
                        {
                            return(RedirectToAction("ViewAll", "Delivery"));
                        }
                        else
                        {
                            ViewData["Message"] = updated;
                            return(View(delivery));
                        }
                    }
                    else
                    {
                        ViewData["Message"] = BootstrapMessages.Failed("Fill up all fields correctly");
                        return(View(delivery));
                    }
                }
                else
                {
                    return(NotFound("No Access"));
                }
            }
        }