Ejemplo n.º 1
0
        public ActionResult LeaveResponse(int?id)
        {
            IStructuredetailRepository repo    = new StructuredetailRepository();
            IDepartmentRepository      deprepo = new DepartmentRepository();
            IEmployeeRepository        emprepo = new EmployeeRepository();

            var Data = (from req in repo.GetReq()
                        join emp in emprepo.GetAll() on req.EmployeeId equals emp.EmployeeId
                        join pos in repo.Getpos() on req.PositionId equals pos.Id
                        join dep in deprepo.GetAll() on emp.DepartmentId equals dep.DepartmentId
                        where req.RequestId == id
                        select new RequestVM
            {
                EmployeeId = (int)req.EmployeeId,
                EmployeeName = emp.EmployeeName,
                CityName = emp.CityName,
                DateofRequest = (DateTime)req.DateofRequest,
                RequestId = req.RequestId,
                Position = pos.Position,
                DepartmentName = dep.DepartmentName,
                ReasonofRequest = req.ReasonofRequest,
                FromDate = (DateTime)req.FromDate,
                ToDate = (DateTime)req.ToDate,
                Leavetype = req.LeaveType
            }).FirstOrDefault();


            return(View(Data));
        }
Ejemplo n.º 2
0
      public ActionResult GetPromotedEmpSalary(int?Id)
      {
          IStructuredetailRepository repo = new StructuredetailRepository();

          var data = (from emp in repo.Getemp()
                      join pos in repo.Getpos() on emp.PositionId equals pos.Id
                      select new
            {
                emp.EmployeeId,
                emp.EmployeeName,
                emp.PositionId,
                pos.Position,
                pos.BasicPay,
                pos.Experience,
                emp.Email
            }).Where(x => x.EmployeeId == Id).Select(c => new PositionVM()
            {
                EmployeeName = c.EmployeeName,
                EmployeeId   = (int)c.EmployeeId,
                PositionId   = (int)c.PositionId,
                Position     = c.Position,
                BasicPay     = (decimal)c.BasicPay,
                Description  = "Congratulations, " + c.EmployeeName + " based on your Performance and " + c.Experience + " Experience You have Been Promoted to " + c.Position + " Position and your Basic Salary is increased to " + c.BasicPay + ". Regards",
                Email        = c.Email
            }).FirstOrDefault();


          return(PartialView("EmployeePromotionSalaryPartial", data));
      }
Ejemplo n.º 3
0
        public ActionResult GetDetails(int?id)
        {
            IStructuredetailRepository repo    = new StructuredetailRepository();
            IDepartmentRepository      deprepo = new DepartmentRepository();

            var data = (from d in repo.GetVacancies()
                        join dep in deprepo.GetAll() on d.DepartmentId equals dep.DepartmentId
                        where d.VacancyId == id
                        select new
            {
                d.VacancyId,
                d.VacancyName,
                d.JobLevel,
                dep.DepartmentName,
                d.CityName,
                d.RequiredQualification
            }).Select(c => new VacancyVM()
            {
                VacancyId             = c.VacancyId,
                JobLevel              = (int)(c.JobLevel),
                VacancyName           = c.VacancyName,
                CityName              = c.CityName,
                DepartmentName        = c.DepartmentName,
                RequiredQualification = c.RequiredQualification
            }).FirstOrDefault();


            return(PartialView("JobDetailsPartial", data));
        }
Ejemplo n.º 4
0
        public ActionResult LeavesonPosition(PositionVM model)
        {
            IStructuredetailRepository objstructureRepository = new StructuredetailRepository();
            IEmployeeRepository        obj = new EmployeeRepository();
            var check   = obj.Getleave().Where(x => x.PositionId == model.PositionId).FirstOrDefault();
            var deplist = objstructureRepository.Getdep().ToList();

            if (check == null)
            {
                var add = obj.Addleavepos(model.PositionId, model.CasualLeave, model.SickLeave);
                obj.Addleave(add);
                obj.Save();


                SelectList list = new SelectList(deplist, "DepartmentId", "DepartmentName");
                ViewBag.getdeplist = list;


                TempData["SuccessMessage11"] = "Leaves Assigned to Position Sucessfully";
            }
            else
            {
                obj.Updateleave(model.PositionId, model.CasualLeave, model.SickLeave);
                obj.Save();

                SelectList list = new SelectList(deplist, "DepartmentId", "DepartmentName");
                ViewBag.getdeplist = list;

                TempData["SuccessMessage11"] = "Leaves Updated Sucessfully";
            }
            return(View());
        }
Ejemplo n.º 5
0
      public ActionResult RemoveTable(int?Id)
      {
          IStructuredetailRepository repo    = new StructuredetailRepository();
          IDepartmentRepository      deprepo = new DepartmentRepository();

          var data = (from emp in repo.Getemp()
                      join pos in repo.Getpos() on emp.PositionId equals pos.Id
                      select new
            {
                emp.EmployeeId,
                emp.EmployeeName,
                emp.PositionId,
                emp.CityName,
                emp.Contact,
                emp.Email,
                emp.DateofBirth,
                emp.Gender,
                pos.Position,
                pos.Experience
            }).Where(x => x.PositionId != Id).Select(c => new PositionVM()
            {
                EmployeeName = c.EmployeeName,
                EmployeeId   = (int)c.EmployeeId,
                Gender       = c.Gender,
                Experience   = c.Experience,
                CityName     = c.CityName,
                Contact      = c.Contact,
                Email        = c.Email,
                DateofBirth  = (DateTime)c.DateofBirth,
                PositionId   = (int)c.PositionId,
                Position     = c.Position
            });

          return(Json(data, JsonRequestBehavior.AllowGet));
      }
Ejemplo n.º 6
0
      public ActionResult PromotionDetails(int?Id)
      {
          IStructuredetailRepository repo = new StructuredetailRepository();

          var Data = (from emp in repo.Getemp()
                      join empdet in repo.Getempdet() on emp.EmployeeId equals empdet.EmployeeId
                      join pos in repo.Getpos() on emp.PositionId equals pos.Id
                      select new
            {
                emp.EmployeeId,
                emp.EmployeeName,
                emp.PositionId,
                pos.Position,
                empdet.EmployeeSalary,
                empdet.DateofPromotion
            }).Where(x => x.EmployeeId == Id).Select(c => new PositionVM()
            {
                EmployeeName    = c.EmployeeName,
                EmployeeId      = (int)c.EmployeeId,
                Position        = c.Position,
                Employeesalary  = (decimal)c.EmployeeSalary,
                DateofPromotion = (DateTime)c.DateofPromotion
            }).FirstOrDefault();



          return(View(Data));
      }
Ejemplo n.º 7
0
        public ActionResult GetIdonConfirm(int?id)
        {
            IRepository obj = new ApplicantRepository();
            IStructuredetailRepository repo    = new StructuredetailRepository();
            IDepartmentRepository      deprepo = new DepartmentRepository();

            var result = (from d in obj.GetAll()
                          join s in repo.GetVacancies() on d.VacancyId equals s.VacancyId
                          join dep in deprepo.GetAll() on s.DepartmentId equals dep.DepartmentId
                          where d.ApplicationId == id
                          select new
            {
                d.ApplicationId,
                d.Email,
                d.Appliedfor,
                dep.DepartmentName,
                d.ApplicantName
            }).Select(c => new CandidateEmployeeVM()
            {
                ApplicationId  = (int)(c.ApplicationId),
                Email          = c.Email,
                Position       = c.Appliedfor,
                DepartmentName = c.DepartmentName,
                EmployeeName   = c.ApplicantName
            }).FirstOrDefault();


            return(PartialView("ConfirmPartial", result));
        }
Ejemplo n.º 8
0
        public ActionResult ViewLeaveResponse(int?id)
        {
            IStructuredetailRepository repo    = new StructuredetailRepository();
            IDepartmentRepository      deprepo = new DepartmentRepository();
            IEmployeeRepository        emprepo = new EmployeeRepository();

            var Data = (from req in repo.GetReq()
                        join emp in emprepo.GetAll() on req.EmployeeId equals emp.EmployeeId
                        join pos in repo.Getpos() on req.PositionId equals pos.Id
                        join cupos in repo.Getpos() on emp.PositionId equals cupos.Id
                        join dep in deprepo.GetAll() on emp.DepartmentId equals dep.DepartmentId
                        where req.RequestId == id
                        select new RequestVM
            {
                EmployeeId = (int)req.EmployeeId,
                EmployeeName = emp.EmployeeName,
                CityName = emp.CityName,
                DateofRequest = (DateTime)req.DateofRequest,
                RequestId = req.RequestId,
                Position = cupos.Position,
                DepartmentName = dep.DepartmentName,
                PositiontoTransfer = pos.Position,
                positionid = (int)req.PositionId,
                CitytoTransfer = req.CitytoTranser,
                ReasonofRequest = req.ReasonofRequest,
                Status = req.Status,
                ResponseReason = req.ResponseReason
            }).FirstOrDefault();

            return(View(Data));
        }
Ejemplo n.º 9
0
      public ActionResult UpdateSeenPromotion(PositionVM model)
      {
          IStructuredetailRepository obj = new StructuredetailRepository();

          obj.updateseenPro(Convert.ToInt32(model.EmployeeId));
          obj.Save();

          return(Json(new { success = true }, JsonRequestBehavior.AllowGet));
      }
Ejemplo n.º 10
0
      public ActionResult Promotions()
      {
          IStructuredetailRepository repo = new StructuredetailRepository();
          var deplist = repo.Getdep().ToList();

          SelectList list = new SelectList(deplist, "DepartmentId", "DepartmentName");

          ViewBag.getdep1list = list;

          return(View());
      }
Ejemplo n.º 11
0
        public ActionResult LeavesonPosition()
        {
            IStructuredetailRepository objstructureRepository = new StructuredetailRepository();
            var deplist = objstructureRepository.Getdep().ToList();

            SelectList list = new SelectList(deplist, "DepartmentId", "DepartmentName");

            ViewBag.getdeplist = list;

            return(View());
        }
Ejemplo n.º 12
0
        public ActionResult LeaveResponseReject(RequestVM model)
        {
            var empname = Session["Employeename"].ToString();
            IStructuredetailRepository obj = new StructuredetailRepository();

            obj.updatereqtrej(model.RequestId, empname, model.ResponseReasonrej);
            obj.Save();
            TempData["SuccessMessage101"] = "Rejected";

            return(RedirectToAction("Index", "Home"));
        }
Ejemplo n.º 13
0
        public ActionResult Assignroles()
        {
            IStructuredetailRepository objstructureRepository = new StructuredetailRepository();

            var rolelist = objstructureRepository.Getroles().ToList();

            SelectList list = new SelectList(rolelist, "Id", "RoleName");

            ViewBag.getrolelist = list;

            return(View());
        }
Ejemplo n.º 14
0
        public ActionResult Apply(int?id)
        {
            IStructuredetailRepository obj = new StructuredetailRepository();
            var Data = obj.GetVacancies()
                       .Select(x => new ApplyVM {
                VacancyId = x.VacancyId, Appliedfor = x.VacancyName
            })
                       .Where(x => x.VacancyId == id).FirstOrDefault();


            return(View(Data));
        }
Ejemplo n.º 15
0
        public ActionResult Position(PositionVM obj, FormCollection form)
        {
            IStructuredetailRepository objstructureRepository = new StructuredetailRepository();
            var deplist = objstructureRepository.Getdep().ToList();
            var depname = form["txtname"];

            var check  = objstructureRepository.validation(depname).FirstOrDefault();
            var check1 = objstructureRepository.validation1(obj.Position).FirstOrDefault();
            var check3 = objstructureRepository.validation2(obj.JobLevel).FirstOrDefault();

            if (check != null && check1 != null && check3 != null || check3 == null && check1 != null)
            {
                SelectList list = new SelectList(deplist, "DepartmentId", "DepartmentName");
                ViewBag.getdeplist = list;
                var levellist = new SelectList(new[]
                {
                    new { ID = "1", Name = "1" },
                    new { ID = "2", Name = "2" },
                    new { ID = "3", Name = "3" },
                    new { ID = "4", Name = "4" },
                    new { ID = "5", Name = "5" }
                },
                                               "Name", "Name", "1"
                                               );
                ViewBag.getlevellist = levellist;

                TempData["ErrorMessage9"] = "Position " + obj.Position + " Already Exists";
            }
            else
            {
                SelectList list = new SelectList(deplist, "DepartmentId", "DepartmentName");
                ViewBag.getdeplist = list;
                var levellist = new SelectList(new[]
                {
                    new { ID = "1", Name = "Low" },
                    new { ID = "2", Name = "Medium" },
                    new { ID = "3", Name = "High" }
                },
                                               "Name", "Name", "1"
                                               );
                ViewBag.getlevellist = levellist;


                var add = objstructureRepository.Addpos(Convert.ToInt32(obj.DepartmentId), obj.JobLevel, obj.Position, Convert.ToDecimal(obj.BasicPay), Convert.ToDecimal(obj.IncomeTax), obj.Experience);
                objstructureRepository.Add(add);
                objstructureRepository.Save();

                TempData["SuccessMessage9"] = "Position Created Sucessfully";
                return(RedirectToAction("ViewPosition", "Admin"));
            }

            return(View());
        }
Ejemplo n.º 16
0
      public ActionResult EmployeePositionUpdate(PositionVM model)
      {
          IStructuredetailRepository repo = new StructuredetailRepository();

          repo.updatepos(model.EmployeeId, model.posidtopro);
          repo.Save();
          repo.updateempdetailpro(model.EmployeeId);
          repo.Save();


          TempData["SuccessMessage11"] = "Success";
          return(Json(new { success = true }, JsonRequestBehavior.AllowGet));
      }
Ejemplo n.º 17
0
        public ActionResult TransferResponse(RequestVM model)
        {
            var empname = Session["Employeename"].ToString();
            IStructuredetailRepository obj = new StructuredetailRepository();

            obj.updatetransapp(model.EmployeeId, model.CitytoTransfer, model.positionid);
            obj.Save();

            obj.updatereqt(model.RequestId, empname, model.ResponseReason);
            obj.Save();
            TempData["SuccessMessage101"] = "Successfully Approved";

            return(RedirectToAction("Index", "Home"));
        }
Ejemplo n.º 18
0
        public ActionResult DefineStructure(StructureDetails viewModel)
        {
            IStructuredetailRepository objstruct = new StructuredetailRepository();


            var validate = objstruct.Getcondition(viewModel.CompanyCode, viewModel.CityCode, viewModel.CityName).FirstOrDefault();

            var validate1 = objstruct.Getcondition1(viewModel.CompanyCode, viewModel.CityCode).FirstOrDefault();

            var validate3 = objstruct.Getcondition2(viewModel.CityCode, viewModel.CityName).FirstOrDefault();

            var check = objstruct.Getcondition3(viewModel.CityCode).FirstOrDefault();

            var check1 = objstruct.Getcondition4(viewModel.CityName).FirstOrDefault();

            var check2 = objstruct.Getcondition5(viewModel.CompanyCode).FirstOrDefault();


            if (validate == null && validate3 != null || validate1 == null && check1 == null || !objstruct.GetAll().Any())
            {
                if (ModelState.IsValid)
                {
                    objstruct.Add(viewModel.CompanyCode, viewModel.CityCode, viewModel.CompanyName, viewModel.CityName);
                    objstruct.Save();
                    RedirectToAction("StructureList", "Home");
                    TempData["SuccessMessage"] = "Structure Created";
                }
                else
                {
                    TempData["ErrorMessage"] = "Unable to Add";
                }
            }
            else if (validate1 != null)
            {
                TempData["ErrorMessage"] = ("CompanyCode " + viewModel.CompanyCode + " with CityCode " + viewModel.CityCode + "Already Exists");
            }
            else if (validate3 != null)
            {
                TempData["ErrorMessage"] = ("City Code " + viewModel.CityCode + " with City " + viewModel.CityName + " already Exists");
            }
            else if (validate != null && validate1 != null && validate3 != null)
            {
                TempData["ErrorMessage"] = ("Company Code " + viewModel.CompanyCode + " with City Code " + viewModel.CityCode + "and" + viewModel.CityName + " Already Exists");
            }
            else
            {
                TempData["ErrorMessage"] = ("City with Name " + viewModel.CityName + " already Exists in Company Code " + viewModel.CompanyCode + "");
            }
            return(View(viewModel));
        }
Ejemplo n.º 19
0
        public ActionResult RequestTransfer()
        {
            IStructuredetailRepository objstructureRepository = new StructuredetailRepository();
            var        poslist = objstructureRepository.Getpos().ToList();
            var        city    = Session["CityName"].ToString();
            SelectList list    = new SelectList(poslist, "Id", "Position");

            ViewBag.getposlist = list;
            if (city == "Karachi")
            {
                var cityname = new SelectList(new[]
                {
                    new { ID = "1", Name = "Lahore" },
                    new { ID = "2", Name = "Islamabad" }
                },
                                              "Name", "Name", "1"
                                              );
                ViewBag.CitytoTransfer = cityname;
            }
            else if (city == "Lahore")
            {
                var cityname = new SelectList(new[]
                {
                    new { ID = "1", Name = "Karachi" },
                    new { ID = "2", Name = "Islamabad" }
                },
                                              "Name", "Name", "1"
                                              );

                ViewBag.CitytoTransfer = cityname;
            }
            else if (city == "Islamabad")
            {
                var cityname = new SelectList(new[]
                {
                    new { ID = "1", Name = "Karachi" },
                    new { ID = "2", Name = "Lahore" }
                },
                                              "Name", "Name", "1"
                                              );
                ViewBag.CitytoTransfer = cityname;
            }
            var CurrentPosition = Session["Position"].ToString();

            ViewBag.currentpos = CurrentPosition;

            return(View());
        }
Ejemplo n.º 20
0
      public ActionResult GetPositionbyposId(int?Id, int?depid, int?joblevel)
      {
          IStructuredetailRepository obj = new StructuredetailRepository();
          var Data = (from pos in obj.Getpos()
                      select new
            {
                pos.Id,
                pos.DepartmentId,
                pos.JobLevel,
                pos.Position
            }).Where(x => x.Id != Id).Where(a => a.DepartmentId == depid && a.JobLevel > joblevel).Select(x => new PositionVM {
                Id = x.Id, Position = x.Position
            });


          return(Json(Data, JsonRequestBehavior.AllowGet));
      }
Ejemplo n.º 21
0
        public ActionResult GetvacList()
        {
            IStructuredetailRepository repo    = new StructuredetailRepository();
            IDepartmentRepository      objrepo = new DepartmentRepository();

            var Data = (from u in repo.Get()
                        join a in objrepo.GetAll() on u.DepartmentId equals a.DepartmentId
                        join b in repo.Getpos() on u.PositionId equals b.Id
                        select new
            {
                a.DepartmentName,
                b.Position,
                u.Availableseats,
                u.Id,
            }).ToList();

            return(Json(new { data = Data }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 22
0
        public ActionResult GetPosList()
        {
            IDepartmentRepository      objdepartmentRepository = new DepartmentRepository();
            IStructuredetailRepository objstructrepo           = new StructuredetailRepository();


            var Data = (from pos in objstructrepo.Getpos()
                        join dep in objdepartmentRepository.GetAll() on pos.DepartmentId equals dep.DepartmentId
                        select new
            {
                dep.DepartmentName,
                pos.JobLevel,
                pos.Position,
                pos.Id
            }).ToList();

            return(Json(new { data = Data }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 23
0
        public ActionResult GetSlCandidates(int?id)
        {
            IRepository obj = new ApplicantRepository();
            IStructuredetailRepository repo    = new StructuredetailRepository();
            IDepartmentRepository      deprepo = new DepartmentRepository();
            var Emp = (from d in obj.GetAll()
                       join s in repo.GetVacancies() on d.VacancyId equals s.VacancyId
                       join dep in deprepo.GetAll() on s.DepartmentId equals dep.DepartmentId
                       join pos in repo.Getpos() on s.PositionId equals pos.Id
                       where d.ApplicationId == id
                       select new
            {
                d.ApplicantName,
                d.Gender,
                s.DepartmentId,
                s.PositionId,
                d.Dob,
                d.Phone,
                d.Email,
                d.Address,
                d.ApplicationId,
                dep.DepartmentName,
                pos.Position,
                pos.BasicPay
            }).Select(c => new CandidateEmployeeVM()
            {
                ApplicationId  = (int)(c.ApplicationId),
                EmployeeName   = c.ApplicantName,
                Gender         = c.Gender,
                DepartmentId   = (int)(c.DepartmentId),
                DepartmentName = c.DepartmentName,
                PositionId     = (int)c.PositionId,
                DateofBirth    = (DateTime)c.Dob,
                Contact        = c.Phone,
                Email          = c.Email,
                Address        = c.Address,
                Position       = c.Position,
                Salary         = (decimal)c.BasicPay,
                PosSalary      = (decimal)c.BasicPay
            }).FirstOrDefault();


            return(PartialView("HireEmployee", Emp));
        }
Ejemplo n.º 24
0
        public ActionResult Getcreatedvaclist()
        {
            IStructuredetailRepository repo    = new StructuredetailRepository();
            IDepartmentRepository      objrepo = new DepartmentRepository();

            var Data = (from u in repo.GetVacancies()
                        join a in objrepo.GetAll() on u.DepartmentId equals a.DepartmentId
                        join b in repo.Getpos() on u.PositionId equals b.Id
                        select new
            {
                a.DepartmentName,
                b.Position,
                u.JobLevel,
                u.MarksCriteria,
                u.Testpaper,
            }).ToList();

            return(Json(new { data = Data }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 25
0
      public ActionResult GetPromotedEmployeesList()
      {
          IStructuredetailRepository repo = new StructuredetailRepository();

          var Data = (from emp in repo.Getemp()
                      join empdetail in repo.Getempdet() on emp.EmployeeId equals empdetail.EmployeeId
                      join pos in repo.Getpos() on emp.PositionId equals pos.Id
                      select new
            {
                emp.EmployeeId,
                emp.EmployeeName,
                empdetail.DateofPromotion,
                empdetail.IsSalaryset,
                pos.Position,
                pos.BasicPay
            }).Where(a => a.IsSalaryset == false).ToList();

          return(Json(new { data = Data }, JsonRequestBehavior.AllowGet));
      }
Ejemplo n.º 26
0
        public ActionResult GetConfirmation(int?id)
        {
            IRepository obj = new ApplicantRepository();
            IStructuredetailRepository repo    = new StructuredetailRepository();
            IDepartmentRepository      deprepo = new DepartmentRepository();

            var Data = (from d in obj.GetAll()
                        join s in repo.GetVacancies() on d.VacancyId equals s.VacancyId
                        where d.ApplicationId == id
                        select new
            {
                d.ApplicantName,
                d.Gender,
                s.DepartmentId,
                s.PositionId,
                d.Dob,
                d.Phone,
                d.Email,
                d.Address,
                d.ApplicationId,
                d.JoiningDate,
                s.CityName,
                d.Salary
            }).Select(c => new CandidateEmployeeVM()
            {
                ApplicationId = (int)(c.ApplicationId),
                EmployeeName  = c.ApplicantName,
                Gender        = c.Gender,
                DepartmentId  = (int)(c.DepartmentId),
                PositionId    = (int)c.PositionId,
                DateofBirth   = (DateTime)c.Dob,
                Contact       = c.Phone,
                Email         = c.Email,
                Address       = c.Address,
                JoiningDate   = (Nullable <DateTime>)c.JoiningDate,
                CityName      = c.CityName,
                PosSalary     = c.Salary
            }).FirstOrDefault();

            return(PartialView("ConfirmEmployeePartial", Data));
        }
Ejemplo n.º 27
0
        public JsonResult JoindSalary(CandidateEmployeeVM model)
        {
            IRepository objrepo             = new ApplicantRepository();
            IStructuredetailRepository repo = new StructuredetailRepository();

            var checksalarylimit = repo.Getpos().Where(x => x.BasicPay > model.Salary).FirstOrDefault();

            if (checksalarylimit != null)
            {
                objrepo.UpdateEmp(model.ApplicationId, model.JoiningDate, model.Salary);
                objrepo.Save();

                TempData["SuccessMessage25"] = "Success";
                return(Json(new { success = true }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                TempData["ErrorMessage25"] = "Salary can not be less than " + model.PosSalary + " for Position " + model.Position + "";
                return(Json(new { success = false }, JsonRequestBehavior.AllowGet));
            }
        }
Ejemplo n.º 28
0
      public ActionResult GetEmployeeforpro(int?Id)
      {
          IStructuredetailRepository repo = new StructuredetailRepository();


          var data = (from emp in repo.Getemp()
                      join pos in repo.Getpos() on emp.PositionId equals pos.Id
                      select new
            {
                emp.EmployeeId,
                emp.EmployeeName,
                emp.PositionId,
                emp.CityName,
                emp.Contact,
                emp.Email,
                emp.DateofBirth,
                emp.Gender,
                pos.Position,
                pos.Experience,
                emp.DepartmentId,
                pos.JobLevel
            }).Where(x => x.EmployeeId == Id).Select(c => new PositionVM()
            {
                EmployeeName = c.EmployeeName,
                EmployeeId   = (int)c.EmployeeId,
                Gender       = c.Gender,
                Experience   = c.Experience,
                CityName     = c.CityName,
                Contact      = c.Contact,
                Email        = c.Email,
                DateofBirth  = (DateTime)c.DateofBirth,
                PositionId   = (int)c.PositionId,
                Position     = c.Position,
                JobLevel     = (int)c.JobLevel,
                DepartmentId = (int)c.DepartmentId
            }).FirstOrDefault();


          return(PartialView("EmployeePromotionPartial", data));
      }
Ejemplo n.º 29
0
      public ActionResult EmployeeSalaryUpdate(PositionVM model)
      {
          IStructuredetailRepository repo = new StructuredetailRepository();
          var SalaryCheck = repo.Getpos().Where(x => x.BasicPay > model.Employeesalary).FirstOrDefault();

          if (SalaryCheck == null)
          {
              repo.setProEmpsalary(model.EmployeeId, model.Employeesalary);
              repo.Save();
              bool result = false;
              result = SendEmail(model.Email, "Promotion Letter", " <p>" + model.Description + "</p>");


              TempData["SuccessMessage21"] = "Success";
              return(Json(new { result, success = true }, JsonRequestBehavior.AllowGet));
          }
          else
          {
              TempData["ErrorMessage21"] = "Salary can not be less than " + model.BasicPay + " for Employee of " + model.Position + " Position";
              return(Json(new { success = false }, JsonRequestBehavior.AllowGet));
          }
      }
Ejemplo n.º 30
0
        public ActionResult Assignroles(EmployeeUserVM user, FormCollection form)
        {
            IStructuredetailRepository objstructureRepository = new StructuredetailRepository();
            IUserRepository            objuserRepository      = new UserRepository();


            var usercheck = objuserRepository.GetAll().Where(a => a.UserId == user.UserId).FirstOrDefault();

            if (usercheck != null)
            {
                var chkadmin = form["getadmin"];
                var adminId  = Convert.ToInt32(chkadmin);

                objuserRepository.Update(user.RoleId, adminId, user.UserId);
                objuserRepository.Save();

                if (chkadmin == null)
                {
                    chkadmin = "0";
                }
                TempData["SuccessMessage1"] = "Role Assigned";

                var        rolelist = objstructureRepository.Getroles().ToList();
                SelectList list     = new SelectList(rolelist, "Id", "RoleName");
                ViewBag.getrolelist = list;
            }
            else
            {
                var        rolelist = objstructureRepository.Getroles().ToList();
                SelectList list     = new SelectList(rolelist, "Id", "RoleName");
                ViewBag.getrolelist = list;

                TempData["ErrorMessage1"] = "Select from User List";
            }


            return(View());
        }