Ejemplo n.º 1
0
        public ActionResult Index(DailyAttendanceFilterViewModel att)
        {
            ViewBag.ddlDesignationList   = _designationServices.GetDesignationList().ToList();
            ViewBag.ddlBusinessGroupList = _groupServices.GetGroupList().ToList();
            ViewBag.ddlDepartmentList    = _departmentServices.GetDepartmentlist().ToList();
            ViewBag.ddlOfficeTypeList    = _officeServices.GetOfficeData().ToList();

            try
            {
                //convert nepalidate to eng


                string englishDate = NepEngDate.NepToEng(att.startdateNP.ToString());
                ViewBag.nepaliDate = att.startdateNP;

                att.startdate      = Convert.ToDateTime(englishDate);
                ViewBag.date       = att.startdate;
                ViewBag.edate      = att.Enddate;
                ViewBag.attempcode = att.EmpCode;
                ViewBag.Desgid     = att.DsgId;
                ViewBag.deprtId    = att.dprtid;
                ViewBag.officeid   = att.officeid;
                ViewBag.emptype    = att.emptypeid;


                ViewBag.attendancelist = _attendanceDailyServices.GetAttendanceDaily(att.officeid, att.DsgId, att.emptypeid, att.dprtid, att.EmpCode, att.startdate).ToList();
                return(View());
            }
            catch (Exception Ex)
            {
                ViewBag.Error = Ex.Message;
                return(View());
            }
        }
Ejemplo n.º 2
0
        public ActionResult Index(DailyAttendanceFilterViewModel att)
        {
            att.searchdate = Convert.ToDateTime(NepEngDate.NepToEng(att.searchdateNP));

            try
            {
                ViewBag.date               = att.searchdateNP;
                ViewBag.empdoce            = att.EmpCode;
                ViewBag.Desgid             = att.DsgId;
                ViewBag.officeid           = att.officeid;
                ViewBag.ddlDesignationList = _designationServices.GetDesignationList();
                int empcode = Convert.ToInt32(Session["EmpCode"]);
                //IEnumerable<OfficeDTOs> officelist = _officeServices.GetClildOfficeListByEmpCode(empcode);

                int AdminEmpCode = ViewBag.EmpCode;

                ViewBag.ddlOfficeTypeList = _officeServices.GetClildOfficeListByEmpCode(empcode);
                IEnumerable <DailyAttendanceFilterViewModel> list = _attendanceDailyServices.GetAttendanceDailyStatus(AdminEmpCode, att.searchdate, att.EmpCode, att.DsgId, att.officeid);
                return(View(list));
            }
            catch (Exception Ex)
            {
                ViewBag.Error = Ex.Message;
                return(View());
            }
        }
Ejemplo n.º 3
0
        public ActionResult Update(int id, PayrollInsurancePremiumDTO Record)
        {
            int EmpCode = Convert.ToInt32(Session["Empcode"]);

            Record.IsuranceClaimId            = id;
            Record.StartDate                  = Convert.ToDateTime(NepEngDate.NepToEng(Record.StartDateNP));
            Record.EndDate                    = Convert.ToDateTime(NepEngDate.NepToEng(Record.EndDateNP));
            Record.InsuranceCompanySelectlist = _PayrollInsurancePremiumService.GetInsuranceCompanySelectList();
            Record.AmountTypeSelectList       = StaticSelectList.AmountTypeSelectList();
            ViewBag.ddlEmployeeList           = _dynamicSelectList.GetEmployeeByEmpCode(EmpCode).ToList();
            ViewBag.EmpCode                   = Record.EmpCode;
            try
            {
                if (ModelState.IsValid)
                {
                    _PayrollInsurancePremiumService.UpdatePayrollInsurancePremium(Record);
                    Session["Success"] = "Successfully Updated Insurance Information";
                    return(RedirectToAction("Index", "PayrollInsurancePremium", new { id = Record.EmpCode }));
                }
                else
                {
                    ViewBag.Error = "Form Error";
                }
            }
            catch (Exception Exception)
            {
                ViewBag.Error = Exception.Message;
            }
            return(View("../PayrollInsurancePremium/Update", Record));
        }
 public ActionResult Index(DailyAttendanceFilterViewModel atd, int id)
 {
     atd.startdate = Convert.ToDateTime(NepEngDate.NepToEng(atd.startdateNP));
     atd.Enddate   = Convert.ToDateTime(NepEngDate.NepToEng(atd.EnddateNP));
     ViewBag.sdate = atd.startdateNP;
     ViewBag.edate = atd.EnddateNP;
     try
     {
         IEnumerable <DailyAttendanceFilterViewModel> item = _attendanceDailyServices.GetAttendanceByRangeAndID(id, atd.startdate, atd.Enddate);
         var list = _employeeServices.GetEmployeeDetails(id);
         ViewBag.Department   = list.Department;
         ViewBag.Name         = list.Name;
         ViewBag.office       = list.OfficeName;
         ViewBag.Desg         = list.Designation;
         ViewBag.EmployeeType = list.Group;
         ViewBag.Shift        = list.Shift;
         ViewBag.level        = list.Level;
         ViewBag.image        = list.PhotoName;
         ViewBag.Empcode      = list.Code;
         ViewBag.SideBar      = _moduleService.AdminEmployeeDetailsMenu(ViewBag.Empcode);
         return(View("../Employee/AttendanceDetails/Index", item));
     }
     catch (Exception Ex)
     {
         ViewBag.Error = "No Data found or No employee found with this employeeCode";
         return(View("../Employee/AttendanceDetails/Index"));
     }
 }
Ejemplo n.º 5
0
        public ActionResult Details(int id)
        {
            EmployeeJobHistoryDTO    Record      = _jobHistoryService.GetJobHistoryById(id);
            EmployeeDetailsViewModel partialData = _employeeService.GetEmployeeDetails(Record.EmpCode);
            EmployeeKaazViwModel     res         = new EmployeeKaazViwModel();

            res.LetterIssueDateNP = (NepEngDate.EngToNep(Convert.ToDateTime(Record.LetterIssueDate)));
            res.KajStartDateNP    = (NepEngDate.EngToNep(Convert.ToDateTime(Record.KajStartDate)));
            res.KajEndDateNP      = (NepEngDate.EngToNep(Convert.ToDateTime(Record.KajEndDate)));
            res.Id = Record.HistoryId;
            res.LetterIssueDate        = Record.LetterIssueDate;
            res.LetterRefNo            = Record.LetterRefNo;
            res.LetterChalaniNumber    = Record.ChalaniNumber;
            res.KajStartDate           = Record.KajStartDate;
            res.KajEndDate             = Record.KajEndDate;
            res.SadarGarneEmployeeCode = Record.SadarGarneEmployeeCode;
            res.KaajType    = Record.KaajType;
            res.Instruction = Record.Instruction;
            res.Remarks     = Record.Remarks;
            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.Name        = partialData.Name;
            res.EmpCode     = Record.EmpCode;
            ListOfDatas(Record.EmpCode);
            return(View("../Employee/Kajmakhataune/Details", res));
        }
Ejemplo n.º 6
0
        public ActionResult Create(PayrollInsurancePremiumDTO data)
        {
            data.StartDate = Convert.ToDateTime(NepEngDate.NepToEng(data.StartDateNP));
            data.EndDate   = Convert.ToDateTime(NepEngDate.NepToEng(data.EndDateNP));
            int EmpCode = Convert.ToInt32(Session["Empcode"]);

            data.InsuranceCompanySelectlist = _PayrollInsurancePremiumService.GetInsuranceCompanySelectList();
            data.AmountTypeSelectList       = StaticSelectList.AmountTypeSelectList();
            ViewBag.ddlEmployeeList         = _dynamicSelectList.GetEmployeeByEmpCode(EmpCode).ToList();

            ModelState.Clear();
            try
            {
                if (ModelState.IsValid)
                {
                    _PayrollInsurancePremiumService.InsertPayrollInsurancePremium(data);
                    Session["Success"] = "Successfully Added Employee Insurance Information";
                    return(RedirectToAction("Index/"));
                }
                else
                {
                    ViewBag.Error = "Form Error";
                }
            }
            catch (Exception Exception)
            {
                ViewBag.Error = Exception.Message;
            }
            return(View("../PayrollInsurancePremium/Create", data));
        }
Ejemplo n.º 7
0
        public ActionResult Details(int id)
        {
            PayrollInsurancePremiumDTO Record = new PayrollInsurancePremiumDTO();

            Record             = _PayrollInsurancePremiumService.GetOnePayrollInsurancePremium(id);
            ViewBag.EmpCode    = Record.EmpCode;
            Record.StartDateNP = NepEngDate.EngToNep(Convert.ToDateTime(Record.StartDate)).ToString().Replace('/', '-');
            Record.EndDateNP   = NepEngDate.EngToNep(Convert.ToDateTime(Record.EndDate)).ToString().Replace('/', '-');
            if (Record.AmountType == "A")
            {
                Record.AmountType = "Annual";
            }
            else if (Record.AmountType == "H")
            {
                Record.AmountType = "Half Yearly";
            }
            else if (Record.AmountType == "Q")
            {
                Record.AmountType = "Quarterly";
            }
            else if (Record.AmountType == "M")
            {
                Record.AmountType = "Monthly";
            }
            return(View("../PayrollInsurancePremium/Details", Record));
        }
        public ActionResult Index(UpdateAttendanceSearchModel adt, int id)
        {
            adt.SearchStartdate = NepEngDate.NepToEng(adt.SearchStartdateNP);
            adt.SeacrchEnddate  = NepEngDate.NepToEng(adt.SeacrchEnddateNP);
            ViewBag.sdate       = adt.SearchStartdateNP;
            ViewBag.edate       = adt.SeacrchEnddateNP;

            try
            {
                var list = _employeeServices.GetEmployeeDetails(id);
                ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(id);
                UpdateAttendanceSearchModel uds = new UpdateAttendanceSearchModel();
                DateTime sadte, enddate;
                sadte               = Convert.ToDateTime(adt.SearchStartdate);
                enddate             = Convert.ToDateTime(adt.SeacrchEnddate);
                uds.AttendanceList  = _attendanceDailyServices.GetAttendanceByRangeAndID(id, sadte, enddate);
                uds.Name            = list.Name;
                uds.Empcode         = list.Code;
                uds.Branch          = list.OfficeName;
                uds.Department      = list.Department;
                uds.Designation     = list.Designation;
                uds.Shift           = list.Shift;
                uds.Group           = list.Group;
                uds.Level           = list.Level;
                uds.SearchStartdate = adt.SearchStartdate;
                uds.SeacrchEnddate  = adt.SeacrchEnddate;
                return(View(uds));
            }
            catch (Exception Ex)
            {
                return(View(Ex.Message));
            }
        }
Ejemplo n.º 9
0
        public ActionResult Add(PayrollLeaveDeductionDTO Record)
        {
            Record.EmployeeCodeSelectlist = _LeaveEarnedService.GetBrancheEmployeeSelectList(Convert.ToInt32(ViewBag.Empcode));
            Record.YearSelectList         = _SpecialleavetypeService.GetYearSelectList();
            Record.LeaveTypeSelectList    = _payrollLeaveDeductionService.GetPayrollLeaveDeductionLeaveTypeSelectList();
            Record.LeaveDate = Convert.ToDateTime(NepEngDate.NepToEng(Record.LeaveDateNepali));
            try
            {
                if (ModelState.IsValid)
                {
                    _payrollLeaveDeductionService.AddPayrollLeaveDeduction(Record);

                    Session["Success"] = "Successfully Added Payroll Leave Deduction";
                    return(RedirectToAction("Index", "PayrollLeaveDeduction"));
                }
                else
                {
                    ViewBag.Error = "Form Error";
                }
            }
            catch (Exception Exception)
            {
                ViewBag.Error = Exception.Message;
            }
            return(View("../Leave/PayrollLeaveDeduction/Add", Record));
        }
Ejemplo n.º 10
0
        public ActionResult ApproverList(AttendanceRequestsListViewModel att)
        {
            try
            {
                att.startdate = Convert.ToDateTime(NepEngDate.NepToEng(att.startdateNP));
                att.enddate   = Convert.ToDateTime(NepEngDate.NepToEng(att.enddateNP));

                int id   = ViewBag.Empcode;
                int role = ViewBag.EmpRoleId;
                ViewBag.emplist       = _employeeServices.GetEmployeeList(id);
                ViewBag.OfficeList    = _officeServices.GetOfficeListByEmpRole(role);
                ViewBag.startdate     = att.startdateNP;
                ViewBag.officeid      = att.OfficeId;
                ViewBag.code          = att.EmpCodes;
                ViewBag.enddate       = att.enddateNP;
                ViewBag.approvestatus = att.ApproverStatus;
                ViewBag.Id            = id;
                IEnumerable <AttendanceRequestsListViewModel> lst = _attendanceDailyServices.GetrequestAttendanceListByParms(att.OfficeId, att.EmpCodes, att.startdate, att.enddate, null, id, 2, att.ApproverStatus).ToList();
                return(View(lst));
            }
            catch (Exception Ex)
            {
                ViewBag.Error = Ex.Message;
                return(View());
            }
        }
Ejemplo n.º 11
0
        public ActionResult Add(EmployeeFamilyDTO Record)
        {
            Record.FDob = !string.IsNullOrEmpty(Record.FDobNP) ? Convert.ToDateTime(NepEngDate.NepToEng(Record.FDobNP)) : Record.FDob;

            int curentemp = Convert.ToInt32(Session["Empcode"]);

            Record.EmpCode = Record.EmpId;
            Record.EmployeeCodeSelectlist = _LeaveEarnedService.GetBrancheEmployeeSelectList(curentemp);
            try
            {
                if (ModelState.IsValid)
                {
                    _EmployeeFamilyService.AddEmplyeeFamily(Record);
                    Session["Success"] = "Successfully Added Employee Family";
                    return(RedirectToAction("Index", "Family", new { id = Record.EmpId }));
                }
                else
                {
                    ViewBag.Error = "Form Error";
                }
            }
            catch (Exception Exception)
            {
                ViewBag.Error = Exception.Message;
            }
            return(View("../Employee/Family/Add", Record));
        }
Ejemplo n.º 12
0
        public ActionResult Update(LeaveEarnedDTO Record)
        {
            int curentemp = Convert.ToInt32(Session["Empcode"]);

            Record.WorkedStartDate     = Convert.ToDateTime(NepEngDate.NepToEng(Record.WorkedStartDateNP));
            Record.WorkedEndDate       = Convert.ToDateTime(NepEngDate.NepToEng(Record.WorkedEndDateNP));
            Record.YearSelectList      = _SpecialleavetypeService.GetYearSelectList();
            Record.LeaveTypeSelectList = _LeaveEarnedService.GetEarnedLeaveTypeList();
            int roleid = Convert.ToInt32(Session["RoleId"]);

            Record.ApproveEmployeeCodeSelectlist = _DynamicSelectList.GetLeaveApproverSelectList(Record.EmpCode, "Earning");
            Record.EmpId = Record.EmpCode;
            Record.GetRecommederSelectList = _DynamicSelectList.GetLeaveRecommenderSelectList(Record.EmpCode, "Earning");

            try
            {
                if (ModelState.IsValid)
                {
                    _LeaveEarnedService.UpdateLeaveEarned(Record);

                    Session["Success"] = "Successfully Updated Leave Earn";
                    return(RedirectToAction("Index", "LeaveEarned"));
                }
                else
                {
                    ViewBag.Error = "Form Error";
                }
            }
            catch (Exception Exception)
            {
                ViewBag.Error = Exception.Message;
            }

            return(View("../Leave/LeaveEarned/Update", Record));
        }
        public ActionResult Add(LeaveApplicationDTO Record)
        {
            // int curentemp = Convert.ToInt32(Session["Empcode"]);
            //int roleid = Convert.ToInt32(Session["RoleId"]);
            int empCode = Convert.ToInt32(Session["EmpCode"]);

            Record.LeaveStartDate         = Convert.ToDateTime(NepEngDate.NepToEng(Record.LeaveStartDateNP));
            Record.LeaveEndDate           = Convert.ToDateTime(NepEngDate.NepToEng(Record.LeaveEndDateNP));
            Record.RecommededEmpCode      = Record.RecommededEmpCode;
            Record.EmployeeCodeSelectlist = _LeaveEarnedService.GetBrancheEmployeeSelectList(empCode);
            Record.YearSelectList         = _SpecialleavetypeService.GetYearSelectList();
            Record.LeaveTypeSelectList    = _SpecialleavetypeService.GetSpecialLeaveTypeSelectList();

            if (Record.LeaveEmpCode == 0 || Record.RecommededEmpCode == 0 || Record.LeaveApproverEmpCode == 0)
            {
                ViewBag.Error = "* Fields are required";
                return(View("../Leave/LeaveTypeSpecial/Add", Record));
            }
            try
            {
                if (ModelState.IsValid)
                {
                    _SpecialleavetypeService.AddSpecialLeaveType(Record);
                    Session["Success"] = "Successfully Added Special Leave ";
                    return(RedirectToAction("Index", "LeaveTypeSpecial"));
                }
            }
            catch (Exception Exception)
            {
                ViewBag.Error    = Exception.Message;
                Session["Error"] = ViewBag.Error = Exception.Message;
                return(View("../Leave/LeaveTypeSpecial/Add"));
            }
            return(View("../Leave/LeaveTypeSpecial/Add"));
        }
Ejemplo n.º 14
0
        public ActionResult EditFamily(int id)
        {
            EmployeeFamilyViewModel res = new EmployeeFamilyViewModel();

            res        = _empFamilyService.GetEmpFamilyByID(id);
            res.FDobNP = NepEngDate.EngToNep(Convert.ToDateTime(res.FDob));
            return(View(res));
        }
Ejemplo n.º 15
0
        public ActionResult EditEducation(EmpEducationDTO data)
        {
            data.PassedDate = Convert.ToDateTime(NepEngDate.NepToEng(data.PassedDateNP));

            data.EmpCode         = Convert.ToInt32(Session["EmpCode"]);
            data.EducationStatus = 0;
            EmpEducationDTO       jtd            = new EmpEducationDTO();
            List <SelectListItem> educationLevel = new List <SelectListItem>();

            foreach (var row in _educationLevel.GetEducationLevel())
            {
                educationLevel.Add(new SelectListItem
                {
                    Text  = row.LevelName,
                    Value = row.LevelId.ToString()
                });
            }
            IEnumerable <SelectListItem> CountryList = _countryService.GetCountryList();

            ViewBag.Countries      = CountryList;
            ViewBag.EducationLevel = educationLevel;
            //if (!ModelState.IsValid)
            //{
            //    return View(jtd);
            //}
            if (data.EducationStatus == 0)
            {
                if (data.File != null)
                {
                    string extension = Path.GetExtension(data.File.FileName).ToLower();
                    if (extension == ".jpeg" || extension == ".jpg" || extension == ".png")
                    {
                        data.ScanDocument = (data.EduId + data.File.FileName).ToLower();
                        //housePermitModel = _housePermitService.insertHousePermits(housePermit);
                        if (data != null)
                        {
                            string path = Server.MapPath("~\\img\\");
                            data.File.SaveAs(path + data.ScanDocument);
                        }
                    }
                    else
                    {
                        ModelState.AddModelError("InvalidImage", "The file you are trying to upload is not image.");
                        return(View());
                    }
                }
                int res = _empEducationService.UpdateEducation(data);
                ViewBag.Success = "Education of " + data.EmpCode + " has been updated";
                ModelState.Clear();
                return(View(jtd));
            }
            else
            {
                ViewBag.Success = "Education already approved ";
                return(View(jtd));
            }
        }
Ejemplo n.º 16
0
        public ActionResult Update(int id)
        {
            //ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(id);
            EmployeeFamilyDTO Record = new EmployeeFamilyDTO();

            Record        = _EmployeeFamilyService.GetOneEmployeeFamily(id);
            Record.FDobNP = !String.IsNullOrEmpty(Convert.ToString(Record.FDob)) ? NepEngDate.EngToNep(Convert.ToDateTime(Record.FDob)) : null;
            return(View("../Employee/Family/Update", Record));
        }
Ejemplo n.º 17
0
        public ActionResult Update(int id)
        {
            PayrollLeaveDeductionDTO Record = _payrollLeaveDeductionService.GetOnePayrollLeaveDeduction(id);

            Record.EmployeeCodeSelectlist = _LeaveEarnedService.GetBrancheEmployeeSelectList(Convert.ToInt32(ViewBag.Empcode));
            Record.YearSelectList         = _SpecialleavetypeService.GetYearSelectList();
            Record.LeaveDateNepali        = (NepEngDate.EngToNep(Record.LeaveDate));
            Record.LeaveTypeSelectList    = _payrollLeaveDeductionService.GetPayrollLeaveDeductionLeaveTypeSelectList();
            Record.EmpId = Record.EmpCode;
            return(View("../Leave/PayrollLeaveDeduction/Update", Record));
        }
Ejemplo n.º 18
0
        // GET: PayrollOvertimes/Edit/5
        public ActionResult Edit(int id)
        {
            int EmpCode            = Convert.ToInt32(Session["Empcode"]);
            PayrollOvertimeDTO res = new PayrollOvertimeDTO();

            res = _payrollOvertimeService.GetPayrollOvertimeById(id);
            res.OvertimeDateNP        = (NepEngDate.EngToNep(Convert.ToDateTime(res.OvertimeDate)));
            res.ApproveStatusDateNP   = (NepEngDate.EngToNep(Convert.ToDateTime(res.ApproveStatusDate)));
            res.OvertimeAppliedDateNP = (NepEngDate.EngToNep(Convert.ToDateTime(res.OvertimeAppliedDate)));
            res.ApproverList          = _dynamicSelectList.GetLeaveApproverSelectList(res.EmpCode, "Overtime");
            ViewBag.EmpCode           = res.EmpCode;
            ViewBag.ddlEmployeeList   = _dynamicSelectList.GetEmployeeByEmpCode(EmpCode).ToList();
            return(View(res));
        }
Ejemplo n.º 19
0
        public ActionResult Update(int id)
        {
            int EmpCode = Convert.ToInt32(Session["Empcode"]);
            PayrollInsurancePremiumDTO Record = new PayrollInsurancePremiumDTO();

            Record = _PayrollInsurancePremiumService.GetOnePayrollInsurancePremium(id);
            Record.InsuranceCompanySelectlist = _PayrollInsurancePremiumService.GetInsuranceCompanySelectList();
            Record.AmountTypeSelectList       = StaticSelectList.AmountTypeSelectList();
            ViewBag.ddlEmployeeList           = _dynamicSelectList.GetEmployeeByEmpCode(EmpCode).ToList();
            ViewBag.EmpCode    = Record.EmpCode;
            Record.StartDateNP = NepEngDate.EngToNep(Convert.ToDateTime(Record.StartDate)).ToString().Replace('/', '-');
            Record.EndDateNP   = NepEngDate.EngToNep(Convert.ToDateTime(Record.EndDate)).ToString().Replace('/', '-');
            return(View("../PayrollInsurancePremium/Update", Record));
        }
Ejemplo n.º 20
0
        public ActionResult IndividualAttendanceList(AttendanceRequestsListViewModel att)
        {
            att.startdate = Convert.ToDateTime(NepEngDate.NepToEng(att.startdateNP));
            att.enddate   = Convert.ToDateTime(NepEngDate.NepToEng(att.enddateNP));

            int id = ViewBag.Empcode;

            ViewBag.startdate       = att.startdateNP;
            ViewBag.enddate         = att.enddateNP;
            ViewBag.approvestatus   = att.ApproverStatus;
            ViewBag.recommendstatus = att.RecommendSatus;
            IEnumerable <AttendanceRequestsListViewModel> lst = _attendanceDailyServices.GetrequestAttendanceListByParms(att.OfficeId, id, att.startdate, att.enddate, null, null, att.RecommendSatus, att.ApproverStatus).ToList();

            return(View(lst));
        }
Ejemplo n.º 21
0
        public ActionResult Add(LeaveEarnedDTO Record)
        {
            Record.WorkedStartDate = Convert.ToDateTime(NepEngDate.NepToEng(Record.WorkedStartDateNP));
            Record.WorkedEndDate   = Convert.ToDateTime(NepEngDate.NepToEng(Record.WorkedEndDateNP));

            int curentemp = Convert.ToInt32(Session["Empcode"]);

            Record.YearSelectList      = _SpecialleavetypeService.GetYearSelectList();
            Record.LeaveTypeSelectList = _LeaveEarnedService.GetEarnedLeaveTypeList();
            int roleid = Convert.ToInt32(Session["RoleId"]);

            Record.EmployeeCodeSelectlist = _LeaveEarnedService.GetBrancheEmployeeSelectList(curentemp);
            Decimal totalDays = _LeaveEarnedService.YearlyEarnedLeave(Record.EmpCode, Record.LeaveYearId, Convert.ToInt32(Record.LeaveTypeId));

            int takingLeave = Convert.ToDateTime(Record.WorkedEndDate).Date.Subtract((Convert.ToDateTime(Record.WorkedStartDate)).Date).Duration().Days + 1;

            if (Record.WorkedEndDate.Date.CompareTo(Record.WorkedStartDate) < 0)
            {
                ViewBag.Error = "Work Start Date should be smaller than Work End Date";
            }
            else if ((takingLeave + totalDays) > 10)
            {
                ViewBag.Error = "One Employee can earn max 10 days in one year. This Employee has already earned " + totalDays + " Days.";
            }
            else
            {
                try
                {
                    if (ModelState.IsValid)
                    {
                        _LeaveEarnedService.AddLeaveEarned(Record);
                        Session["Success"] = "Successfully Added Leave Earn";
                        return(RedirectToAction("Index", "LeaveEarned"));
                    }
                    else
                    {
                        ViewBag.Error = "Form Error";
                    }
                }
                catch (Exception Exception)
                {
                    ViewBag.Error = Exception.Message;
                }
            }


            return(View("../Leave/LeaveEarned/Add", Record));
        }
Ejemplo n.º 22
0
        // GET: PayrollOvertimes
        public ActionResult Index()
        {
            List <PayrollOvertimeDTO> list = _payrollOvertimeService.GetAllPayrollOvertime();

            foreach (var item in list)
            {
                item.ApproverName         = _employeeService.GetEmployeeByID(Convert.ToInt32(item.ApprovedById)).Name;
                item.OvertimeDateNP       = (NepEngDate.EngToNep(Convert.ToDateTime(item.OvertimeDate)));
                item.ApproveStatusDateNP  = (NepEngDate.EngToNep(Convert.ToDateTime(item.ApproveStatusDate)));
                ViewBag.Overtimedate      = Convert.ToDateTime(item.ApproveStatusDate).ToString("yyyy-MMM-dd");
                ViewBag.ApproveStatusDate = Convert.ToDateTime(item.ApproveStatusDate).ToString("yyyy-MMM-dd");
            }


            return(View(list));
        }
Ejemplo n.º 23
0
        public ActionResult EditFamily(EmployeeFamilyViewModel data)
        {
            data.FDob    = Convert.ToDateTime(NepEngDate.NepToEng(data.FDobNP));
            data.EmpCode = Convert.ToInt32(Session["EmpCode"]);
            EmployeeFamilyViewModel jtd = new EmployeeFamilyViewModel();
            //if (!ModelState.IsValid)
            //{
            //    return View(jtd);
            //}

            int res = _empFamilyService.UpdateEmpFamily(data);

            ViewBag.Success = "Education of " + data.EmpCode + " has been updated";
            ModelState.Clear();
            return(View(jtd));
        }
Ejemplo n.º 24
0
        public ActionResult Create(LeaveApplicationDTOs Record, int levid)
        {
            string recommendType = "General";
            int    empcode       = Convert.ToInt32(Session["EmpCode"]);

            Record.ApproverList    = _DynamicSelectList.GetLeaveApproverSelectList(empcode, recommendType).ToList();
            Record.RecommenderList = _DynamicSelectList.GetLeaveRecommenderSelectList(empcode, recommendType).ToList();
            try
            {
                Record.LeaveStartDate = Convert.ToDateTime(NepEngDate.NepToEng(Record.LeaveStartDateNP));
                Record.LeaveEndDate   = Convert.ToDateTime(NepEngDate.NepToEng(Record.LeaveEndDateNP));

                if (Record.IsHalfDay)
                {
                    Record.LeaveEndDate = Record.LeaveStartDate;
                }

                if (ModelState.IsValid)
                {
                    Record = _ValidateLeave.ValidateLeave(Record);

                    if (Record.ErrorList != null && Record.ErrorList.Count > 0)
                    {
                        return(View(Record));
                    }
                    else
                    {
                        _LeaveAddAdmin.LeaveApplicationCreate(Record);
                        Session["success"] = "Leave Created Sucessfully ";
                        return(RedirectToAction("Index"));
                    }
                }
                else
                {
                    Record.ApproverList = _LeaveAddAdmin.CreateLeaveApplicationInformation(empcode, Record.LeaveTypeId, recommendType).ApproverList;

                    return(View(Record));
                }
            }
            catch (Exception Ex)
            {
                Session["error"]    = Ex.Message;
                Record.ApproverList = _LeaveAddAdmin.CreateLeaveApplicationInformation(empcode, Record.LeaveTypeId, recommendType).ApproverList;

                return(View(Record));
            }
        }
Ejemplo n.º 25
0
        public ActionResult AddEducation(EmpEducationDTO data)
        {
            data.PassedDate = Convert.ToDateTime(NepEngDate.NepToEng(data.PassedDateNP));
            data.EmpCode    = Convert.ToInt32(Session["EmpCode"]);

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

            foreach (var row in _educationLevel.GetEducationLevel())
            {
                educationLevel.Add(new SelectListItem
                {
                    Text  = row.LevelName,
                    Value = row.LevelId.ToString()
                });
            }
            IEnumerable <SelectListItem> CountryList = _countryService.GetCountryList();

            ViewBag.Countries      = CountryList;
            ViewBag.EducationLevel = educationLevel;
            //ViewBag.EmployeeDetail = _empDetails.GetEmployeeDetails(id);
            //ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(id);
            try
            {
                if (!ModelState.IsValid)
                {
                    ModelState.AddModelError("Error", "Please Fill up all required field");
                    return(View());
                }
                EmpEducationDTO res = new EmpEducationDTO();
                //data.EmpCode = id;
                res             = _empEducationService.InsertEmpEducation(data);
                ViewBag.Success = "Education added";
                return(View());
            }
            catch (Exception ex)
            {
                //ViewBag.EmployeeDetail = _empDetails.GetEmployeeDetails(id);
                //ViewBag.SideBar = _moduleService.AdminEmployeeDetailsMenu(id);
                ViewBag.Error = ex.Message;
                ModelState.AddModelError("Error", ex.Message);
                return(View(data));
            }
        }
Ejemplo n.º 26
0
        public ActionResult Update(int id)
        {
            int            curentemp = Convert.ToInt32(Session["Empcode"]);
            int            roleid    = Convert.ToInt32(Session["RoleId"]);
            LeaveEarnedDTO Record    = new LeaveEarnedDTO();

            Record = _LeaveEarnedService.GetOneLeaveEarned(id);
            Record.WorkedStartDateNP   = NepEngDate.EngToNep(Record.WorkedStartDate);
            Record.WorkedEndDateNP     = NepEngDate.EngToNep(Record.WorkedEndDate);
            Record.YearSelectList      = _SpecialleavetypeService.GetYearSelectList();
            Record.LeaveTypeSelectList = _LeaveEarnedService.GetEarnedLeaveTypeList();


            //   Record.EmployeeCodeSelectlist = _LeaveEarnedService.GetSelectedBranchEmployeeSelectList(curentemp,Convert.ToInt32(Record.EmpCode));
            Record.ApproveEmployeeCodeSelectlist = _DynamicSelectList.GetLeaveApproverSelectList(Record.EmpCode, "Earning");
            Record.EmpId = Record.EmpCode;
            Record.GetRecommederSelectList = _DynamicSelectList.GetLeaveRecommenderSelectList(Record.EmpCode, "Earning");

            return(View("../Leave/LeaveEarned/Update", Record));
        }
Ejemplo n.º 27
0
        public ActionResult AddFamily(EmployeeFamilyViewModel data)
        {
            data.FDob = Convert.ToDateTime(NepEngDate.NepToEng(data.FDobNP));

            data.EmpCode = Convert.ToInt32(Session["EmpCode"]);
            EmployeeFamilyViewModel employeeEducation = new EmployeeFamilyViewModel();
            //employeeEducation.CountryList = _empEducationService.GetCountryList();
            //employeeEducation.EducationLevelList = _empEducationService.GetEducationLevelList();

            //if (!ModelState.IsValid)
            //{
            //    return View(employeeEducation);
            //}
            EmployeeFamilyViewModel res = new EmployeeFamilyViewModel();

            res             = _empFamilyService.InsertEmpFamily(data);
            ViewBag.Success = "family of " + res.EmpCode + " has been created";
            ModelState.Clear();
            return(View(employeeEducation));
        }
Ejemplo n.º 28
0
        public ActionResult Create(PayrollOvertimeDTO payrollOvertime)
        {
            int EmpCode = Convert.ToInt32(Session["Empcode"]);

            payrollOvertime.OvertimeDate        = Convert.ToDateTime(NepEngDate.NepToEng(payrollOvertime.OvertimeDateNP));
            payrollOvertime.ApproveStatusDate   = Convert.ToDateTime(NepEngDate.NepToEng(payrollOvertime.ApproveStatusDateNP));
            payrollOvertime.OvertimeAppliedDate = Convert.ToDateTime(NepEngDate.NepToEng(payrollOvertime.OvertimeAppliedDateNP));
            PayrollOvertimeDTO jtd = new PayrollOvertimeDTO();

            ViewBag.ddlEmployeeList = _dynamicSelectList.GetEmployeeByEmpCode(EmpCode).ToList();
            if (!ModelState.IsValid)
            {
                return(View(jtd));
            }
            PayrollOvertimeDTO res = new PayrollOvertimeDTO();

            res             = _payrollOvertimeService.InsertPayrollOvertime(payrollOvertime);
            ViewBag.Success = "Overtime of " + res.OvertimeAppliedDate + " has been created";
            ModelState.Clear();
            return(View(jtd));
        }
Ejemplo n.º 29
0
        public ActionResult RecommenderList(AttendanceRequestsListViewModel att)
        {
            att.startdate = Convert.ToDateTime(NepEngDate.NepToEng(att.startdateNP));
            att.enddate   = Convert.ToDateTime(NepEngDate.NepToEng(att.enddateNP));

            ViewBag.startdate = att.startdateNP;
            ViewBag.enddate   = att.enddateNP;

            int id = ViewBag.Empcode;

            ViewBag.emplist         = _employeeServices.GetEmployeeList(id);
            ViewBag.OfficeList      = _officeServices.GetOfficeAllData();
            ViewBag.officeid        = att.OfficeId;
            ViewBag.code            = att.EmpCodes;
            ViewBag.approvestatus   = att.ApproverStatus;
            ViewBag.recommendstatus = att.RecommendSatus;
            ViewBag.id = id;
            IEnumerable <AttendanceRequestsListViewModel> lst = _attendanceDailyServices.GetrequestAttendanceListByParms(att.OfficeId, att.EmpCodes, att.startdate, att.enddate, id, null, att.RecommendSatus, att.ApproverStatus).ToList();

            return(View(lst));
        }
Ejemplo n.º 30
0
        public ActionResult Index(int empCode)
        {
            if (!ViewBag.AllowView)
            {
                ViewBag.Error = "You are not Authorize to use this Page";
                return(PartialView("_partialviewNotFound"));
            }
            ListOfDatas(empCode);
            List <EmployeeJobHistoryDTO> res = _jobHistoryService.GetAllHistoryOfEmployeeForKaaz(empCode);

            foreach (var item in res)
            {
                item.DesignationName   = _designationServices.GetDesignationById((int)item.DesgId).DsgName;
                item.LetterIssueDateNP = (NepEngDate.EngToNep(Convert.ToDateTime(item.LetterIssueDate)));
                item.KajStartDateNP    = (NepEngDate.EngToNep(Convert.ToDateTime(item.KajStartDate)));
                item.KajEndDateNP      = (NepEngDate.EngToNep(Convert.ToDateTime(item.KajEndDate)));
            }

            ViewBag.EmpCode = empCode;
            return(View("../Employee/kajmakhataune/Index", res));
        }