Пример #1
0
        // GET: Resource
        public ActionResult AllResources()
        {
            ServiceResource sr        = new ServiceResource();
            var             Resources = sr.GetMany(r => r.AccountType == "Ressource");

            return(View(Resources));
        }
        public ActionResult Edit([Bind(Include = "Id,LastName,PasswordHash,SecurityStamp, FirstName,Gender,Photo,Seniority,BusinessProfile,Rating,CV,Photo,HiringDate,Salary,UserName,Email, PhoneNumber,InterMandateId")] Resource rs, HttpPostedFileBase Image)
        {
            if (ModelState.IsValid)
            {
                String fileName = Path.GetFileName(Image.FileName);

                var resou = sv.GetMany().Single(em => em.Id == rs.Id);
                rs.PasswordHash  = resou.PasswordHash;
                rs.SecurityStamp = resou.SecurityStamp;
                rs.Photo         = fileName;



                db.Entry(rs).State = EntityState.Modified;

                db.SaveChanges();
                sv.Commit();
                return(RedirectToAction("Index"));
            }

            return(View(rs));
        }
        // GET: SkillResource/Create
        public ActionResult Create()
        {
            SkillResourceModel pm = new SkillResourceModel();

            pm.Skills = sk.GetMany().Select(c => new SelectListItem
            {
                Text  = c.SkillName,
                Value = c.SkillId.ToString(),
            });
            pm.Resources = sr.GetMany().Select(e => new SelectListItem
            {
                Text  = e.FirstName,
                Value = e.Id,
            });


            return(View(pm));
        }
Пример #4
0
        // GET: Mandate/Create
        public ActionResult Create()
        {
            // ViewBag.IdMandateHistory = new SelectList(db.MandateHistoryModels, "IdMandateHistory", "IdMandateHistory");

            MandateModel re = new MandateModel();

            re.Resources = srs.GetMany().Select(c => new SelectListItem
            {
                Text  = c.UserName,
                Value = c.Id,
            });


            re.Projects = sii.GetMany().Select(cc => new SelectListItem
            {
                Text  = cc.Name,
                Value = cc.Project_id.ToString(),
            });

            return(View(re));
        }