示例#1
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));
        }
      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));
      }
      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));
      }
      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));
      }
示例#5
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));
        }
示例#6
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());
        }
      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));
      }
        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));
        }
示例#9
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));
        }
示例#10
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));
        }
示例#11
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));
        }
      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));
      }
示例#13
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));
            }
        }
      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));
      }
      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));
          }
      }
示例#16
0
        public ActionResult RequestTransfer(RequestVM model)
        {
            IStructuredetailRepository obj = new StructuredetailRepository();
            var poslist    = obj.Getpos().ToList();
            var city       = Session["CityName"].ToString();
            var empid      = Session["EmployeeId"].ToString();
            var role       = Session["RoleName"].ToString();
            var checkempid = obj.GetReq().Where(x => x.EmployeeId == Convert.ToInt32(empid)).FirstOrDefault();

            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 cityname1 = new SelectList(new[]
                {
                    new { ID = "1", Name = "Karachi" },
                    new { ID = "2", Name = "Islamabad" }
                },
                                               "Name", "Name", "1"
                                               );

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


            if (role != "DGM")
            {
                var add = obj.Addreqt(Convert.ToInt32(empid), model.positionid, model.CitytoTransfer, model.ReasonofRequest);
                obj.AddReq(add);
                obj.Save();
                TempData["SuccessMessage101"] = "Successfully Submitted";
            }
            else
            {
                var add = obj.Addreqtfordgm(Convert.ToInt32(empid), model.positionid, model.CitytoTransfer, model.ReasonofRequest);
                obj.AddReq(add);
                obj.Save();
                TempData["SuccessMessage101"] = "Successfully Submitted";
            }

            return(View());
        }