public ActionResult Delete(int id, OfferViewModel OfferViewModel)
        {
            OfferJobs offer = serviceOffer.GetById(id);

            OfferViewModel.offerId         = offer.offerId;
            OfferViewModel.JobDescription  = offer.JobDescription;
            OfferViewModel.JobExperience   = offer.JobExperience;
            OfferViewModel.JobRequirements = offer.JobRequirements;
            OfferViewModel.JobType         = offer.JobType;
            OfferViewModel.LastDay         = offer.LastDay;
            OfferViewModel.PostedOn        = offer.PostedOn;
            OfferViewModel.ExpectedSalary  = offer.ExpectedSalary;

            Admin a = serviceAdmin.GetById(id);

            OfferViewModel.userId = offer.userId;

            try
            {
                // TODO: Add delete logic here
                serviceOffer.Delete(offer);
                serviceOffer.Commit();
                return(RedirectToAction("Index", ""));
            }
            catch
            {
                return(View());
            }
        }
        // GET: Offer/Details/5
        public ActionResult Details(int id)
        {
            List <String> spec = (new List <String> {
                "Software Engineering", "Graphic Designing", "Front end Developer", "IT Specialist"
            });

            ViewBag.list = spec;

            OfferJobs    offer        = serviceOffer.GetById(id);
            BigViewModel bigViewModel = new BigViewModel();


            OfferViewModel offerViewModel = new OfferViewModel();

            offerViewModel.offerId = id;

            offerViewModel.JobType         = offer.JobType;
            offerViewModel.JobDescription  = offer.JobDescription;
            offerViewModel.JobExperience   = offer.JobExperience;
            offerViewModel.JobRequirements = offer.JobRequirements;
            offerViewModel.offerId         = offer.offerId;
            //OfferViewModel.userId = item.userId;
            offerViewModel.PostedOn       = offer.PostedOn;
            offerViewModel.LastDay        = offer.LastDay;
            offerViewModel.ExpectedSalary = offer.ExpectedSalary;
            bigViewModel.offerViewModel   = offerViewModel;
            JobRequest jobRequestTest = serviceJob.getJobRequest(User.Identity.GetUserId <int>());

            if (jobRequestTest != null)
            {
                ViewBag.Message = "Vous avez deja inscrit";
            }
            return(View(bigViewModel));
        }
        public ActionResult Create(OfferViewModel OfferViewModel)
        {
            OfferJobs offer = new OfferJobs();

            List <String> type = (new List <String> {
                "Integrator", "Full stack", "Tester", "Network & Security", "Business Intelligence", "Data science", "Data analytics"
            });

            ViewBag.list = type;

            List <String> experience = (new List <String> {
                "More than one year", "More than 2 years", "More than 3 years", "More than 4 years", "More than 5 years"
            });

            ViewBag.list1 = experience;

            offer.userId          = User.Identity.GetUserId <int>();
            offer.JobType         = OfferViewModel.JobType;
            offer.JobDescription  = OfferViewModel.JobDescription;
            offer.JobRequirements = OfferViewModel.JobRequirements;
            offer.JobExperience   = OfferViewModel.JobExperience;
            offer.ExpectedSalary  = OfferViewModel.ExpectedSalary;
            //offer.PostedOn = collection.PostedOn;
            offer.PostedOn = DateTime.Today;
            offer.LastDay  = OfferViewModel.LastDay;

            //var dateCreation = DateTime.Now.ToString("dd/MM/yyyy");

            try
            {
                // TODO: Add insert logic here
                serviceOffer.Add(offer);
                serviceOffer.Commit();
                return(RedirectToAction("Index", ""));
            }
            catch
            {
                return(View());
            }
        }