Beispiel #1
0
        public ActionResult Badhuwa(int empCode)
        {
            if (!ViewBag.AllowView)
            {
                ViewBag.Error = "You are not Authorize to use this Page";
                return(PartialView("_partialviewNotFound"));
            }
            EmployeeDetailsViewModel    partialData = _employeeService.GetEmployeeDetails(empCode);
            EmployeeJobHistoryViewModel res         = new EmployeeJobHistoryViewModel();

            res.Designation = partialData.Designation;
            res.JobType     = partialData.JobType;
            res.Department  = partialData.Department;
            res.OfficeName  = partialData.OfficeName;
            res.OfficeId    = partialData.OfficeId;
            res.Rank        = partialData.Rank;
            res.Name        = partialData.Name;
            res.Section     = partialData.Section;
            res.Level       = partialData.Level;
            ListOfDatas(empCode);

            List <SelectListItem> SubGroupList = new List <SelectListItem>();

            foreach (var row in _serviceEventSubGroupService.GetSubGroupById(7))
            {
                SubGroupList.Add(new SelectListItem
                {
                    Text  = row.ServiceEventSubGroupName,
                    Value = row.ServiceEventSubGroupId.ToString()
                });
            }
            ViewBag.SubGroupList = SubGroupList;
            return(View("../Employee/Badhuwa/Index", res));
        }
Beispiel #2
0
        public ActionResult EmployeeNiyukti(int id, EmployeeJobHistoryViewModel data)
        {
            data.DecisionDate            = !string.IsNullOrEmpty(data.DecisionDateNP) ? Convert.ToDateTime(NepEngDate.NepToEng(data.DecisionDateNP)) : data.DecisionDate;
            data.LetterIssueDate         = !string.IsNullOrEmpty(data.LetterIssueDateNP) ? Convert.ToDateTime(NepEngDate.NepToEng(data.LetterIssueDateNP)) : data.LetterIssueDate;
            data.EffectiveDate           = !string.IsNullOrEmpty(data.EffectiveDateNP) ? Convert.ToDateTime(NepEngDate.NepToEng(data.EffectiveDateNP)) : data.EffectiveDate;
            data.ServiceCountingFromDate = !string.IsNullOrEmpty(data.ServiceCountingFromDateNP) ? Convert.ToDateTime(NepEngDate.NepToEng(data.ServiceCountingFromDateNP)) : data.ServiceCountingFromDate;
            data.OfficeJoinDate          = !string.IsNullOrEmpty(data.OfficeJoinDateNP) ? Convert.ToDateTime(NepEngDate.NepToEng(data.OfficeJoinDateNP)) : data.OfficeJoinDate;
            data.SadarDate = !string.IsNullOrEmpty(data.SadarDateNP) ? Convert.ToDateTime(NepEngDate.NepToEng(data.SadarDateNP)) : data.SadarDate;

            if (!ViewBag.AllowView)
            {
                ViewBag.Error = "You are not Authorize to use this Page";
                return(PartialView("_partialviewNotFound"));
            }
            ListOfDatas(id);
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View("../JobHistory/History/Niyukti", data));
                }
                EmployeeJobHistoryDTO dataToInsert = new EmployeeJobHistoryDTO();
                dataToInsert.EmpCode                  = id;
                dataToInsert.Instruction              = data.Instruction;
                dataToInsert.JobTypeId                = data.JobTypeId;
                dataToInsert.LetterRefNo              = data.LetterChalaniNumber;
                dataToInsert.LetterIssueDate          = data.LetterIssueDate;
                dataToInsert.LevelId                  = data.LevelId;
                dataToInsert.OfficeId                 = data.OfficeId;
                dataToInsert.OfficeJoinDate           = data.OfficeJoinDate;
                dataToInsert.RankId                   = data.RankId;
                dataToInsert.RemoteId                 = data.RemoteId;
                dataToInsert.SadarDate                = data.SadarDate;
                dataToInsert.SadarGarneEmployeeCode   = data.SadarGarneEmployeeCode;
                dataToInsert.SectionId                = data.SectionId;
                dataToInsert.ServiceHolidingDate      = data.ServiceCountingFromDate;
                dataToInsert.ServiceEvent             = data.ServiceEvent;
                dataToInsert.Instruction              = data.Instruction;
                dataToInsert.ServiceEventGroupId      = 1;
                dataToInsert.ServiceEventSubGroupId   = data.ServiceEventSubGroupId;
                dataToInsert.ShiftId                  = data.ShiftId;
                dataToInsert.DeptId                   = data.DeptId;
                dataToInsert.DesgId                   = data.DesgId;
                dataToInsert.DesgKayamMukayamMuKaRaRa = data.DesgKayamMukayamMuKaRaRa;
                dataToInsert.EffectiveDate            = data.EffectiveDate;
                dataToInsert.EffectiveTillDate        = data.EffectiveTillDate;
                dataToInsert.BusinessGroupId          = data.BusinessGroupId;
                dataToInsert.DecisionDate             = data.DecisionDate;
                int res = _jobHistoryService.InsertJobHistoryForNiyukti(dataToInsert);
                return(Redirect("/Admin/UserDetail/" + id));
            }
            catch (Exception ex)
            {
                ViewBag.Error = ex.Message;
                return(View("../Employee/Transfer/Index", data));
            }
        }
Beispiel #3
0
        public ActionResult EmployeeNiyukti(int id = 0)
        {
            if (!ViewBag.AllowView)
            {
                ViewBag.Error = "You are not Authorize to use this Page";
                return(PartialView("_partialviewNotFound"));
            }
            EmployeeDetailsViewModel    partialData = _employeeService.GetEmployeeDetails(id);
            EmployeeJobHistoryViewModel res         = new EmployeeJobHistoryViewModel();

            res.Designation = partialData.Designation;
            res.JobType     = partialData.JobType;
            res.Department  = partialData.Department;
            res.OfficeName  = partialData.OfficeName;
            res.Rank        = partialData.Rank;
            res.Name        = partialData.Name;
            res.Section     = partialData.Section;
            res.Level       = partialData.Level;
            ListOfDatas(id);


            var empDefault = _employeeService.EmployeesIds(id);

            res.OfficeId        = empDefault.EmpOfficeId;
            res.DeptId          = empDefault.EmpDeptId;
            res.DesgId          = empDefault.EmpDesgId;
            res.SectionId       = empDefault.EmpSectionId;
            res.RankId          = empDefault.EmpRankId;
            res.LevelId         = empDefault.EmpLevelId;
            res.BusinessGroupId = empDefault.EmpBgId;
            res.ShiftId         = empDefault.EmpShiftId;
            res.JobTypeId       = empDefault.EmpJobTypeId;


            return(View("../JobHistory/History/Niyukti", res));
        }
Beispiel #4
0
        public ActionResult EmployeeTransfer(int empCode)
        {
            if (!ViewBag.AllowView)
            {
                ViewBag.Error = "You are not Authorize to use this Page";
                return(PartialView("_partialviewNotFound"));
            }
            EmployeeDetailsViewModel    partialData = _employeeService.GetEmployeeDetails(empCode);
            EmployeeJobHistoryViewModel res         = new EmployeeJobHistoryViewModel();

            res.Designation    = partialData.Designation;
            res.JobType        = partialData.JobType;
            res.Department     = partialData.Department;
            res.OfficeName     = partialData.OfficeName;
            res.Rank           = partialData.Rank;
            res.Name           = partialData.Name;
            res.Section        = partialData.Section;
            res.Level          = partialData.Level;
            res.OfficeJoinDate = Convert.ToDateTime(partialData.JoinDate);
            ListOfDatas(empCode);

            var empDefault = _employeeService.EmployeesIds(empCode);

            res.OfficeId        = empDefault.EmpOfficeId;
            res.DeptId          = empDefault.EmpDeptId;
            res.DesgId          = empDefault.EmpDesgId;
            res.SectionId       = empDefault.EmpSectionId;
            res.RankId          = empDefault.EmpRankId;
            res.LevelId         = empDefault.EmpLevelId;
            res.BusinessGroupId = empDefault.EmpBgId;
            res.ShiftId         = empDefault.EmpShiftId;
            res.JobTypeId       = empDefault.EmpJobTypeId;


            return(View("../Employee/Transfer/Index", res));
        }
Beispiel #5
0
        public ActionResult Abakash(int empCode, EmployeeJobHistoryViewModel data)
        {
            data.DecisionDate            = !string.IsNullOrEmpty(data.DecisionDateNP) ? Convert.ToDateTime(NepEngDate.NepToEng(data.DecisionDateNP)) : data.DecisionDate;
            data.LetterIssueDate         = !string.IsNullOrEmpty(data.LetterIssueDateNP) ? Convert.ToDateTime(NepEngDate.NepToEng(data.LetterIssueDateNP)) : data.LetterIssueDate;
            data.EffectiveDate           = !string.IsNullOrEmpty(data.EffectiveDateNP) ? Convert.ToDateTime(NepEngDate.NepToEng(data.EffectiveDateNP)) : data.EffectiveDate;
            data.ServiceCountingFromDate = !string.IsNullOrEmpty(data.ServiceCountingFromDateNP) ? Convert.ToDateTime(NepEngDate.NepToEng(data.ServiceCountingFromDateNP)) : data.ServiceCountingFromDate;
            data.OfficeJoinDate          = !string.IsNullOrEmpty(data.OfficeJoinDateNP) ? Convert.ToDateTime(NepEngDate.NepToEng(data.OfficeJoinDateNP)) : data.OfficeJoinDate;
            data.EffectiveTillDate       = !string.IsNullOrEmpty(data.EffectiveTillDateNP) ? Convert.ToDateTime(NepEngDate.NepToEng(data.EffectiveTillDateNP)) : data.EffectiveTillDate;
            data.SadarDate = !string.IsNullOrEmpty(data.SadarDateNP) ? Convert.ToDateTime(NepEngDate.NepToEng(data.SadarDateNP)) : data.SadarDate;

            if (!ViewBag.AllowView)
            {
                ViewBag.Error = "You are not Authorize to use this Page";
                return(PartialView("_partialviewNotFound"));
            }

            ListOfDatas(empCode);
            List <SelectListItem> SubGroupList = new List <SelectListItem>();

            foreach (var row in _serviceEventSubGroupService.GetSubGroupById(6))
            {
                SubGroupList.Add(new SelectListItem
                {
                    Text  = row.ServiceEventSubGroupName,
                    Value = row.ServiceEventSubGroupId.ToString()
                });
            }
            ViewBag.SubGroupList = SubGroupList;
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View("../Employee/Abakas/Index", data));
                }
                EmployeeJobHistoryDTO dataToInsert = new EmployeeJobHistoryDTO();
                dataToInsert.EmpCode                  = data.EmpCode;
                dataToInsert.Instruction              = data.Instruction;
                dataToInsert.JobTypeId                = data.JobTypeId;
                dataToInsert.LetterRefNo              = data.LetterChalaniNumber;
                dataToInsert.LetterIssueDate          = data.LetterIssueDate;
                dataToInsert.LevelId                  = data.LevelId;
                dataToInsert.OfficeId                 = data.OfficeId;
                dataToInsert.OfficeJoinDate           = data.OfficeJoinDate;
                dataToInsert.RankId                   = data.RankId;
                dataToInsert.RemoteCode               = data.RemoteCode;
                dataToInsert.SadarDate                = data.SadarDate;
                dataToInsert.SadarGarneEmployeeCode   = data.SadarGarneEmployeeCode;
                dataToInsert.SectionId                = data.SectionId;
                dataToInsert.ServiceHolidingDate      = data.ServiceCountingFromDate;
                dataToInsert.ServiceEvent             = data.ServiceEvent;
                dataToInsert.ServiceEventGroupId      = 6;
                dataToInsert.ShiftId                  = data.ShiftId;
                dataToInsert.DeptId                   = data.DeptId;
                dataToInsert.DesgId                   = data.DesgId;
                dataToInsert.DesgKayamMukayamMuKaRaRa = data.DesgKayamMukayamMuKaRaRa;
                dataToInsert.EffectiveDate            = data.EffectiveDate;
                dataToInsert.EffectiveTillDate        = data.EffectiveTillDate;
                dataToInsert.BusinessGroupId          = data.BusinessGroupId;
                dataToInsert.DecisionDate             = data.DecisionDate;
                dataToInsert.ServiceEventSubGroupId   = data.ServiceEventSubGroupId;
                int res = _jobHistoryService.InsertJobHistoryForAbakash(dataToInsert);
                //EmployeeJobHistoryDTO value = _jobHistoryService.GetJobHistoryById(res);  Need to find solution for this
                return(Redirect("/History/" + data.EmpCode));
            }
            catch (Exception ex)
            {
                ViewBag.Error = ex.Message;
                return(View("../Employee/Abakas/Index", data));
            }
        }