public ActionResult Create2(Resource rm)
        {
            //rm.Photo = Image.FileName;
            try
            {
                Resource rc = new Resource
                {
                    LastName        = rm.LastName,
                    FirstName       = rm.FirstName,
                    Gender          = rm.Gender,
                    Seniority       = rm.Seniority,
                    BusinessProfile = rm.BusinessProfile,
                    Rating          = rm.Rating,
                    CV         = rm.CV,
                    Photo      = rm.Photo,
                    HiringDate = rm.HiringDate,
                    Salary     = rm.Salary,
                    UserName   = rm.UserName,
                    Email      = rm.Email,
                    //EmailConfirmed = true,
                    //PasswordHash = rm.PasswordHash,
                    //SecurityStamp = rm.SecurityStamp,
                    PhoneNumber = rm.PhoneNumber,
                    //PhoneNumberConfirmed = true,
                    TwoFactorEnabled = true,
                    //LockoutEnabled = true,
                    LockoutEndDateUtc = rm.LockoutEndDateUtc,
                    //AccessFailedCount = rm.AccessFailedCount,
                    InterMandateId = rm.InterMandateId
                };


                sv.Add(rc);
                sv.Commit();
                //var path = Path.Combine(Server.MapPath("~/Content/Upload/"), Image.FileName);
                //Image.SaveAs(path);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 2
0
        public ActionResult Delete(int id, FormCollection collection)
        {
            User            u  = new User();
            ServiceResource Sr = new ServiceResource();

            u = Sr.GetById(id);
            Sr.Delete(u);
            Sr.Commit();

            return(RedirectToAction("AllResources"));
        }
Exemplo n.º 3
0
        public ActionResult Edit(int id, RessourceViewModel rvm)
        {
            User            u  = new User();
            ServiceResource Sr = new ServiceResource();

            u             = Sr.GetById(id);
            u.UserName    = rvm.UserName;
            u.PhoneNumber = rvm.PhoneNumber;
            u.Email       = rvm.Email;
            Sr.Update(u);
            Sr.Commit();
            return(RedirectToAction("AllResources"));
        }