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


C# Hre_ProfileServices.GetProfileNameAll方法代码示例

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


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

示例1: GetReportClass

 public DataTable GetReportClass(List<Tra_ClassEntity> lstClass, Guid? _classID, bool isCreateTemplate)
 {
     using (var context = new VnrHrmDataContext())
     {
         string status = string.Empty;
         var unitOfWork = (UnitOfWork)(new UnitOfWork(context));
         DataTable table = CreateReportClassScheme();
         if (isCreateTemplate)
             return table;
         if (lstClass == null)
             return table;
         if (_classID != null)
             lstClass = lstClass.Where(s => s.ID == _classID).ToList();
         if (lstClass.Count == 0)
             return table;
         List<object> paraProfile = new List<object>();
         paraProfile.AddRange(new object[17]);
         paraProfile[15] = 1;
         paraProfile[16] = int.MaxValue - 1;
         var hreServiceProfile = new Hre_ProfileServices();
         //var lstProfile = hreServiceProfile.GetData<Hre_ProfileEntity>(paraProfile, ConstantSql.hrm_hr_sp_get_ProfileAll, ref status);
         var lstProfile = hreServiceProfile.GetProfileNameAll();
         foreach (var item in lstClass)
         {
             string _teacher = string.Empty;
             if (item.TrainerOtherList != null)
             {
                 string[] arrCodeEmps = item.TrainerOtherList.ToString().Split(',');
                 for (int i = 0; i < arrCodeEmps.Length; i++)
                 {
                     var objprofile = lstProfile.Where(s => s.CodeEmp == arrCodeEmps[i]).FirstOrDefault();
                     if (objprofile != null && objprofile.ProfileName != null)
                         _teacher += objprofile.ProfileName + ", ";
                 }
                 _teacher = _teacher.Substring(0, _teacher.Length - 2);
             }
             DataRow row = table.NewRow();
             if (item.Code != null)
                 row[Tra_ReportClassEntity.FieldNames.Code] = item.Code;
             if (item.ClassName != null)
                 row[Tra_ReportClassEntity.FieldNames.ClassName] = item.ClassName;
             if (item.StartDate != null)
                 row[Tra_ReportClassEntity.FieldNames.StartDate] = item.StartDate;
             if (item.EndDate != null)
                 row[Tra_ReportClassEntity.FieldNames.EndDate] = item.EndDate;
             if (item.ScheduleTimeStart != null)
                 row[Tra_ReportClassEntity.FieldNames.ScheduleTimeStart] = item.ScheduleTimeStart;
             if (item.ScheduleTimeEnd != null)
                 row[Tra_ReportClassEntity.FieldNames.ScheduleTimeEnd] = item.ScheduleTimeEnd;
             if (item.TrainingPlace != null)
                 row[Tra_ReportClassEntity.FieldNames.TrainingPlace] = item.TrainingPlace;
             if (item.TrainerOtherList != null)
                 row[Tra_ReportClassEntity.FieldNames.Teacher] = _teacher;
             table.Rows.Add(row);
         }
         return table.ConfigTable(true);
     }
 }
开发者ID:dtafe,项目名称:vnr,代码行数:58,代码来源:Tra_ReportServices.cs

示例2: GetClassList

        public ActionResult GetClassList([DataSourceRequest] DataSourceRequest request, Tra_ClassSearchModel model)
        {
            var services = new ActionService(UserLogin);
            var traineeServices = new Tra_TraineeServices();
            var objTrainee = new List<object>();
            string status = string.Empty;
            var service = new ActionService(UserLogin);
            Guid[] _RequirementTrainIDs=null;
            if (!string.IsNullOrEmpty(model.RequirementTrainID))
            {
                _RequirementTrainIDs = model.RequirementTrainID.Split(',').Select(s => Guid.Parse(s)).ToArray();
            }
            ListQueryModel lstModel = new ListQueryModel
            {
                PageIndex = request.Page,
                PageSize = request.PageSize,
                Filters = ExtractFilterAttributes(request),
                Sorts = ExtractSortAttributes(request),
                AdvanceFilters = ExtractAdvanceFilterAttributes(model)
            };
            //List<object> paraprofile = new List<object>();
            //paraprofile.AddRange(new object[17]);
            //paraprofile[15] = 1;
            //paraprofile[16] = int.MaxValue - 1;
            //var lstProfile = service.GetData<Hre_ProfileEntity>(paraprofile, ConstantSql.hrm_hr_sp_get_ProfileAll, ref status);

            var hreServiceProfile = new Hre_ProfileServices();
            var lstProfile = hreServiceProfile.GetProfileNameAll();

            var listEntity = service.GetData<Tra_ClassEntity>(lstModel, ConstantSql.hrm_tra_sp_get_Class, ref status);
            
            
            if (_RequirementTrainIDs != null)
            {
                List<object> paraprofile = new List<object>();
                paraprofile.AddRange(new object[7]);
                paraprofile[5] = 1;
                paraprofile[6] = int.MaxValue - 1;
                var ListRequirementTrain = service.GetData<Tra_RequirementTrainEntity>(paraprofile, ConstantSql.hrm_tra_sp_get_RequirementTrain, ref status);
               // var _lstRequirementTrainByPlanID = new List<Guid>();
              //  _lstRequirementTrainByPlanID = ListRequirementTrain.Where(s => s.ID != null && _RequirementTrainIDs.Contains(s.ID)).Select(s => (Guid)s.PlanID).ToList();
                var result = services.GetData<Tra_TraineeEntity>(objTrainee, ConstantSql.hrm_tra_sp_get_Trainee, ref status);
                List<Guid> _RequirementTrainIDs1 = model.RequirementTrainID.Split(',').Select(s => Guid.Parse(s)).ToList();
                result = traineeServices.GetListTrainees(result, _RequirementTrainIDs1);
                //if (listEntity != null)
                //{
                //    listEntity = listEntity.Where(s => s.PlanID != null && _lstRequirementTrainByPlanID.Contains((Guid)s.PlanID)).ToList();
                //}
                return Json(result.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
               
            }
            var listModel = new List<Tra_ClassModel>();
            if (listEntity != null)
            {
                request.Page = 1;
                foreach (var item in listEntity)
                {
                    if (item.TrainerOtherList != null)
                    {
                        string _strTrainerOtherList = item.TrainerOtherList.Replace(" ", "");
                        string[] lstitem = _strTrainerOtherList.Split(',').ToArray();
                        if(lstProfile !=null && lstitem!=null)
                        {
                            List<Hre_ProfileEntity> lstitemprofile = lstProfile.Where(s => lstitem.Contains(s.CodeEmp)).ToList();
                            string Stringresult = string.Empty;
                            foreach (var itemstring in lstitemprofile)
                            {
                                Stringresult += itemstring.ProfileName + ", ";
                            }
                            if (!string.IsNullOrEmpty(Stringresult))
                            {
                                Stringresult = Stringresult.Substring(0, Stringresult.Length - 2);
                            }
                           
                            item.TeacherName = Stringresult;
                        }
                    }
                    var newModle = (Tra_ClassModel)typeof(Tra_ClassModel).CreateInstance();
                    foreach (var property in item.GetType().GetProperties())
                    {
                        newModle.SetPropertyValue(property.Name, item.GetPropertyValue(property.Name));
                    }
                    listModel.Add(newModle);
                }
                var dataSourceResult = listModel.ToDataSourceResult(request);
                if (listModel.FirstOrDefault().GetPropertyValue("TotalRow") != null)
                {
                    dataSourceResult.Total = listModel.Count() <= 0 ? 0 : (int)listModel.FirstOrDefault().GetPropertyValue("TotalRow");
                }
                return Json(dataSourceResult, JsonRequestBehavior.AllowGet);
            }
            var listModelNull = new List<Tra_ClassModel>();
            ModelState.AddModelError("Id", status);
            return Json(listModelNull.ToDataSourceResult(request, ModelState));

            //return GetListDataAndReturn<Tra_ClassModel, Tra_ClassEntity, Tra_ClassSearchModel>(request, model, ConstantSql.hrm_tra_sp_get_Class);
        }
开发者ID:dtafe,项目名称:vnr,代码行数:97,代码来源:Tra_GetDataController.cs

示例3: ExportClassSelected

 public ActionResult ExportClassSelected(string selectedIds, string valueFields)
 {
     //return ExportSelectedAndReturn<Tra_ClassEntity, Tra_ClassModel>(selectedIds, valueFields, ConstantSql.hrm_tra_sp_get_ClassByIds);
     selectedIds = Common.DotNetToOracle(selectedIds);
     var service = new ActionService(UserLogin);
     var status = string.Empty;
     var listModel = new List<Tra_ClassModel>();
     var listEntity = service.GetData<Tra_ClassEntity>(selectedIds, ConstantSql.hrm_tra_sp_get_ClassByIds, ref status);
     if (listEntity != null && status == NotificationType.Success.ToString())
     {
         var hreServiceProfile = new Hre_ProfileServices();
         var lstProfile = hreServiceProfile.GetProfileNameAll();
         foreach (var item in listEntity)
         {
             if (item.TrainerOtherList != null)
             {
                 string[] lstitem = item.TrainerOtherList.Split(',').ToArray();
                 if (lstProfile != null && lstitem != null)
                 {
                     List<Hre_ProfileEntity> lstitemprofile = lstProfile.Where(s => lstitem.Contains(s.CodeEmp)).ToList();
                     string Stringresult = string.Empty;
                     foreach (var itemstring in lstitemprofile)
                     {
                         Stringresult += itemstring.ProfileName + ',';
                     }
                     Stringresult = Stringresult.Substring(0, Stringresult.Length - 1);
                     item.TeacherName = Stringresult;
                 }
             }
             var newModle = (Tra_ClassModel)typeof(Tra_ClassModel).CreateInstance();
             foreach (var property in item.GetType().GetProperties())
             {
                 newModle.SetPropertyValue(property.Name, item.GetPropertyValue(property.Name));
             }
             listModel.Add(newModle);
         }
     //    listModel = listEntity.Translate<Tra_ClassModel>();
         Guid _templateID = Guid.Empty;
         status = ExportService.Export(_templateID, listModel, valueFields.Split(','), null);
     }
     return Json(status);
 }
开发者ID:dtafe,项目名称:vnr,代码行数:42,代码来源:Tra_GetDataController.cs

示例4: ExportTraineeListByTemplate

        public ActionResult ExportTraineeListByTemplate([DataSourceRequest] DataSourceRequest request, Tra_TraineeSearchModel1 model)
        {

            string status = string.Empty;
            var isDataTable = false;
            object obj = new Tra_TraineeModel();
            request.Page = 1;
            request.PageSize = int.MaxValue - 1;
            var result = GetListData<Tra_TraineeModel, Tra_TraineeEntity, Tra_TraineeSearchModel1>(request, model, ConstantSql.hrm_tra_sp_get_Trainee, ref status);
            //Guid[] classID = null;
            //if (!string.IsNullOrEmpty(model.ClassID.Value))
            //{
            //    classID = model.ClassID.Split(',').Select(s => Guid.Parse(s)).ToArray();
            //    if (classID != null)
            //    {
            //        result = result.Where(s => classID.Contains(s.ClassID)).ToList();
            //    }
            //}
            //Guid[] courseID = null;
            //if (!string.IsNullOrEmpty(model.CourseID.Value))
            //{
            //    courseID = model.CourseID.Split(',').Select(s => Guid.Parse(s)).ToArray();
            //    if (courseID != null)
            //    {
            //        result = result.Where(s => courseID.Contains(s.CourseID)).ToList();
            //    }
            //}
            //Guid[] RequirementTrainIDs = null;
            //if (!string.IsNullOrEmpty(model.RequirementTrainID))
            //{
            //    RequirementTrainIDs = model.RequirementTrainID.Split(',').Select(s => Guid.Parse(s)).ToArray();
            //    result = result.Where(s => s.RequirementTrainID != null && RequirementTrainIDs.Contains((Guid)s.RequirementTrainID)).ToList();
            //}
            var listModel = new List<Tra_TraineeModel>();
            var hreServiceProfile = new Hre_ProfileServices();
            var lstProfile = hreServiceProfile.GetProfileNameAll();
            foreach (var item in result)
            {
                if (item.TrainerOtherList != null)
                {
                    string _strTrainerOtherList = item.TrainerOtherList.Replace(" ", "");
                    string[] lstitem = _strTrainerOtherList.Split(',').ToArray();
                    if (lstProfile != null && lstitem != null)
                    {
                        List<Hre_ProfileEntity> lstitemprofile = lstProfile.Where(s => lstitem.Contains(s.CodeEmp)).ToList();
                        string Stringresult = string.Empty;
                        foreach (var itemstring in lstitemprofile)
                        {
                            Stringresult += itemstring.ProfileName + ", ";
                        }
                        if (!string.IsNullOrEmpty(Stringresult))
                        {
                            Stringresult = Stringresult.Substring(0, Stringresult.Length - 2);
                        }
                        item.TeacherName = Stringresult;
                    }
                }
                var newModle = (Tra_TraineeModel)typeof(Tra_TraineeModel).CreateInstance();
                foreach (var property in item.GetType().GetProperties())
                {
                    newModle.SetPropertyValue(property.Name, item.GetPropertyValue(property.Name));
                }
                
                listModel.Add(newModle);
            }
            if (model != null && model.IsCreateTemplate)
            {
                var path = Common.GetPath("Templates");
                ExportService exportService = new ExportService();
                ConfigExport cfgExport = new ConfigExport()
                {
                    Object = new Tra_TraineeModel(),
                    FileName = "Tra_Trainee",
                    OutPutPath = path,
                    DownloadPath = Hrm_Main_Web + "Templates",
                    IsDataTable = isDataTable
                };
                var str = exportService.CreateTemplate(cfgExport);
                return Json(str);
            }

            if (model.ExportId != Guid.Empty)
            {
                var fullPath = ExportService.Export(model.ExportId, listModel, null, model.ExportType);
                return Json(fullPath);
            }

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


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