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


C# Hre_ProfileServices.IsGroupByOrgProfileQuit方法代码示例

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


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

示例1: GetProfileQuitList

        public ActionResult GetProfileQuitList([DataSourceRequest] DataSourceRequest request, Hre_ProfileQuitSearchModel model)
        {
            var profileServices = new Hre_ProfileServices();
            var service = new ActionService(UserLogin);
            bool isGroup = profileServices.IsGroupByOrgProfileQuit();

            if (isGroup == true)
            {
                #region Group theo DS phòng ban - DDF
                var rptServices = new Hre_ReportServices();
                string status = string.Empty;

                var orgServices = new Cat_OrgStructureServices();
                var lstObjOrg = new List<object>();
                lstObjOrg.Add(null);
                lstObjOrg.Add(null);
                lstObjOrg.Add(null);
                lstObjOrg.Add(1);
                lstObjOrg.Add(int.MaxValue - 1);
                var lstOrg = service.GetData<Cat_OrgStructureEntity>(lstObjOrg, ConstantSql.hrm_cat_sp_get_OrgStructure, ref status).ToList();

                var orgTypeService = new Cat_OrgStructureTypeServices();
                var lstObjOrgType = new List<object>();
                lstObjOrgType.Add(null);
                lstObjOrgType.Add(null);
                lstObjOrgType.Add(1);
                lstObjOrgType.Add(int.MaxValue - 1);
                var lstOrgType = service.GetData<Cat_OrgStructureTypeEntity>(lstObjOrgType, ConstantSql.hrm_cat_sp_get_OrgStructureType, ref status).ToList();

                ListQueryModel lstModel = new ListQueryModel
                {
                    PageIndex = request.Page,
                    PageSize = request.PageSize,
                    Filters = ExtractFilterAttributes(request),
                    Sorts = ExtractSortAttributes(request),
                    AdvanceFilters = ExtractAdvanceFilterAttributes(model)
                };
                var lstEntity = service.GetData<Hre_ProfileEntity>(lstModel, ConstantSql.hrm_hr_sp_get_ProfileQuit, ref status);
                var lstProfileEntity = new List<Hre_ProfileEntity>();
                var lstProfileModel = new List<Hre_ProfileModel>();

                if (lstEntity != null)
                {
                    request.Page = 1;
                    foreach (var item in lstEntity)
                    {
                        var profileEntity = new Hre_ProfileEntity();
                        var orgName = new List<string>();
                        if (item.OrgStructureID != null)
                        {
                            orgName = rptServices.GetParentOrgName(lstOrg, lstOrgType, item.OrgStructureID);
                        }
                        // orgName = rptServices.GetParentOrgName(lstOrg, lstOrgType, item.OrgStructureID);
                        if (orgName.Count == 0)
                            continue;
                        if (orgName.Count < 3)
                        {
                            orgName.Insert(0, string.Empty);
                            if (orgName.Count < 3)
                            {
                                orgName.Insert(0, string.Empty);
                            }
                        }
                        profileEntity = item.CopyData<Hre_ProfileEntity>();
                        profileEntity.Channel = orgName[2];
                        profileEntity.Region = orgName[1];
                        profileEntity.Area = orgName[0];
                        lstProfileEntity.Add(profileEntity);
                    }
                    lstProfileModel = lstProfileEntity.Translate<Hre_ProfileModel>();
                    var dataSourceResult = lstProfileModel.ToDataSourceResult(request);
                    if (lstProfileModel.FirstOrDefault().GetPropertyValue("TotalRow") != null)
                    {
                        dataSourceResult.Total = lstProfileModel.Count() <= 0 ? 0 : (int)lstProfileModel.FirstOrDefault().GetPropertyValue("TotalRow");
                    }

                    return Json(dataSourceResult, JsonRequestBehavior.AllowGet);
                }
                #endregion
            }
            return GetListDataAndReturn<Hre_ProfileModel, Hre_ProfileEntity, Hre_ProfileQuitSearchModel>(request, model, ConstantSql.hrm_hr_sp_get_ProfileQuit);

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

示例2: ExportProfileListByTemplate

        public ActionResult ExportProfileListByTemplate([DataSourceRequest] DataSourceRequest request, Hre_ProfileActiveSearchModel model)
        {
            //if(model.ExportId == Guid.Empty)
            //{
            //    return null;
            //}
            var actionService = new ActionService(UserLogin);
            string status = string.Empty;
            var profileServices = new Hre_ProfileServices();

            bool isGroup = profileServices.IsGroupByOrgProfileQuit();
            var isDataTable = false;
            object obj = new Hre_ProfileModel();
            var result = GetListData<Hre_ProfileModel, Hre_ProfileEntity, Hre_ProfileActiveSearchModel>(request, model, ConstantSql.hrm_hr_sp_get_ProfileActive, ref status);

            if (isGroup == true)
            {
                var rptServices = new Hre_ReportServices();
                var orgServices = new Cat_OrgStructureServices();
                var lstObjOrg = new List<object>();
                lstObjOrg.Add(null);
                lstObjOrg.Add(null);
                lstObjOrg.Add(null);
                lstObjOrg.Add(1);
                lstObjOrg.Add(int.MaxValue - 1);
                var lstOrg = actionService.GetData<Cat_OrgStructureEntity>(lstObjOrg, ConstantSql.hrm_cat_sp_get_OrgStructure, ref status).ToList();

                var orgTypeService = new Cat_OrgStructureTypeServices();
                var lstObjOrgType = new List<object>();
                lstObjOrgType.Add(null);
                lstObjOrgType.Add(null);
                lstObjOrgType.Add(1);
                lstObjOrgType.Add(int.MaxValue - 1);
                var lstOrgType = actionService.GetData<Cat_OrgStructureTypeEntity>(lstObjOrgType, ConstantSql.hrm_cat_sp_get_OrgStructureType, ref status).ToList();

                result = GetListData<Hre_ProfileModel, Hre_ProfileEntity, Hre_ProfileActiveSearchModel>(request, model, ConstantSql.hrm_hr_sp_get_ProfileActive, ref status);
                DataTable table = new DataTable("Hre_ProfileModel");
                table.Columns.Add("CodeEmp");
                table.Columns.Add("ProfileName");
                table.Columns.Add("FirstName");
                table.Columns.Add("NameFamily");
                table.Columns.Add("Channel");
                table.Columns.Add("Region");
                table.Columns.Add("Area");
                table.Columns.Add("IDNo");
                table.Columns.Add("IDDateOfIssue", typeof(DateTime));
                table.Columns.Add("IDPlaceOfIssue");
                table.Columns.Add("DateOfBirth", typeof(DateTime));
                table.Columns.Add("PlaceOfBirth");
                table.Columns.Add("Gender");
                table.Columns.Add("MarriageStatus");
                table.Columns.Add("NationalityName");
                table.Columns.Add("ReligionName");
                table.Columns.Add("EthnicGroupName");
                table.Columns.Add("Email");
                table.Columns.Add("CellPhone");
                table.Columns.Add("CodeTax");
                table.Columns.Add("TDistrictName");
                table.Columns.Add("PDistrictName");
                table.Columns.Add("JobTitleName");
                table.Columns.Add("DateHire", typeof(DateTime));
                table.Columns.Add("ContractNo");
                table.Columns.Add("DateStartContract");
                table.Columns.Add("DateEndContract");
                table.Columns.Add("ContractTypeName");
                table.Columns.Add("TimesOfContract");
                table.Columns.Add("Notes");
                table.Columns.Add("TAddress");
                table.Columns.Add("PAddress");
                table.Columns.Add("BasicSalary", typeof(double));

                var salaryServices = new Sal_BasicSalaryServices();
                var objSalary = new List<object>();
                objSalary.AddRange(new object[10]);
                objSalary[8] = 1;
                objSalary[9] = int.MaxValue - 1;
                var lstBasicSalary = actionService.GetData<Sal_BasicSalaryEntity>(objSalary, ConstantSql.hrm_sal_sp_get_BasicPayroll, ref status).ToList();

                var unuServices = new Sal_UnusualAllowanceServices();
                var objUnu = new List<object>();
                objUnu.AddRange(new object[9]);
                objUnu[7] = 1;
                objUnu[8] = int.MaxValue - 1;
                var lstUnu = actionService.GetData<Sal_UnusualAllowanceEntity>(objUnu, ConstantSql.hrm_sal_sp_get_UnusualED, ref status).ToList();

                foreach (var item in result)
                {
                    var basicSalaryEntity = lstBasicSalary.Where(s => s.ProfileID == item.ID).OrderByDescending(s => s.DateUpdate).FirstOrDefault();
                    var lstUnuByProfileID = lstUnu.Where(s => s.ProfileID == item.ID).ToList();
                    var orgName = new List<string>();
                    if (item.OrgStructureID != null)
                    {
                        orgName = rptServices.GetParentOrgName(lstOrg, lstOrgType, item.OrgStructureID);
                        if (orgName.Count < 3)
                        {
                            orgName.Insert(0, string.Empty);
                            if (orgName.Count < 3)
                            {
                                orgName.Insert(0, string.Empty);
                            }
//.........这里部分代码省略.........
开发者ID:dtafe,项目名称:vnr,代码行数:101,代码来源:Hre_GetDataController.cs

示例3: GetReportWorkHistoryDept

        public ActionResult GetReportWorkHistoryDept([DataSourceRequest] DataSourceRequest request, Hre_ReportWorkHistoryDeptModel Model)
        {
            #region Validate
            string message = string.Empty;
            var checkValidate = ValidatorService.OnValidateData<Hre_ReportWorkHistoryDeptModel>(Model, "Hre_ReportWorkHistoryDept", ref message);
            if (!checkValidate)
            {
                return Json(message);
            }

            #endregion

            var actionServices = new ActionService(UserLogin);
            var profileServices = new Hre_ProfileServices();
            var rptServices = new Hre_ReportServices();
            List<object> listObj = new List<object>();
            listObj.Add(Model.DateFrom);
            listObj.Add(Model.DateTo);
            listObj.Add(Model.ProfileName);
            listObj.Add(Model.CodeEmp);
            listObj.Add(Model.JobTitleID);
            listObj.Add(Model.PositionID);
            listObj.Add(Model.OrgStructureIDs);
            listObj.Add(Model.TypeOfTransferID);
            listObj.Add(Model.SalaryClassID);
            listObj.Add(Model.WorkPlaceID);
            listObj.Add(Model.Status);
            listObj.Add(1);
            listObj.Add(int.MaxValue - 1);
            string status = string.Empty;
            var result = actionServices.GetData<Hre_ReportWorkHistoryDeptEntity>(listObj, ConstantSql.hrm_hr_sp_get_RptWorkHistoryDept, ref status).ToList().Translate<Hre_ReportWorkHistoryDeptModel>();
            HeaderInfo headerInfo1 = new HeaderInfo() { Name = "DateFrom", Value = Model.DateFrom != null ? Model.DateFrom : DateTime.Now };
            HeaderInfo headerInfo2 = new HeaderInfo() { Name = "DateTo", Value = Model.DateTo != null ? Model.DateTo : DateTime.Now };
            HeaderInfo headerInfo3 = new HeaderInfo() { Name = "WorkPlaceName", Value = ((result != null && result.FirstOrDefault() != null) && result.FirstOrDefault().WorkPlaceName != null) ? result.FirstOrDefault().WorkPlaceName : "" };
            List<HeaderInfo> listHeaderInfo = new List<HeaderInfo>() { headerInfo1, headerInfo2, headerInfo3 };
            if (Model != null && Model.IsCreateTemplate)
            {
                var path = Common.GetPath("Templates");
                ExportService exportService = new ExportService();

                ConfigExport cfgExport = new ConfigExport()
                {
                    Object = new Hre_ReportWorkHistoryDeptModel(),
                    FileName = "Hre_ReportWorkHistoryDept",
                    OutPutPath = path,
                    HeaderInfo = listHeaderInfo,
                    DownloadPath = Hrm_Main_Web + "Templates",
                    IsDataTable = false
                };
                var str = exportService.CreateTemplate(cfgExport);
                return Json(str);
            }
            bool isgroup = profileServices.IsGroupByOrgProfileQuit();
            if (isgroup == true)
            {
                List<Hre_ReportWorkHistoryDeptModel> resultNew = new List<Hre_ReportWorkHistoryDeptModel>();
                if (result.Count > 0)
                {
                    var orgServices = new Cat_OrgStructureServices();
                    var lstObjOrg = new List<object>();
                    lstObjOrg.Add(null);
                    lstObjOrg.Add(null);
                    lstObjOrg.Add(null);
                    lstObjOrg.Add(1);
                    lstObjOrg.Add(int.MaxValue - 1);
                    var lstOrg = actionServices.GetData<Cat_OrgStructureEntity>(lstObjOrg, ConstantSql.hrm_cat_sp_get_OrgStructure, ref status).ToList();

                    var orgTypeService = new Cat_OrgStructureTypeServices();
                    var lstObjOrgType = new List<object>();
                    lstObjOrgType.Add(null);
                    lstObjOrgType.Add(null);
                    lstObjOrgType.Add(1);
                    lstObjOrgType.Add(int.MaxValue - 1);
                    var lstOrgType = actionServices.GetData<Cat_OrgStructureTypeEntity>(lstObjOrgType, ConstantSql.hrm_cat_sp_get_OrgStructureType, ref status).ToList();

                    foreach (var item in result)
                    {
                        var orgName = new List<string>();
                        if (item.OrgStructureID != null)
                        {
                            orgName = rptServices.GetParentOrgName(lstOrg, lstOrgType, item.OrgStructureID);
                            if (orgName.Count < 3)
                            {
                                orgName.Insert(0, string.Empty);
                                if (orgName.Count < 3)
                                {
                                    orgName.Insert(0, string.Empty);
                                }
                            }
                        }
                        if (orgName.Count > 0)
                        {
                            item.Channel = orgName[2];
                            item.Region = orgName[1];
                            item.Area = orgName[0];
                        }
                        resultNew.Add(item);
                    }
                }
                if (Model.ExportID != Guid.Empty)
//.........这里部分代码省略.........
开发者ID:dtafe,项目名称:vnr,代码行数:101,代码来源:Hre_GetDataController.cs

示例4: RefreshData

        /// <summary>
        /// BC bảng lương
        /// <param name="dateStartCutOffDuration">Ngày bắt đầu của kỳ lương</param>
        /// <param name="monthYear">Tháng</param>
        /// <param name="listOrgIDs">Ds phòng ban</param>
        /// <param name="listPrGroupIDs">Ds nhóm Lương</param>
        /// <param name="isIncludeQuitEmp">Bao gồm NV nghỉ việc</param>
        /// </sumary>  
        public DataTable RefreshData(DateTime dateStartCutOffDuration, DateTime dateEndCutOffDuration, DateTime monthYear, List<Hre_ProfileEntity> listProfile, Guid? gradePayrollID, Boolean isIncludeQuitEmp, string codeEmp, string orderNumber, string Transfer, Guid[] workingPlaceID, Guid[] costcenterIds, string UserLogin)
        {
            try
            {
                using (var context = new VnrHrmDataContext())
                {


                    #region " Load dữ liệu"
                    string status = string.Empty;
                    var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));

                    //kỳ lương (hiện tại mặc định đầu tháng -> cuối tháng)
                    DateTime from = new DateTime(monthYear.Year, monthYear.Month, 1);
                    DateTime to = new DateTime(monthYear.Year, monthYear.Month, DateTime.DaysInMonth(monthYear.Year, monthYear.Month));

                    //Ds tất cả phòng ban
                    var orgServices = new Cat_OrgStructureServices();
                    var lstObjOrg = new List<object>();
                    //  var reposOrgStructure = new CustomBaseRepository<Cat_OrgStructure>(unitOfWork);
                    var listOrgAll = orgServices.GetDataNotParam<Cat_OrgStructure>(ConstantSql.hrm_cat_sp_get_AllOrg, UserLogin, ref status).ToList();

                    var lstObjOrgNumber = new List<object>();
                    lstObjOrgNumber.Add(orderNumber);
                    var lstOrgID = orgServices.GetData<Cat_OrgStructureEntity>(lstObjOrgNumber, ConstantSql.hrm_cat_sp_get_OrgStructureByOrderNumber, UserLogin, ref status).Select(s => s.ID).ToList();


                    //Ds cửa Hàng
                    var shopServices = new Cat_ShopServices();
                    var lstObjShop = new List<object>();
                    lstObjShop.Add(null);
                    lstObjShop.Add(null);
                    lstObjShop.Add(null);
                    lstObjShop.Add(1);
                    lstObjShop.Add(int.MaxValue - 1);
                    var lstShop = shopServices.GetData<Cat_ShopEntity>(lstObjShop, ConstantSql.hrm_cat_sp_get_Shop, UserLogin, ref status).ToList();

                    //Ds tất cả loại PB
                    var orgTypeServices = new Cat_OrgStructureTypeServices();
                    var lstObjOrgType = new List<object>();
                    lstObjOrgType.Add(string.Empty);
                    lstObjOrgType.Add(string.Empty);
                    lstObjOrgType.Add(1);
                    lstObjOrgType.Add(int.MaxValue - 1);
                    var listOrgType = orgTypeServices.GetData<Cat_OrgStructureType>(lstObjOrgType, ConstantSql.hrm_cat_sp_get_OrgStructureType, UserLogin, ref status).ToList();

                    //Ds nhân viên
                    var reposProfile = new CustomBaseRepository<Hre_Profile>(unitOfWork);
                    var profileServices = new Hre_ProfileServices();
                    var lstObjProfile = new List<object>();
                    lstObjProfile.AddRange(new object[17]);
                    lstObjProfile[15] = 1;
                    lstObjProfile[16] = int.MaxValue - 1;

                    var lstModel = new List<object>();
                    lstModel.AddRange(new object[10]);
                    //lstModel[4] = CutOffDuration.DateStart;
                    //lstModel[5] = CutOffDuration.DateEnd;
                    lstModel[8] = 1;
                    lstModel[9] = Int32.MaxValue - 1;
                    List<Sal_HoldSalaryEntity> listHoldSalary = orgTypeServices.GetData<Sal_HoldSalaryEntity>(lstModel, ConstantSql.hrm_sal_sp_get_HoldSalary, UserLogin, ref status).Where(m => m.MonthSalary <= dateEndCutOffDuration && (m.MonthEndSalary == null || m.MonthEndSalary >= dateStartCutOffDuration)).ToList();
                    //bỏ những nhân viên đang bị hold lương
                    listProfile = listProfile.Where(m => !listHoldSalary.Any(t => t.ProfileID == m.ID)).ToList();

                    bool isGroup = profileServices.IsGroupByOrgProfileQuit();

                    //lọc theo nhóm lương
                    List<Guid> listProfileID = listProfile.Select(s => s.ID).Distinct().ToList();

                    //lọc nhân viên nghỉ việc
                    if (!isIncludeQuitEmp)
                    {
                        listProfile = listProfile.Where(pro => pro.DateQuit == null || pro.DateQuit > from).ToList();
                    }

                    if (workingPlaceID != null)
                    {
                        listProfile = listProfile.Where(pro => pro.WorkPlaceID != null && workingPlaceID.Contains(pro.WorkPlaceID.Value)).ToList();
                    }

                    if (costcenterIds != null)
                    {
                        listProfile = listProfile.Where(pro => pro.CostCentreID != null && costcenterIds.Contains(pro.CostCentreID.Value)).ToList();

                    }

                    //lọc theo tên nhân viên
                    if (!string.IsNullOrEmpty(codeEmp))
                    {
                        listProfile = listProfile.Where(s => s.CodeEmp != null && s.CodeEmp.Contains(codeEmp)).ToList();
                    }

//.........这里部分代码省略.........
开发者ID:dtafe,项目名称:vnr,代码行数:101,代码来源:Sal_ReportService.cs


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