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


C# Hre_ProfileServices.IsNotUseExpiryContractLoop方法代码示例

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


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

示例1: GetExpiryContract

        public ActionResult GetExpiryContract([DataSourceRequest] DataSourceRequest request, Hre_ReportExpiryContractModel Model)
        {
            string status = string.Empty;
            var service = new Hre_ReportServices();
            var actionServices = new ActionService(UserLogin);
            var profileServices = new Hre_ProfileServices();
            var contractServices = new Hre_ContractServices();
            BaseService baseServices = new BaseService();
            bool isshowloopcontract = profileServices.IsNotUseExpiryContractLoop();

            var ShowAfterDate1 = actionServices.GetData<Sys_AllSettingEntity>("HRM_HRE_CONTRACT_ALERT_EXPRIDAY_VALUEAFTE", ConstantSql.hrm_sys_sp_get_AllSettingByKey, ref status).FirstOrDefault();
            var ShowBeforDate1 = actionServices.GetData<Sys_AllSettingEntity>("HRM_HRE_CONTRACT_ALERT_EXPRIDAY_VALUEBEFOR", ConstantSql.hrm_sys_sp_get_AllSettingByKey, ref status).FirstOrDefault();
            DateTime? dateTo = null;
            DateTime? dateFrom = null;
            if (isshowloopcontract == false)
            {
                dateTo = DateTime.Now.AddDays(Convert.ToDouble(ShowAfterDate1.Value1));
                dateFrom = DateTime.Now.AddDays(-Convert.ToDouble(ShowBeforDate1.Value1));
            }
            var isDataTable = false;
            object obj = new Hre_ReportExpiryContractModel();
         
            //var lstProfile = new List<Hre_ProfileEntity>();
            var objProfile = new List<object>();
            objProfile.AddRange(new object[2]);
            objProfile[0] = 1;
            objProfile[1] = int.MaxValue - 1;
            var lstProfile = actionServices.GetData<Hre_ProfileEntity>(objProfile, ConstantSql.hrm_hr_sp_get_ProfileDataAll, ref status).ToList();

            var lstObjContractType = new List<object>();
            lstObjContractType.Add(null);
            lstObjContractType.Add(null);
            lstObjContractType.Add(null);
            lstObjContractType.Add(null);
            lstObjContractType.Add(1);
            lstObjContractType.Add(int.MaxValue - 1);

            var lstContractType = actionServices.GetData<CatContractTypeModel>(lstObjContractType, ConstantSql.hrm_cat_sp_get_ContractType, ref status).ToList();

            List<object> listObj = new List<object>();
            listObj.Add(Model.OrgStructureID);
            listObj.Add(Model.Status);
            listObj.Add(dateFrom);
            listObj.Add(dateTo);
            listObj.Add(Model.CodeEmp);
            listObj.Add(Model.ProfileName);
            listObj.Add(Model.IDNo);
            listObj.Add(Model.WorkPlaceID);
            listObj.Add(Model.DateSignedFrom);
            listObj.Add(Model.DateSignedTo);
            listObj.Add(Model.ContractNo);
            listObj.Add(1);
            listObj.Add(int.MaxValue - 1);

            var result = actionServices.GetData<Hre_ReportExpiryContractEntity>(listObj, ConstantSql.hrm_hr_sp_get_RptExpireContract, ref status).Where(s => s.StatusEvaluation != WorkdayStatus.E_APPROVED.ToString()).ToList().Translate<Hre_ReportExpiryContractModel>();

           var objContract = new List<object>();
            objContract.AddRange(new object[21]);
            objContract[19] = 1;
            objContract[20] = int.MaxValue - 1;
            var lstContracts = actionServices.GetData<Hre_ContractEntity>(objContract, ConstantSql.hrm_hr_sp_get_Contract, ref status).ToList();
           
            Guid[] _RankDetailForNextContract = null;
            if (!string.IsNullOrEmpty(Model.RankDetailForNextContractIds))
            {
                _RankDetailForNextContract = Model.RankDetailForNextContractIds.Split(',').Select(s => Guid.Parse(s)).ToArray();
            }
            if (Model.ContractTypeID != null)
            {
                result = result.Where(s => s.ContractTypeID == Model.ContractTypeID).ToList();
            }
            if (!string.IsNullOrEmpty(Model.Status))
            {
                result = result.Where(s => s.Status == Model.Status).ToList();
            }

            var lstModel = new List<Hre_ReportExpiryContractModel>();


            if (_RankDetailForNextContract != null)
            {
                result = result.Where(s => _RankDetailForNextContract.Contains(s.RankDetailForNextContract != null ? s.RankDetailForNextContract.Value : Guid.Empty)).ToList();
            }

            if (Model.EvaType == EnumDropDown.EvaExpiryContract.E_EVA_CONTRACT.ToString())
            {
                result = result.Where(s => s.StatusEvaluation != WorkdayStatus.E_APPROVED.ToString() && s.ContractResult != null).ToList();
                if (isshowloopcontract == false)
                {
                    var model = new Hre_ReportExpiryContractModel();
                    foreach (var item in result)
                    {
                        var ContractByProfileID = lstContracts.Where(s => s.ProfileID == item.ProfileID).OrderByDescending(s => s.DateCreate).FirstOrDefault();
                        if (ContractByProfileID != null)
                        {
                            if (ContractByProfileID.DateCreate != null && ContractByProfileID.DateCreate.Value.ToShortDateString() != DateTime.Now.ToShortDateString())
                            {
                                if (item.DateExtend != null && item.DateExtend >= dateFrom && item.DateExtend <= dateTo)
                                {
                                    model = item;
//.........这里部分代码省略.........
开发者ID:dtafe,项目名称:vnr,代码行数:101,代码来源:Hre_GetDataController.cs


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