コード例 #1
0
        public ActionResult AddExperience(SkillDTO SkillDTO)
        {
            var Owner = db.Employees.Find(SkillDTO.Owner);

            if (SkillDTO.SkillID == 0)
            {
                ModelState.AddModelError("", "Please selete a skill.");
                SkillDTO.Type = "Please Choose...";
                ViewBag.Type  = new SelectList(db.Skills.GroupBy(x => x.Type).Select(s => s.Key));
                return(View(SkillDTO));
            }

            var Skill = db.Skills.Find(SkillDTO.SkillID);

            if (Owner.Skills.Contains(Skill))
            {
                ModelState.AddModelError("", SkillDTO.Owner + " already has this skill.");
                ViewBag.Type  = new SelectList(db.Skills.GroupBy(x => x.Type).Select(s => s.Key));
                SkillDTO.Type = "Please Choose...";
                return(View(SkillDTO));
            }
            Owner.Skills.Add(Skill);
            EmployeeSkillDetail detail = new EmployeeSkillDetail();

            detail.Comment    = SkillDTO.Comment;
            detail.Date       = Convert.ToDateTime(SkillDTO.Date);
            detail.Assessedby = SkillDTO.Assessedby;
            detail.Type       = SkillDTO.Type;
            detail.Employee   = SkillDTO.Owner;
            detail.Level      = Skill.Level;
            detail.Skill      = Skill.Name;
            db.EmployeeSkillDetails.Add(detail);
            db.SaveChanges();
            return(RedirectToAction("Index", "Home"));
        }
コード例 #2
0
        public ProfessionalDetailsController(IEmpSkillsService IEmpSkillsService, ISkillsetService ISkillsetService, IProfessionalDetailsService IProfessionalDetailsService)
        {
            this._IEmpSkillsService           = IEmpSkillsService;
            this._ISkillsetService            = ISkillsetService;
            this._IProfessionalDetailsService = IProfessionalDetailsService;

            _employeeSkillDetail = new EmployeeSkillDetail();
            _skillsMaster        = new Master_SkillSet();
            _professional        = new EmployeeProfessionalDetail();
        }
コード例 #3
0
        public ActionResult AddEditSkills(int SkillId = 0, bool IsReadOnly = false)
        {
            ViewBag.Skill_lst = GetAllSkills();
            ViewBag.Year_lst  = GetYears();
            ViewBag.Month_lst = GetMonths();

            ViewBag.IsReadOnly = IsReadOnly;
            ViewBag.IsEditPage = false;
            if (System.Web.HttpContext.Current.Request.IsAuthenticated)
            {
                userId   = Convert.ToInt32(System.Web.HttpContext.Current.User.Identity.Name.Split('|')[1]);
                userName = System.Web.HttpContext.Current.User.Identity.Name.Split('|')[0];

                //var res = user.Where(u => u.Password == details.Password && u.Email.ToLower() == details.Email.ToLower()).SingleOrDefault();
                var empskills_lst = _IEmpSkillsService.GetAll(null, null, "");
                Session["empskills_lst"] = empskills_lst;
                var obj = empskills_lst.Where(u => u.UserId == userId && u.Id == SkillId).FirstOrDefault();
                if (obj != null)
                {
                    _employeeSkillDetail = obj;
                }
            }
            Models.EmpSkillDetailsModel model = new EmpSkillDetailsModel();
            if (SkillId != 0)
            {
                Mapper.CreateMap <Data.EmployeeSkillDetail, Models.EmpSkillDetailsModel>();
                model = Mapper.Map <Data.EmployeeSkillDetail, Models.EmpSkillDetailsModel>(_employeeSkillDetail);


                ViewBag.IsEditPage = true;

                model.ExprInMonths = model.ExprInMonths + 1;
                model.ExprInYears  = model.ExprInYears + 1;
            }

            model.ProfessionalDetailsModel = new Models.ProfessionalDetailsModel();
            var profobj = _IProfessionalDetailsService.GetAll(null, null, "");

            if (profobj != null)
            {
                var data = profobj.Where(x => x.UserID == userId).FirstOrDefault();
                if (data != null)
                {
                    model.ProfessionalDetailsModel.ExprInYears  = data.TotalExprInYears.ToString();
                    model.ProfessionalDetailsModel.ExprInMonths = data.TotalExprInMonths.ToString();
                }
            }



            return(View("AddSkills", model));
        }
コード例 #4
0
 public bool Update(EmployeeSkillDetail obj, string[] param, string spName)
 {
     return(_IEmpSkillsRepository.Update(obj, param, spName));
 }
コード例 #5
0
 public bool Insert(EmployeeSkillDetail obj, string[] param, string spName)
 {
     return(_IEmpSkillsRepository.Insert(obj, param, spName));
 }
コード例 #6
0
 public IEnumerable <EmployeeSkillDetail> GetAll(EmployeeSkillDetail obj, string[] param, string spName)
 {
     return(_IEmpSkillsRepository.GetAll(obj, param, spName));
 }