public ActionResult Create()
 {
     if (CheckAccess())
     {
         TempData["JobCategory"] = jobcatrepo.GetAll();
         return(View());
     }
     else
     {
         return(RedirectToAction("Login", "Home"));
     }
 }
 public ActionResult UpdateProfile()
 {
     if (Session["UserType"].ToString() == "Customer")
     {
         var profile     = customerrepo.GetByUserName(Session["UserName"].ToString());
         var profileview = new ProfileViewModel();
         profileview.Id             = profile.CustomerId;
         profileview.Name           = profile.CustomerName;
         profileview.UserName       = profile.UserName;
         profileview.Gender         = profile.Gender;
         profileview.Email          = profile.Email;
         profileview.DateOfBirth    = profile.DateOfBirth;
         profileview.Address        = profile.Address;
         profileview.ProfilePicture = profile.ProfilePicture;
         profileview.Status         = profile.Status;
         return(View(profileview));
     }
     else if (Session["UserType"].ToString() == "Vendor")
     {
         var profile     = vendorrepo.GetByUserName(Session["UserName"].ToString());
         var profileview = new ProfileViewModel();
         profileview.Id             = profile.VendorId;
         profileview.Name           = profile.VendorName;
         profileview.UserName       = profile.UserName;
         profileview.Gender         = profile.Gender;
         profileview.Email          = profile.Email;
         profileview.DateOfBirth    = profile.DateOfBirth;
         profileview.Address        = profile.Address;
         profileview.ProfilePicture = profile.ProfilePicture;
         profileview.Status         = profile.Status;
         return(View(profileview));
     }
     else
     {
         var profile = employeerepo.GetByUserName(Session["UserName"].ToString());
         TempData["JobCategory"] = jobcatrepo.GetAll();
         var profileview = new ProfileViewModel();
         profileview.Id             = profile.EmployeeId;
         profileview.Name           = profile.EmployeeName;
         profileview.UserName       = profile.UserName;
         profileview.Gender         = profile.Gender;
         profileview.Email          = profile.Email;
         profileview.DateOfBirth    = profile.DateOfBirth;
         profileview.Address        = profile.Address;
         profileview.JoiningDate    = profile.JoiningDate;
         profileview.ProfilePicture = profile.ProfilePicture;
         profileview.JobId          = profile.JobId;
         profileview.Status         = profile.Status;
         return(View(profileview));
     }
 }
Exemplo n.º 3
0
 public IHttpActionResult JobCategoryList()
 {
     return(Ok(jobcatrepo.GetAll()));
 }