Пример #1
0
        public ActionResult Home(string userLogin)
        {
            //var service = new BaseService();
            var service = new Hre_ProfileServices();
            var info = new Hre_NotificationModel();
            info = (Hre_NotificationModel)Session["LoginInfo"];
            //count yeu cau tang ca cho duyet
            #region Hien thi du lieu tren trang chu
            string status = string.Empty;
            //Count ds tang ca cho duyet
            var userId = Session[SessionObjects.UserId] == null ? Guid.Empty : (Guid)Session[SessionObjects.UserId];
            var objOvertime = new List<object>();
            objOvertime.AddRange(new object[13]);
            objOvertime[5] = "E_SUBMIT,E_FIRST_APPROVED";
            objOvertime[8] = userId;
            objOvertime[11] = 1;
            objOvertime[12] = int.MaxValue - 1;
            var listOvertimeEntity = service.GetData<Att_OvertimeEntity>(objOvertime, ConstantSql.hrm_att_sp_get_Overtime, userLogin, ref status).ToList();
            var listOvertime = listOvertimeEntity.Where(s => !(s.Status == LeaveDayStatus.E_FIRST_APPROVED.ToString() && s.UserApproveID == userId)).ToList();
            if (listOvertime != null)
                info.CountOvertime = listOvertime.Count();
           
            //count ds ngay nghi cho duyet
            var objLeaveday = new List<object>();
            objLeaveday.AddRange(new object[11]);
            objLeaveday[2] = "E_SUBMIT,E_FIRST_APPROVED";
            objLeaveday[7] = userId;
            objLeaveday[9] = 1;
            objLeaveday[10] = int.MaxValue - 1;
            var lstLeavedayEntity = service.GetData<Att_LeaveDayEntity>(objLeaveday, ConstantSql.hrm_att_sp_get_Leaveday, userLogin, ref status).ToList();
            var listLeaveday = lstLeavedayEntity.Where(s => !(s.Status == OverTimeStatus.E_FIRST_APPROVED.ToString() && s.UserApproveID == userId)).ToList();
            if (listLeaveday != null)
                info.CountLeaveday = listLeaveday.Count();
            #endregion


            return GetView(info);
        }
Пример #2
0
        public ActionResult GeneralProfileDetail(string userLogin)
        {
            if (!CheckPermission()) return RedirectToAction("Denied", "Portal");

            var id = Session[SessionObjects.ProfileID];
            var service = new Hre_ProfileServices();
            string status = string.Empty;
            var model = service.GetData<Hre_ProfileModelPortal>(HRM.Infrastructure.Utilities.Common.DotNetToOracle(id.ToString()), ConstantSql.hrm_hr_sp_get_ProfileById, userLogin, ref status).FirstOrDefault();
            if (model != null)
            {
                Session["ProfileName"] = model.ProfileName;
                model.ActionStatus = status;

                var info = new Hre_NotificationModel();
                info.ProfileName = model.ProfileName;
                info.UserLogin = Session[SessionObjects.LoginUserName].ToString();
                info.EmployeeTypeName = model.EmployeeTypeName;
                info.JobTitleName = model.JobTitleName;
                info.OrgStructureName = model.OrgStructureName;

                Session["LoginInfo"] = info;

            }
            return GetOnlyView(model);
        }