当前位置: 首页>>代码示例>>C#>>正文


C# Hre_ProfileServices.getHDTJobByPrice方法代码示例

本文整理汇总了C#中HRM.Business.Hr.Domain.Hre_ProfileServices.getHDTJobByPrice方法的典型用法代码示例。如果您正苦于以下问题:C# Hre_ProfileServices.getHDTJobByPrice方法的具体用法?C# Hre_ProfileServices.getHDTJobByPrice怎么用?C# Hre_ProfileServices.getHDTJobByPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HRM.Business.Hr.Domain.Hre_ProfileServices的用法示例。


在下文中一共展示了Hre_ProfileServices.getHDTJobByPrice方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetReportHDTJobDecisionAssignWork

 public List<Hre_HDTJobEntity> GetReportHDTJobDecisionAssignWork(DateTime? Datesearch, string lstOrgOrderNumber, Guid? positionID, Guid? jobTitleID, string profileName, string CodeEmp, string userLogin)
 {
     string status = string.Empty;
     List<Hre_HDTJobEntity> lstReportHDTJobEntity = new List<Hre_HDTJobEntity>();
     using (var context = new VnrHrmDataContext())
     {
         var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
         var basevices = new BaseService();
         var hdtJobServices = new Hre_HDTJobServices();
         var profileServices = new Hre_ProfileServices();
         List<object> listObjHDTJob = new List<object>();
         listObjHDTJob.Add(profileName);
         listObjHDTJob.Add(CodeEmp);
         listObjHDTJob.Add(null);
         listObjHDTJob.Add(null);
         listObjHDTJob.Add(null);
         listObjHDTJob.Add(lstOrgOrderNumber);
         listObjHDTJob.Add(null);
         listObjHDTJob.Add(null);
         listObjHDTJob.Add(null);
         listObjHDTJob.Add(null);
         listObjHDTJob.Add(null);
         listObjHDTJob.Add(null);
         listObjHDTJob.Add(1);
         listObjHDTJob.Add(Int32.MaxValue - 1);
         
         var lstHDTJob = hdtJobServices.GetData<Hre_HDTJobEntity>(listObjHDTJob, ConstantSql.hrm_hr_sp_get_HDTJob, userLogin, ref status).ToList();              
         if (lstHDTJob.Count == 0)
         {
             return lstReportHDTJobEntity;
         }
         if (Datesearch != null )
         {
             lstHDTJob = lstHDTJob.Where(s => s.DateFrom != null &&  s.DateTo != null && (s.DateFrom.Value.Date == Datesearch.Value.Date || s.DateTo.Value.Date == Datesearch.Value.Date)).ToList();
         }
         
         lstReportHDTJobEntity = profileServices.getHDTJobByPrice(lstHDTJob, null, null);
         lstReportHDTJobEntity = lstReportHDTJobEntity.OrderByDescending(s => s.CodeEmp).ThenBy(s => s.ProfileName).ThenBy(s => s.DateFrom).ToList();
     }
     return lstReportHDTJobEntity;
 }
开发者ID:dtafe,项目名称:vnr,代码行数:41,代码来源:Hre_ReportServices.cs

示例2: GetReportUnusualHDT

        public DataTable GetReportUnusualHDT(DateTime? DateFrom, DateTime? DateTo, string lstOrgOrderNumber, bool _isCreateTemplate, string userLogin)
        {
            using (var context = new VnrHrmDataContext())
            {
                string status = string.Empty;
                var unitOfWork = (UnitOfWork)(new UnitOfWork(context));
                DataTable table = CreateReportUnusualHDTScheme();
                var basevices = new BaseService();
                var hdtJobServices = new Hre_HDTJobServices();
                var ProfileServices = new Hre_ProfileServices();
                List<object> listObjHDTJob = new List<object>();
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(lstOrgOrderNumber);
                listObjHDTJob.Add(DateFrom);
                listObjHDTJob.Add(DateTo);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(1);
                listObjHDTJob.Add(Int32.MaxValue - 1);
                var lstReportUnusualHDT = hdtJobServices.GetData<Hre_HDTJobEntity>(listObjHDTJob, ConstantSql.hrm_hr_sp_get_HDTJob, userLogin, ref status).ToList();
                if (lstReportUnusualHDT.Count == 0)
                {
                    return table;
                }
                lstReportUnusualHDT = ProfileServices.getHDTJobByPrice(lstReportUnusualHDT, DateFrom, DateTo);

                var lstprofileids = lstReportUnusualHDT.Select(s => s.ProfileID).Distinct().ToList();
                var repoCan_MealRecord = new CustomBaseRepository<Can_MealRecord>(unitOfWork);
                var lstmealrecord = new List<Can_MealRecord>().Select(d => new
                {
                    d.ProfileID,
                    d.TimeLog,
                    d.LineID,
                    d.Amount
                }).ToList();
                foreach (var item in lstprofileids.Chunk(1000))
                {
                    lstmealrecord.AddRange(repoCan_MealRecord.FindBy(s => s.IsDelete == null && lstprofileids.Contains(s.ProfileID) && s.TimeLog >= DateFrom && s.TimeLog <= DateTo).Select(d => new
                    {
                        d.ProfileID,
                        d.TimeLog,
                        d.LineID,
                        d.Amount
                    }).ToList());
                }
                var lstlineids = lstmealrecord.Select(s => s.LineID).Distinct().ToList();

                var repoCan_Line = new CustomBaseRepository<Can_Line>(unitOfWork);
                var lstline = repoCan_Line.FindBy(s => s.IsDelete == null && lstlineids.Contains(s.ID) && s.IsHDTJOB == true).ToList();
                foreach (var item in lstReportUnusualHDT)
                {
                    DataRow row = table.NewRow();
                    row[Hre_ReportUnusualHDTEntity.FieldNames.CodeEmp] = item.CodeEmp;
                    row[Hre_ReportUnusualHDTEntity.FieldNames.ProfileName] = item.ProfileName;
                    row[Hre_ReportUnusualHDTEntity.FieldNames.E_DEPARTMENT] = item.E_DEPARTMENT;
                    row[Hre_ReportUnusualHDTEntity.FieldNames.E_DIVISION] = item.E_DIVISION;
                    row[Hre_ReportUnusualHDTEntity.FieldNames.E_SECTION] = item.E_SECTION;
                    row[Hre_ReportUnusualHDTEntity.FieldNames.E_TEAM] = item.E_TEAM;
                    row[Hre_ReportUnusualHDTEntity.FieldNames.E_UNIT] = item.E_UNIT;
                    row[Hre_ReportUnusualHDTEntity.FieldNames.HDTJobTypeCode] = item.HDTJobTypeCode;
                    row[Hre_ReportUnusualHDTEntity.FieldNames.HDTJobTypeName] = item.HDTJobTypeName;
                    if (item.Price != null)
                    {
                        row[Hre_ReportUnusualHDTEntity.FieldNames.Price] = item.Price;
                    }
                    var mealbypro = lstmealrecord.Where(s => s.ProfileID == item.ProfileID).FirstOrDefault();
                    if (mealbypro != null)
                    {
                        if (mealbypro.TimeLog != null)
                        {
                            row[Hre_ReportUnusualHDTEntity.FieldNames.TimeScan] = mealbypro.TimeLog.Value.ToString("dd/MM/yyyy hh:ss");
                        }
                        var linebyhdt = lstline.Where(s => s.ID == mealbypro.LineID).FirstOrDefault();
                        if (linebyhdt != null && linebyhdt.Amount != null)
                        {
                            row[Hre_ReportUnusualHDTEntity.FieldNames.PriceRecieve] = linebyhdt.Amount;
                        }
                        if (linebyhdt != null && linebyhdt.Amount != null)
                        {
                            if (item.Price != (double)linebyhdt.Amount)
                            {
                                row[Hre_ReportUnusualHDTEntity.FieldNames.RevieveWrong] = true;
                            }
                        }
                        if (item.Price != null && linebyhdt == null)
                        {
                            row[Hre_ReportUnusualHDTEntity.FieldNames.HaveRegister] = true;
                        }
                        if (item.Price == null && linebyhdt != null)
                        {
                            row[Hre_ReportUnusualHDTEntity.FieldNames.NotRegister] = true;
                        }
                    }
                    table.Rows.Add(row);
//.........这里部分代码省略.........
开发者ID:dtafe,项目名称:vnr,代码行数:101,代码来源:Hre_ReportServices.cs

示例3: GetReportHDTJobOut

        public List<Hre_HDTJobEntity> GetReportHDTJobOut(DateTime? DateTo, string lstOrgOrderNumber, Guid? workPlaceID, string profileName, string CodeEmp, string userLogin)
        {
            string status = string.Empty;
            List<Hre_HDTJobEntity> lstReportHDTJobEntity = new List<Hre_HDTJobEntity>();
            using (var context = new VnrHrmDataContext())
            {
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                var basevices = new BaseService();
                var hdtJobServices = new Hre_HDTJobServices();
                var profileServices = new Hre_ProfileServices();
                List<object> listObjHDTJob = new List<object>();
                listObjHDTJob.Add(profileName);
                listObjHDTJob.Add(CodeEmp);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(lstOrgOrderNumber);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(1);
                listObjHDTJob.Add(Int32.MaxValue - 1);
                var lstHDTJob = hdtJobServices.GetData<Hre_HDTJobEntity>(listObjHDTJob, ConstantSql.hrm_hr_sp_get_HDTJob, userLogin, ref status).ToList();

                if (lstHDTJob.Count == 0)
                {
                    return lstReportHDTJobEntity;
                }
                if (DateTo != null)
                {
                    lstHDTJob = lstHDTJob.Where(s => s.DateTo != null && s.DateTo.Value.Date == DateTo.Value.Date).ToList();
                }
                lstReportHDTJobEntity = profileServices.getHDTJobByPrice(lstHDTJob, null, DateTo);
            }
            return lstReportHDTJobEntity;
        }
开发者ID:dtafe,项目名称:vnr,代码行数:39,代码来源:Hre_ReportServices.cs

示例4: GetReportHDTJobNotDateEnd

        public List<Hre_ReportHDTJobNotDateEndEntity> GetReportHDTJobNotDateEnd(DateTime? DateFrom, DateTime? DateTo, string lstOrgOrderNumber, string userLogin)
        {
            string status = string.Empty;
            List<Hre_ReportHDTJobNotDateEndEntity> lstReportHDTJobNotDateEndEntity = new List<Hre_ReportHDTJobNotDateEndEntity>();
            using (var context = new VnrHrmDataContext())
            {
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                var basevices = new BaseService();
                var hdtJobServices = new Hre_HDTJobServices();
                var ProfileServices = new Hre_ProfileServices();
                List<object> listObjHDTJob = new List<object>();
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(lstOrgOrderNumber);
                listObjHDTJob.Add(DateFrom);
                listObjHDTJob.Add(DateTo);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(1);
                listObjHDTJob.Add(Int32.MaxValue - 1);
                var lstHDTJob = hdtJobServices.GetData<Hre_HDTJobEntity>(listObjHDTJob, ConstantSql.hrm_hr_sp_get_HDTJob, userLogin, ref status).ToList();

                if (lstHDTJob == null)
                {
                    return lstReportHDTJobNotDateEndEntity;
                }

                var lstResultHDTJob = ProfileServices.getHDTJobByPrice(lstHDTJob, DateFrom, DateTo);

                var profileinList = lstResultHDTJob.Select(s => s.ProfileID).Distinct().ToList();


                foreach (var ids in profileinList)
                {
                    bool isNull = false;
                    var hdtbypro = lstResultHDTJob.Where(s => s.ProfileID == ids).OrderBy(s => s.DateFrom).ToList();
                    var hdt = lstResultHDTJob.Where(s => s.ProfileID == ids).FirstOrDefault();

                    foreach (var item in hdtbypro)
                    {
                        if (hdtbypro.Count == 1 && item.DateTo != null)
                        {
                            continue;
                        }

                        if (item.DateTo == null)
                        {
                            isNull = true;
                        }

                        if (isNull)
                        {
                            Hre_ReportHDTJobNotDateEndEntity entity = new Hre_ReportHDTJobNotDateEndEntity();
                            entity.CodeEmp = item.CodeEmp;
                            entity.ProfileName = item.ProfileName;
                            entity.E_UNIT = item.E_UNIT;
                            entity.E_DIVISION = item.E_DIVISION;
                            entity.E_DEPARTMENT = item.E_DEPARTMENT;
                            entity.E_TEAM = item.E_TEAM;
                            entity.E_SECTION = item.E_SECTION;
                            entity.Dept = item.Dept;
                            entity.HDTJobTypeCode = item.HDTJobTypeCode;
                            entity.HDTJobTypeName = item.HDTJobTypeName;
                            entity.HDTJobGroupName = item.HDTJobGroupName;
                            entity.DateFrom = item.DateFrom;
                            entity.DateTo = item.DateTo;
                            entity.StatusView = item.StatusView;
                            lstReportHDTJobNotDateEndEntity.Add(entity);
                        }

                        if (item.DateTo != null)
                        {
                            isNull = false;
                        }
                    }
                }
            }
            lstReportHDTJobNotDateEndEntity = lstReportHDTJobNotDateEndEntity.OrderBy(s => s.CodeEmp).ToList();
            return lstReportHDTJobNotDateEndEntity;
        }
开发者ID:dtafe,项目名称:vnr,代码行数:85,代码来源:Hre_ReportServices.cs

示例5: GetReportSumarySeniorHDTProfile

        public List<Hre_ReportSumarySeniorHDTProfileEntity> GetReportSumarySeniorHDTProfile(DateTime? DateFrom, DateTime? DateTo, string profileName,
            string codeEmp, string OrgStructureID, string userLogin)
        {
            string status = string.Empty;
            List<Hre_ReportSumarySeniorHDTProfileEntity> lstReportSumarySeniorHDTProfile = new List<Hre_ReportSumarySeniorHDTProfileEntity>();
            using (var context = new VnrHrmDataContext())
            {
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                var basevices = new BaseService();
                var hdtJobServices = new Hre_HDTJobServices();
                var ProfileServices = new Hre_ProfileServices();
                List<object> listObjHDTJob = new List<object>();
                listObjHDTJob.Add(profileName);
                listObjHDTJob.Add(codeEmp);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(OrgStructureID);
                listObjHDTJob.Add(DateFrom);
                listObjHDTJob.Add(DateTo);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(1);
                listObjHDTJob.Add(Int32.MaxValue - 1);
                var lstHDTJob = hdtJobServices.GetData<Hre_HDTJobEntity>(listObjHDTJob, ConstantSql.hrm_hr_sp_get_RptRecieveObjectByTime, userLogin, ref status).ToList();

                if (lstHDTJob.Count == 0)
                {
                    return lstReportSumarySeniorHDTProfile;
                }

                var lstProfileIds = lstHDTJob.Select(s => s.ProfileID).Distinct().ToList();
                string selectedIds = Common.DotNetToOracle(String.Join(",", lstHDTJob.Select(s => s.ProfileID.ToString()).ToList<string>()));

                var lstInsurance = new List<Ins_ProfileInsuranceMonthlyEntity>();
                int _total = lstProfileIds.Count;
                int _totalPage = _total / 100 + 1;
                int _pageSize = 100;
                for (int _page = 1; _page <= _totalPage; _page++)
                {
                    int _skip = _pageSize * (_page - 1);
                    var _listCurrenPage = lstProfileIds.Skip(_skip).Take(_pageSize).ToList();
                    string _strselectedIDs = Common.DotNetToOracle(string.Join(",", _listCurrenPage));
                    var lstresultInsurance = basevices.GetData<Ins_ProfileInsuranceMonthlyEntity>(_strselectedIDs, ConstantSql.hrm_ins_sp_get_ProfileInsMonthlyByProfileIds, userLogin, ref status).ToList();
                    if (lstresultInsurance != null && lstresultInsurance.Count > 0)
                    {
                        lstInsurance.AddRange(lstresultInsurance);
                    }
                }

                var lstHDTJobCut = ProfileServices.getHDTJobByPrice(lstHDTJob, DateFrom, DateTo);

                var lstprofileNameDistince = lstHDTJob.Select(s => new { s.ProfileID, s.ProfileName, s.CodeEmp, s.E_DEPARTMENT }).Distinct().ToList();
                foreach (var profile in lstprofileNameDistince)
                {
                    Hre_ReportSumarySeniorHDTProfileEntity entity = new Hre_ReportSumarySeniorHDTProfileEntity();
                    entity.CodeEmp = profile.CodeEmp;
                    entity.ProfileName = profile.ProfileName;
                    entity.E_DEPARTMENT = profile.E_DEPARTMENT;
                    var hdtbyProfile = lstHDTJobCut.Where(s => s.ProfileID == profile.ProfileID).ToList();
                    int counttype4 = 0;
                    int counttype5 = 0;
                    foreach (var item in hdtbyProfile)
                    {
                        var insuracebyHDT4 = lstInsurance.Where(s => s.HDTJobGroupCode == item.HDTJobGroupCode && s.ProfileID == item.ProfileID && s.AmountHDTIns > 0 && item.Type == "E_TYPE4").ToList();
                        if (insuracebyHDT4.Count > 0)
                        {
                            counttype4 += insuracebyHDT4.Count;
                        }
                        var insuracebyHDT5 = lstInsurance.Where(s => s.HDTJobGroupCode == item.HDTJobGroupCode && s.ProfileID == item.ProfileID && s.AmountHDTIns > 0 && item.Type == "E_TYPE5").ToList();
                        if (insuracebyHDT4.Count > 0)
                        {
                            counttype5 += insuracebyHDT5.Count;
                        }
                    }

                    entity.MonthInsuranceType4 = counttype4;
                    entity.MonthInsuranceType5 = counttype5;
                    lstReportSumarySeniorHDTProfile.Add(entity);
                }
            }
            return lstReportSumarySeniorHDTProfile;
        }
开发者ID:dtafe,项目名称:vnr,代码行数:85,代码来源:Hre_ReportServices.cs

示例6: GetReportRecieveObjectByTime

        public DataTable GetReportRecieveObjectByTime(string orgStructureIDs, DateTime dateFrom, DateTime dateTo, bool IsCreateTemplate, string userLogin)
        {
            DataTable table = GetSchemaReportRecieveObjectByTime(userLogin);
            if (IsCreateTemplate)
            {
                return table.ConfigTable();
            }
            string status = string.Empty;
            using (var context = new VnrHrmDataContext())
            {
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                var basevices = new BaseService();
                var hdtJobServices = new Hre_HDTJobServices();
                List<object> listObjHDTJob = new List<object>();
                listObjHDTJob.AddRange(new object[14]);
                listObjHDTJob[5] = orgStructureIDs;
                listObjHDTJob[6] = dateFrom;
                listObjHDTJob[7] = dateTo;
                listObjHDTJob[12] = 1;
                listObjHDTJob[13] = Int32.MaxValue - 1;
                var lstHDTJob = hdtJobServices.GetData<Hre_HDTJobEntity>(listObjHDTJob, ConstantSql.hrm_hr_sp_get_RptRecieveObjectByTime, userLogin, ref status).ToList();
                if (lstHDTJob.Count == 0)
                {
                    return table;
                }

                var lstProfileIDByHDTJob = lstHDTJob.Select(s => s.ProfileID).Distinct().ToList();

                #region Lấy WorkDay
                var workDayRepository = new Att_WorkDayRepository(unitOfWork);
                var lstworkDays = new List<Att_Workday>().Select(d => new
                {
                    d.ProfileID,
                    d.WorkDate,
                    d.FirstInTime,
                    d.LastOutTime
                }).ToList();

                foreach (var item in lstProfileIDByHDTJob.Chunk(1000))
                {
                    lstworkDays.AddRange(workDayRepository.FindBy(s => s.IsDelete == null && s.WorkDate >= dateFrom
                        && s.WorkDate <= dateTo && item.Contains(s.ProfileID)).Select(d => new
                        {
                            d.ProfileID,
                            d.WorkDate,
                            d.FirstInTime,
                            d.LastOutTime
                        }).ToList());
                }

                if (lstworkDays.Count == 0)
                {
                    return table;
                }
                #endregion

                #region Lấy MealRecord
                var mealRecordRepository = new Can_MealRecordRepository(unitOfWork);
                var lstmeadrecored = new List<Can_MealRecord>().Select(d => new
                {
                    d.ProfileID,
                    d.WorkDay,
                    d.Amount
                }).ToList();

                foreach (var item in lstProfileIDByHDTJob.Chunk(1000))
                {
                    lstmeadrecored.AddRange(mealRecordRepository.FindBy(s => s.IsDelete == null && s.WorkDay >= dateFrom
                        && s.WorkDay <= dateTo && item.Contains(s.ProfileID)).Select(d => new
                        {
                            d.ProfileID,
                            d.WorkDay,
                            d.Amount
                        }).ToList());
                }
                #endregion

                List<object> listObjPrice = new List<object>();
                listObjPrice.Add(null);
                listObjPrice.Add(null);
                listObjPrice.Add(null);
                listObjPrice.Add(1);
                listObjPrice.Add(Int32.MaxValue - 1);
                var lstHDTJobTypePrice = basevices.GetData<Cat_HDTJobTypePriceEntity>(listObjPrice, ConstantSql.hrm_cat_sp_get_HDTJobTypePrice, userLogin, ref status).Where(s => s.Price != null).Distinct().ToList();
                var profileServices = new Hre_ProfileServices();
                var listResult = profileServices.getHDTJobByPrice(lstHDTJob, dateFrom, dateTo);

                var ListProfileID = listResult.Select(m => m.ProfileID).Distinct().ToList();

                foreach (var profileID in ListProfileID)
                {
                    var firstProfile = listResult.Where(m => m.ProfileID == profileID).FirstOrDefault();
                    var lstWorkDaysByProfile = lstworkDays.Where(m => m.ProfileID == profileID && (m.FirstInTime != null || m.LastOutTime != null)).ToList();
                    var lstmeadlbypro = lstmeadrecored.Where(s => s.ProfileID == profileID).ToList();
                    if (firstProfile != null && lstWorkDaysByProfile.Count != 0)
                    {
                        bool isAdd = false;
                        DataRow row = table.NewRow();
                        row[Hre_ReportRecieveObjectByTimeEntity.FieldNames.ProfileName] = firstProfile.ProfileName;
                        row[Hre_ReportRecieveObjectByTimeEntity.FieldNames.CodeEmp] = firstProfile.CodeEmp;
//.........这里部分代码省略.........
开发者ID:dtafe,项目名称:vnr,代码行数:101,代码来源:Hre_ReportServices.cs

示例7: GetReportSumaryHDTProfile

        public List<Hre_ReportSumaryHDTProfileEntity> GetReportSumaryHDTProfile(DateTime? DateFrom, DateTime? DateTo, Guid? HDTJobGroupID, string CodeEmp, string userLogin)
        {
            string status = string.Empty;
            List<Hre_ReportSumaryHDTProfileEntity> lstReportSumaryHDTProfile = new List<Hre_ReportSumaryHDTProfileEntity>();
            using (var context = new VnrHrmDataContext())
            {
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                var basevices = new BaseService();
                var hdtJobServices = new Hre_HDTJobServices();
                var ProfileServices = new Hre_ProfileServices();
                List<object> listObjHDTJob = new List<object>();
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(CodeEmp);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(DateFrom);
                listObjHDTJob.Add(DateTo);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(null);
                listObjHDTJob.Add(1);
                listObjHDTJob.Add(Int32.MaxValue - 1);
                var lstHDTJob = hdtJobServices.GetData<Hre_HDTJobEntity>(listObjHDTJob, ConstantSql.hrm_hr_sp_get_ReportSumaryHDTProfile, userLogin, ref status).ToList();
                if (lstHDTJob.Count == 0)
                {
                    return lstReportSumaryHDTProfile;
                }
                if (HDTJobGroupID != null)
                {
                    lstHDTJob = lstHDTJob.Where(s => s.HDTJobGroupID == HDTJobGroupID).ToList();
                }
                var lstprofileids = lstHDTJob.Select(s => s.ProfileID).Distinct().ToList();

                string selectedIds = Common.DotNetToOracle(String.Join(",", lstHDTJob.Select(s => s.ProfileID.ToString()).ToList<string>()));

                var lstInsurance = new List<Ins_ProfileInsuranceMonthlyEntity>();
                int _total = lstprofileids.Count;
                int _totalPage = _total / 100 + 1;
                int _pageSize = 100;
                for (int _page = 1; _page <= _totalPage; _page++)
                {
                    int _skip = _pageSize * (_page - 1);
                    var _listCurrenPage = lstprofileids.Skip(_skip).Take(_pageSize).ToList();
                    string _strselectedIDs = Common.DotNetToOracle(string.Join(",", _listCurrenPage));
                    var lstresultInsurance = basevices.GetData<Ins_ProfileInsuranceMonthlyEntity>(_strselectedIDs, ConstantSql.hrm_ins_sp_get_ProfileInsMonthlyByProfileIds, userLogin, ref status).ToList();
                    if (lstresultInsurance != null && lstresultInsurance.Count > 0)
                    {
                        lstInsurance.AddRange(lstresultInsurance);
                    }
                }

                var lstHDTJobCut = ProfileServices.getHDTJobByPrice(lstHDTJob, DateFrom, DateTo);

                foreach (var HDTJob in lstHDTJobCut)
                {
                    Hre_ReportSumaryHDTProfileEntity entity = new Hre_ReportSumaryHDTProfileEntity();
                    entity.ProfileName = HDTJob.ProfileName;
                    entity.CodeEmp = HDTJob.CodeEmp;
                    entity.E_UNIT = HDTJob.E_UNIT;
                    entity.E_DIVISION = HDTJob.E_DIVISION;
                    entity.E_DEPARTMENT = HDTJob.E_DEPARTMENT;
                    entity.E_TEAM = HDTJob.E_TEAM;
                    entity.E_SECTION = HDTJob.E_SECTION;
                    entity.Dept = HDTJob.Dept;
                    entity.Type = HDTJob.Type != null ? HDTJob.Type.TranslateString() : null;
                    entity.HDTJobGroupCode = HDTJob.HDTJobGroupCode;
                    entity.HDTJobGroupName = HDTJob.HDTJobGroupName;
                    entity.DateFrom = HDTJob.DateFrom;
                    entity.DateTo = HDTJob.DateTo;
                    var insuracebyHDT = lstInsurance.Where(s => s.HDTJobGroupCode == HDTJob.HDTJobGroupCode && s.ProfileID == HDTJob.ProfileID && s.AmountHDTIns > 0).ToList();
                    entity.MonthInsurance = insuracebyHDT != null ? insuracebyHDT.Count : 0;
                    lstReportSumaryHDTProfile.Add(entity);
                }
            }

            return lstReportSumaryHDTProfile;
        }
开发者ID:dtafe,项目名称:vnr,代码行数:80,代码来源:Hre_ReportServices.cs

示例8: GetReportProfileHDTInMonth

        public DataTable GetReportProfileHDTInMonth(DateTime Month, string lstOrgOrderNumber, List<string> lstUnit, List<string> lstDept, List<string> lstPart, bool IsCreateTemplate, string userLogin)
        {
            DataTable table = CreateReportProfileHDTInMonthSchema();
            if (IsCreateTemplate)
            {
                return table.ConfigTable();
            }
            DateTime monthStart = new DateTime(Month.Year, Month.Month, 1);
            DateTime monthEnd = monthStart.AddMonths(1).AddMilliseconds(-1);
            string status = string.Empty;
            using (var context = new VnrHrmDataContext())
            {
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                var basevices = new BaseService();
                var hdtJobServices = new Hre_HDTJobServices();
                List<object> listObjHDTJob = new List<object>();
                listObjHDTJob.AddRange(new object[14]);
                listObjHDTJob[5] = lstOrgOrderNumber;
                listObjHDTJob[12] = 1;
                listObjHDTJob[13] = Int32.MaxValue - 1;
                var lstHDTJob = hdtJobServices.GetData<Hre_HDTJobEntity>(listObjHDTJob, ConstantSql.hrm_hr_sp_get_HDTJob, userLogin, ref status).ToList();
                //Hieu.Van: HungLe yêu cầu thêm nghiệp vụ này idTask: 19234
                //Chỉ xuất những người còn làm HDTJob trong tháng

                lstHDTJob = lstHDTJob.Where(s => s.DateFrom != null && s.DateFrom.Value.Month == Month.Month).ToList();
               
                if (lstUnit.Count() > 0)
                {
                    lstHDTJob = lstHDTJob.Where(s => lstUnit.Contains(s.Unit)).ToList();
                }
                if (lstDept.Count() > 0)
                {
                    lstHDTJob = lstHDTJob.Where(s => lstDept.Contains(s.Dept)).ToList();
                }
                if (lstPart.Count() > 0)
                {
                    lstHDTJob = lstHDTJob.Where(s => lstPart.Contains(s.Part)).ToList();
                }
                if (lstHDTJob.Count == 0)
                {
                    return table;
                }
                var lstProfileIDsByHDTJob = lstHDTJob.Select(s => s.ProfileID).ToList();
                #region DS ngày công Theo ProfileIds
                var workDayRepository = new Att_WorkDayRepository(unitOfWork);
                var lstWorkDay = new List<Att_Workday>().Select(s => new
                {
                    s.ID,
                    s.ProfileID,
                    s.WorkDate,
                    s.ShiftActual
                }).ToList();

                lstWorkDay.AddRange(workDayRepository.FindBy(s => s.IsDelete == null && s.FirstInTime != null && s.LastOutTime != null && s.WorkDate.Month == Month.Month 
                    && lstProfileIDsByHDTJob.Contains(s.ProfileID)).Select(s => new
                {
                    s.ID,
                    s.ProfileID,
                    s.WorkDate,
                    s.ShiftActual
                }).ToList());
                #endregion
                #region DS ngày nghỉ Theo ProfileIds
                var leavedayRepository = new Att_LeavedayRepository(unitOfWork);
                var lstleaveday = new List<Att_LeaveDay>().Select(s => new
                {
                    s.ID,
                    s.ProfileID,
                    s.DateStart,
                    s.DateEnd
                }).ToList();

                lstleaveday.AddRange(leavedayRepository.FindBy(s => s.IsDelete == null
                    && s.DateStart.Month <= Month.Month && s.DateEnd.Month >= Month.Month
                    && lstProfileIDsByHDTJob.Contains(s.ProfileID) && s.Status == LeaveDayStatus.E_APPROVED.ToString()).Select(s => new
                    {
                        s.ID,
                        s.ProfileID,
                        s.DateStart,
                        s.DateEnd
                    }).ToList());
                #endregion
                #region DS ca làm việc
                var shiftRepository = new Cat_ShiftRepository(unitOfWork);
                var lstShift = new List<Cat_Shift>().Select(s => new
                {
                    s.ID,
                    s.Code
                }).ToList();

                lstShift.AddRange(shiftRepository.FindBy(s => s.IsDelete == null ).Select(s => new
                    {
                        s.ID,
                        s.Code
                    }).ToList());
                #endregion
                Hre_ProfileServices hreService = new Hre_ProfileServices();
                lstHDTJob = hreService.getHDTJobByPrice(lstHDTJob, monthStart, monthEnd);
                foreach (var HDTJob in lstHDTJob)
                {
//.........这里部分代码省略.........
开发者ID:dtafe,项目名称:vnr,代码行数:101,代码来源:Hre_ReportServices.cs

示例9: GetReportProfileHDTNotWork

        public DataTable GetReportProfileHDTNotWork(DateTime DateFrom, DateTime DateTo, string lstOrgOrderNumber, string nameReport, bool isCreateTemplate,string userLogin)
        {
            string status = string.Empty;
            //List<Hre_ReportProfileHDTNotWorkEntity> lstReportProfileHDTNotWork = new List<Hre_ReportProfileHDTNotWorkEntity>();
            using (var context = new VnrHrmDataContext())
            {
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                var basevices = new BaseService();


                DataTable tb = GetSchema_ReportProfileHDTNotWork(nameReport);
                if (isCreateTemplate)
                {
                    return tb.ConfigTable();
                }


                var hdtJobServices = new Hre_HDTJobServices();
                List<object> listObjHDTJob = new List<object>();
                listObjHDTJob.AddRange(new object[14]);
                listObjHDTJob[5] = lstOrgOrderNumber;
                listObjHDTJob[6] = DateFrom;
                listObjHDTJob[7] = DateTo;
                listObjHDTJob[12] = 1;
                listObjHDTJob[13] = Int32.MaxValue - 1;
                var lstHDTJob = hdtJobServices.GetData<Hre_HDTJobEntity>(listObjHDTJob, ConstantSql.hrm_hr_sp_get_HDTJob, userLogin, ref status).ToList();

                if (lstHDTJob == null || lstHDTJob.Count == 0)
                {
                    return tb.ConfigTable();
                }

                var lstProfileIDsByHDTJob = lstHDTJob.Select(s => s.ProfileID).Distinct().ToList();

                //var lstobjectProfileids = new List<object>();
                //string strIDs = string.Empty;
                //foreach (var item in lstProfileIDsByHDTJob)
                //{
                //    strIDs += Common.DotNetToOracle(item.ToString()) + ",";
                //}
                //if (strIDs.IndexOf(",") > 0)
                //    strIDs = strIDs.Substring(0, strIDs.Length - 1);
                //lstobjectProfileids.Add(strIDs);
                //var lstLeaveDay = basevices.GetData<Att_LeaveDayEntity>(strIDs, ConstantSql.hrm_att_sp_get_LeavedayByIds, ref status);

                List<object> para = new List<object>();
                para.AddRange(new object[3]);
                para[0] = (object)lstOrgOrderNumber;
                para[1] = DateFrom;
                para[2] = DateTo;
                var lstLeaveDay = GetData<Att_LeaveDayEntity>(para, ConstantSql.hrm_att_getdata_LeaveDay, userLogin, ref status);
                if (lstLeaveDay.Count > 0)
                {
                    lstLeaveDay = lstLeaveDay.Where(s => lstProfileIDsByHDTJob.Contains(s.ProfileID)).ToList();
                }

                if (lstLeaveDay != null && lstLeaveDay.Count > 0)
                {
                    lstLeaveDay = lstLeaveDay.Where(s => s.DateStart != null && s.DateEnd != null && s.DateStart <= DateTo && s.DateEnd >= DateFrom).ToList();
                }

                if (lstLeaveDay == null)
                {
                    return tb.ConfigTable();
                }

                List<object> listObjLeaveDayType = new List<object>();
                listObjLeaveDayType.Add(null);
                listObjLeaveDayType.Add(null);
                listObjLeaveDayType.Add(1);
                listObjLeaveDayType.Add(Int32.MaxValue - 1);
                var lstLeaveDayType = basevices.GetData<Cat_LeaveDayTypeEntity>(listObjLeaveDayType, ConstantSql.hrm_cat_sp_get_LeaveDayType, userLogin, ref status).ToList();

                Hre_ProfileServices hreService = new Hre_ProfileServices();
                lstHDTJob = hreService.getHDTJobByPrice(lstHDTJob, DateFrom, DateTo);

                foreach (var HDTJob in lstHDTJob)
                {
                    DataRow row = tb.NewRow();

                    row["ProfileName"] = HDTJob.ProfileName;
                    row["CodeEmp"] = HDTJob.CodeEmp;
                    row["E_DEPARTMENT"] = HDTJob.E_DEPARTMENT;
                    row["E_DIVISION"] = HDTJob.E_DIVISION;
                    row["E_SECTION"] = HDTJob.E_SECTION;
                    row["E_TEAM"] = HDTJob.E_TEAM;
                    row["E_UNIT"] = HDTJob.E_UNIT;
                    row["HDTJobGroupCode"] = HDTJob.HDTJobGroupCode;
                    row["HDTJobTypeCode"] = HDTJob.HDTJobTypeCode;

                    if (HDTJob.DateFrom != null)
                        row["HDTDateFrom"] = HDTJob.DateFrom;

                    if (HDTJob.DateTo != null)
                        row["HDTDateTo"] = HDTJob.DateTo;

                    if (HDTJob.Price != null)
                        row["Price"] = HDTJob.Price;
                    if (HDTJob.DateTo != null && HDTJob.DateFrom != null)
                    {
//.........这里部分代码省略.........
开发者ID:dtafe,项目名称:vnr,代码行数:101,代码来源:Hre_ReportServices.cs

示例10: ExportHDTJobListByTemplate

        public ActionResult ExportHDTJobListByTemplate([DataSourceRequest] DataSourceRequest request, Hre_HDTJobSearchModel model)
        {
            HeaderInfo headerInfo1 = new HeaderInfo() { Name = "DateFrom", Value = model.DateFrom == null ? DateTime.Now : model.DateFrom };
            HeaderInfo headerInfo2 = new HeaderInfo() { Name = "DateTo", Value = model.DateTo == null ? DateTime.Now : model.DateTo };
            List<HeaderInfo> listHeaderInfo = new List<HeaderInfo>() { headerInfo1, headerInfo2 };
            string status = string.Empty;
            var isDataTable = false;
            object obj = new Hre_ProfileModel();
            var actionServices = new ActionService(UserLogin);
            List<object> lstObjSearch = new List<object>();
            lstObjSearch.Add(model.ProfileName);
            lstObjSearch.Add(model.CodeEmp);
            lstObjSearch.Add(model.HDTJobTypeID);
            lstObjSearch.Add(model.JobTitleID);
            lstObjSearch.Add(model.PositionID);
            lstObjSearch.Add(model.OrgStructureID);
            lstObjSearch.Add(model.DateFrom);
            lstObjSearch.Add(model.DateTo);
            lstObjSearch.Add(model.Price);
            lstObjSearch.Add(model.IsCreateTemplate);
            lstObjSearch.Add(model.ExportId);
            lstObjSearch.Add(model.ExportType);
            lstObjSearch.Add(1);
            lstObjSearch.Add(int.MaxValue - 1);
            var result = actionServices.GetData<Hre_HDTJobEntity>(lstObjSearch, ConstantSql.hrm_hr_sp_get_HDTJob, ref status);
            var profileServices = new Hre_ProfileServices();
            var listResult = profileServices.getHDTJobByPrice(result, model.DateFrom, model.DateTo).Translate<Hre_HDTJobModel>();
            if (model != null && model.IsCreateTemplate)
            {
                var path = Common.GetPath("Templates");
                ExportService exportService = new ExportService();
                ConfigExport cfgExport = new ConfigExport()
                {
                    Object = new Hre_HDTJobModel(),
                    FileName = "Hre_HDTJob",
                    OutPutPath = path,
                    HeaderInfo = listHeaderInfo,
                    DownloadPath = Hrm_Main_Web + "Templates",
                    IsDataTable = isDataTable
                };
                var str = exportService.CreateTemplate(cfgExport);
                return Json(str);
            }

            if (model.ExportId != Guid.Empty)
            {
                if (model.DateFrom != null && model.DateTo != null)
                {
                    var fullPath = ExportService.Export(model.ExportId, listResult, listHeaderInfo, model.ExportType);
                    return Json(fullPath);
                }
                else
                {
                    var fullPath = ExportService.Export(model.ExportId, listResult, null, model.ExportType);
                    return Json(fullPath);
                }

            }
            return Json(result.ToDataSourceResult(request));
        }
开发者ID:dtafe,项目名称:vnr,代码行数:60,代码来源:Hre_GetDataController.cs

示例11: GetHDTJobList

        public ActionResult GetHDTJobList([DataSourceRequest] DataSourceRequest request, Hre_HDTJobSearchModel model)
        {
            var actionServices = new ActionService(UserLogin);
            string status = string.Empty;
            List<object> lstObjSearch = new List<object>();
            lstObjSearch.Add(model.ProfileName);
            lstObjSearch.Add(model.CodeEmp);
            lstObjSearch.Add(model.HDTJobTypeID);
            lstObjSearch.Add(model.JobTitleID);
            lstObjSearch.Add(model.PositionID);
            lstObjSearch.Add(model.OrgStructureID);
            lstObjSearch.Add(model.DateFrom);
            lstObjSearch.Add(model.DateTo);
            lstObjSearch.Add(model.Price);
            lstObjSearch.Add(model.IsCreateTemplate);
            lstObjSearch.Add(model.ExportId);
            lstObjSearch.Add(model.ExportType);
            lstObjSearch.Add(1);
            lstObjSearch.Add(int.MaxValue - 1);
            var result = actionServices.GetData<Hre_HDTJobEntity>(lstObjSearch, ConstantSql.hrm_hr_sp_get_HDTJob, ref status);
            if (result.Count > 0)
            {
                var profileServices = new Hre_ProfileServices();
                var listResult = profileServices.getHDTJobByPrice(result, model.DateFrom, model.DateTo);
                return Json(listResult.ToDataSourceResult(request));
            }
            else
            {
                return null;
            }

        }
开发者ID:dtafe,项目名称:vnr,代码行数:32,代码来源:Hre_GetDataController.cs

示例12: GetReportDetailProfileHDTJob

        public ActionResult GetReportDetailProfileHDTJob([DataSourceRequest] DataSourceRequest request, Hre_ReportDetailProfileHDTJobModel model)
        {
            #region Validate
            string status = string.Empty;
            string message = string.Empty;
            var checkValidate = ValidatorService.OnValidateData<Hre_ReportDetailProfileHDTJobModel>(model, "Hre_ReportDetailProfileHDTJob", ref message);
            if (!checkValidate)
            {
                return Json(message);
            }
            #endregion
            var actionService = new ActionService(UserLogin);
            var hrService = new Hre_ProfileServices();
            object obj = new Hre_ReportDetailProfileHDTJobModel();
            var isDataTable = false;
            HeaderInfo headerInfo1 = new HeaderInfo() { Name = "DateSearch", Value = model.DateSearch != null ? model.DateSearch : DateTime.Now };
            List<HeaderInfo> listHeaderInfo = new List<HeaderInfo>() { headerInfo1 };
            List<object> lstObjSearch = new List<object>();
            lstObjSearch.Add(null);
            lstObjSearch.Add(null);
            lstObjSearch.Add(null);
            lstObjSearch.Add(null);
            lstObjSearch.Add(null);
            lstObjSearch.Add(model.OrgStructureID);
            lstObjSearch.Add(null);
            lstObjSearch.Add(null);
            lstObjSearch.Add(null);
            lstObjSearch.Add(null);
            lstObjSearch.Add(null);
            lstObjSearch.Add(null);
            lstObjSearch.Add(1);
            lstObjSearch.Add(int.MaxValue - 1);
            var result = actionService.GetData<Hre_HDTJobEntity>(lstObjSearch, ConstantSql.hrm_hr_sp_get_HDTJob, ref status).Where(s =>
                (s.DateFrom <= model.DateSearch && s.DateTo >= model.DateSearch) || (s.DateFrom <= model.DateSearch && s.DateTo == null)).ToList();

            if (result.Count > 0)
            {
                var profileServices = new Hre_ProfileServices();
                var listResult = profileServices.getHDTJobByPrice(result, model.DateFrom, model.DateTo).Translate<Hre_ReportDetailProfileHDTJobModel>();
                return Json(listResult.ToDataSourceResult(request));
            }
            if (model != null && model.IsCreateTemplate)
            {
                var path = Common.GetPath("Templates");
                ExportService exportService = new ExportService();
                ConfigExport cfgExport = new ConfigExport()
                {
                    Object = new Hre_ReportDetailProfileHDTJobModel(),
                    FileName = "Hre_ReportDetailProfileHDTJob",
                    OutPutPath = path,
                    HeaderInfo = listHeaderInfo,
                    DownloadPath = Hrm_Main_Web + "Templates",
                    IsDataTable = false
                };
                var str = exportService.CreateTemplate(cfgExport);
                return Json(str);
            }

            if (model.ExportID != Guid.Empty)
            {
                var fullPath = ExportService.Export(model.ExportID, result, listHeaderInfo, model.ExportType);

                return Json(fullPath);
            }
            return Json(result.ToDataSourceResult(request));
        }
开发者ID:dtafe,项目名称:vnr,代码行数:66,代码来源:Hre_GetDataController.cs


注:本文中的HRM.Business.Hr.Domain.Hre_ProfileServices.getHDTJobByPrice方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。