Ejemplo n.º 1
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.º 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 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.º 4
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.º 5
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));
      }