• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Entity.VnrHrmDataContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中HRM.Data.Entity.VnrHrmDataContext的典型用法代码示例。如果您正苦于以下问题:C# VnrHrmDataContext类的具体用法?C# VnrHrmDataContext怎么用?C# VnrHrmDataContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VnrHrmDataContext类属于HRM.Data.Entity命名空间,在下文中一共展示了VnrHrmDataContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DeleteConditionInGroupCondition

        public string DeleteConditionInGroupCondition(Guid GroupConditionID, string ConditionIDs)
        {
            using (var context = new VnrHrmDataContext())
            {
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                var repo = new Rec_GroupConditionRepository(unitOfWork);
                var ilConditionIDs = ConditionIDs.Split(',');
                List<Guid> lsConditionIDs = new List<Guid>();
                lsConditionIDs = ConditionIDs.Split(',').Select(x => Guid.Parse(x)).ToList();

                Rec_GroupCondition GroupCondition = repo.GetById(GroupConditionID);
                if (GroupCondition == null)
                    return null;
                List<Guid> lstCondition = new List<Guid>();
                lstCondition = GroupCondition.JobConditionIDs.Split(',').Select(x => Guid.Parse(x)).ToList();
                if (lstCondition != null && lstCondition.Count != 0)
                {
                    lstCondition = lstCondition.Where(x => !lsConditionIDs.Contains(x)).ToList();
                    GroupCondition.JobConditionIDs = string.Join(",", lstCondition);
                    repo.SaveChanges();
                    return GroupCondition.JobConditionIDs;
                }
            }
            return null;
        }
开发者ID:dtafe,项目名称:vnr,代码行数:25,代码来源:Rec_GroupConditionServices.cs


示例2: Approved

        /// <summary>
        /// Lay DS luong hieu luc cua toan cong ty. Moi nhan vien chi co 1 muc luong trong danh sach.
        /// </summary>
        /// <param name="lstSalaryAll">get all Salary</param>
        /// <param name="monthEffect"></param>
        /// <returns></returns>


        public void Approved(List<Guid> selectedIds, string status, string userLoginName)
        {
            using (var context = new VnrHrmDataContext())
            {
                string statusMessage = string.Empty;
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                var repoProfile = new Hre_ProfileRepository(unitOfWork);
                var repoHoldSalary = new Sal_HoldSalaryRepository(unitOfWork);
                var lstHoldSalary = repoHoldSalary.FindBy(s => selectedIds.Contains(s.ID)).ToList();
                var lstProfileIDs = lstHoldSalary.Select(s => s.ProfileID).ToList();
                var profileServices = new Hre_ProfileServices();
                var objProfile = new List<object>();
                objProfile.AddRange(new object[17]);
                objProfile[15] = 1;
                objProfile[16] = int.MaxValue - 1;
                var lstProfile = profileServices.GetData<Hre_ProfileEntity>(objProfile, ConstantSql.hrm_hr_sp_get_ProfileAll,userLoginName, ref statusMessage).ToList().Translate<Hre_Profile>();
                //var lstProfiles = repoProfile.FindBy(m => m.ID != null && lstProfileIDs.Contains(m.ID)).ToList();

                foreach (var holdSalary in lstHoldSalary)
                {
                    holdSalary.Status = status;
                    var profileByID = lstProfile.Where(s => s.ID == holdSalary.ProfileID.Value).FirstOrDefault();
                    profileByID.MonthHoldSal = holdSalary.MonthSalary;
                    profileByID.IsHoldSal = true;
                }
                repoHoldSalary.SaveChanges();
                repoProfile.SaveChanges();


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


示例3: DeletePayrollTable

        private bool DeletePayrollTable(List<Guid> listProfileID, Guid cutOffDurationID)
        {
            #region Delete PayrollTable

            try
            {
                using (var context = new VnrHrmDataContext())
                {
                    var unitOfWork = new UnitOfWork(context);
                    int pageSize = 2000;//tối đa là 2100 parameter
                    int result = 0;

                    foreach (var listProfileIDBySize in listProfileID.Chunk(pageSize))
                    {
                        result += unitOfWork.SetIsDelete(context.Sal_PayCommission.Where(m => m.CutoffDurationID != null && m.ProfileID != null && !m.IsDelete.HasValue && (Guid)m.CutoffDurationID == cutOffDurationID && listProfileIDBySize.Contains((Guid)m.ProfileID)));
                    }

                    return true;
                }
            }
            catch (Exception)
            {
                return false;
            }

            #endregion
        }
开发者ID:dtafe,项目名称:vnr,代码行数:27,代码来源:Sal_ComputeCommissionServices.cs


示例4: getAllGrade2

        public static List<Att_Grade> getAllGrade2(List<Guid> listProfileId, DateTime monthYear)
        {
            using (var context = new VnrHrmDataContext())
            {
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                var repoAtt_Grade = new CustomBaseRepository<Att_Grade>(unitOfWork);

                List<Att_Grade> lst = new List<Att_Grade>();
                string[] strInclude = new string[] { "Cat_GradeAttendance" };

                lst = repoAtt_Grade.FindBy(gd => listProfileId.Contains(gd.ProfileID.Value)
                    && gd.MonthStart <= monthYear).OrderByDescending(prop => prop.MonthStart).ToList();

                List<Att_Grade> lstGrade = new List<Att_Grade>();
                foreach (Att_Grade grade in lst)
                {
                    Att_Grade grade1 = lstGrade.FirstOrDefault(prop => prop.ProfileID == grade.ProfileID);
                    if (grade1 == null)
                    {
                        lstGrade.Add(grade);
                    }
                }
                return lstGrade;
            }
        }
开发者ID:dtafe,项目名称:vnr,代码行数:25,代码来源:Att_GradeServices.cs


示例5: AddMasterDataGroupItems

        public Cat_MasterDataGroupItemEntity AddMasterDataGroupItems(Cat_MasterDataGroupItemEntity model)
        {
            using (var context = new VnrHrmDataContext())
            {
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                var repoMasterDataGroupItem = new Cat_MasterDataGroupItemRepository(unitOfWork);
                var lstCat_MasterDataGroupItem = new List<Cat_MasterDataGroupItem>();

                #region Lấy ds MasterDataGroupItem theo MasterDataGroupID
                var masterDataGroupItem_objectIdExists = unitOfWork.CreateQueryable<Cat_MasterDataGroupItem>(Guid.Empty, m => m.MasterDataGroupID == model.MasterDataGroupID).Select(p => p.ObjectID).ToList();
                #endregion

                if (model.ObjectIDs.Any())
                {
                    //không lưu những item co objectId đã tồn tại trong masterDataGroupItem theo masterDataGroupID
                    model.ObjectIDs = model.ObjectIDs.Except(masterDataGroupItem_objectIdExists).ToList();

                    foreach (var objectId in model.ObjectIDs)
                    {
                        var masterDataGroupItem= new  Cat_MasterDataGroupItem();
                        masterDataGroupItem.ID = Guid.NewGuid();
                        masterDataGroupItem.ObjectID = objectId;
                        masterDataGroupItem.ObjectName = model.ObjectName;
                        masterDataGroupItem.MasterDataGroupID = model.MasterDataGroupID;
                        lstCat_MasterDataGroupItem.Add(masterDataGroupItem);//add vao repo
                    }
                    if (lstCat_MasterDataGroupItem.Any())
                    {
                        repoMasterDataGroupItem.Add(lstCat_MasterDataGroupItem);
                        repoMasterDataGroupItem.SaveChanges();    
                    }                    
                }
            }
            return model;
        }
开发者ID:dtafe,项目名称:vnr,代码行数:35,代码来源:Cat_MasterDataGroupServices.cs


示例6: GetReportCodeNotInSystem

        public List<Hre_ReportCodeNotInSystemEntity> GetReportCodeNotInSystem(DateTime? DateFrom, DateTime? DateTo)
        {
            List<Hre_ReportCodeNotInSystemEntity> lstReportCodeNotInSystem = new List<Hre_ReportCodeNotInSystemEntity>();
            using (var context = new VnrHrmDataContext())
            {
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                var repo = new Hre_ProfileRepository(unitOfWork);
                var codeAttendance = repo.FindBy(s => s.IsDelete == null).Select(m => m.CodeAttendance).Distinct().ToList();
                var repoTAMScanLog = new Att_TAMScanLogRepository(unitOfWork);
                var lstCardHistory = repoTAMScanLog.FindBy(m => m.TimeLog >= DateFrom && m.TimeLog <= DateTo && !codeAttendance.Contains(m.CardCode))
                .Select(m => new { m.CardCode, m.TimeLog, m.MachineNo, m.Type, m.SrcType, m.DateCreate, m.UserCreate }).ToList();

                foreach (var CardHistory in lstCardHistory)
                {
                    Hre_ReportCodeNotInSystemEntity codeNotInSystemEntity = new Hre_ReportCodeNotInSystemEntity();
                    codeNotInSystemEntity.Code = CardHistory.CardCode;
                    codeNotInSystemEntity.Type = CardHistory.Type;
                    codeNotInSystemEntity.Time = CardHistory.TimeLog;
                    codeNotInSystemEntity.Machine = CardHistory.MachineNo;
                    codeNotInSystemEntity.UserCreate = CardHistory.UserCreate;
                    codeNotInSystemEntity.DateCreate = CardHistory.DateCreate;
                    lstReportCodeNotInSystem.Add(codeNotInSystemEntity);
                }
                return lstReportCodeNotInSystem;
            }
        }
开发者ID:dtafe,项目名称:vnr,代码行数:26,代码来源:Hre_ReportServices.cs


示例7: GetGrade

        public static Att_Grade GetGrade(Hre_Profile profile, DateTime effectMonth)
        {
            using (var context = new VnrHrmDataContext())
            {
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                var repoAtt_Grade = new CustomBaseRepository<Att_Grade>(unitOfWork);
                //NOTE: can modify lai cau truy van de gioi han data lay len
                List<Att_Grade> lst = repoAtt_Grade
                    .FindBy(alw => alw.IsDelete == null
                        && alw.ProfileID == profile.ID
                        && alw.MonthStart <= effectMonth)
                    .OrderByDescending(alw => alw.MonthStart).ToList();

                if (lst != null && lst.Count > 0)
                {
                    // Lấy grade có ngày đến hạn, nếu không có ngày đến hạn xem như Ok không hết hạn, nếu có ngày đến hạn
                    DateTime temp = new DateTime(effectMonth.Year, effectMonth.Month, 1);
                    if (!lst[0].MonthEnd.HasValue || (lst[0].MonthEnd.HasValue && lst[0].MonthEnd.Value >= temp))
                    {
                        return lst[0];
                    }
                }
                return null;
            }
        }
开发者ID:dtafe,项目名称:vnr,代码行数:25,代码来源:Att_GradeServices.cs


示例8: UpdateRecruitmentCampaignActive

        public bool UpdateRecruitmentCampaignActive(string selectedIds, bool Value)
        {
            using (var context = new VnrHrmDataContext())
            {
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                var repo = new Rec_RecruitmentCampaignRepository(unitOfWork);
                var lstIds = selectedIds.Split(',');
                List<Guid> listID = new List<Guid>();
                for (int i = 0; i < lstIds.Length; i++)
                {
                    try
                    {
                        listID.Add(Guid.Parse(lstIds[i].ToString()));
                    }
                    catch
                    { }
                }
                var listRecruitmentCampaign = repo.FindBy(x => listID.Contains(x.ID)).ToList();
                foreach (var item in listRecruitmentCampaign)
                {
                    item.IsActivate = Value;
                }
                repo.SaveChanges();

            }
            return true;
        }
开发者ID:dtafe,项目名称:vnr,代码行数:27,代码来源:Rec_RecruitmentCampaignServices.cs


示例9: ActionCancel

 public string ActionCancel(string selectedIds, string userLogin)
 {
     using (var context = new VnrHrmDataContext())
     {
         string message = string.Empty;
         var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
         var repo = new Hre_StopWorkingRepository(unitOfWork);
         var profileServices = new Hre_ProfileServices();
         string status = string.Empty;
         List<Guid> lstIds = selectedIds.Split(',').Select(x => Guid.Parse(x)).ToList();
         var lstStopWorkings = repo.FindBy(m => m.ID != null && lstIds.Contains(m.ID)).ToList();
         foreach (var StopWorking in lstStopWorkings)
         {
             var profile = profileServices.GetData<Hre_ProfileEntity>(Common.DotNetToOracle(StopWorking.ProfileID.ToString()), ConstantSql.hrm_hr_sp_get_ProfileById, userLogin, ref status).FirstOrDefault();
             profile.StatusSyn = StopWorking.LastStatusSyn;
             StopWorking.Status = HRM.Infrastructure.Utilities.EnumDropDown.StopWorkStatus.E_CANCEL.ToString();
             profile.StopWorkType = null;
             profile.TypeSuspense = null;
             profile.RequestDate = null;
             profile.DateQuit = null;
             profile.ResReasonID = null;
             profile.IsHoldSal = false;
             profile.ResignNo = null;
             profile.TypeOfStop = null;
             profileServices.Edit(profile);
         }
         repo.SaveChanges();
         message = NotificationType.Success.ToString();
         return message;
     }
 }
开发者ID:dtafe,项目名称:vnr,代码行数:31,代码来源:Hre_StopWorkingServices.cs


示例10: ActionBlackListCandidate

        public string ActionBlackListCandidate(string selectedIds, Guid? _ReasonBlackListID)
        {
            using (var context = new VnrHrmDataContext())
            {
                BaseService service = new BaseService();
                string message = string.Empty;
                string status = string.Empty;
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                var repoCandidate = new Rec_CandidateRepository(unitOfWork);
                var repoHistory = new Rec_RecruitmentHistoryRepository(unitOfWork);
                List<Guid> lstcandidateIds = selectedIds.Split(',').Select(x => Guid.Parse(x)).ToList();
                var lstCandidates = repoCandidate.FindBy(m => m.ID != null && lstcandidateIds.Contains(m.ID)).ToList();

                var lstRecruimentHistory = repoHistory.FindBy(m => m.CandidateID != null && lstcandidateIds.Contains(m.CandidateID)).ToList();

                foreach (var Candidate in lstCandidates)
                {
                    Candidate.IsBlackList = true;
                    Candidate.ReasonBlackListID = _ReasonBlackListID;
                    var hisbycandidate = lstRecruimentHistory.Where(s => s.CandidateID == Candidate.ID).OrderByDescending(s => s.DateApply).FirstOrDefault();
                    hisbycandidate.IsBlackList = true;
                }
                repoCandidate.SaveChanges();
                repoHistory.SaveChanges();
                message = NotificationType.Success.ToString();
                return message;
            }
        }
开发者ID:dtafe,项目名称:vnr,代码行数:28,代码来源:Rec_CandidateServices.cs


示例11: ActionApprovedCandidate

        public string ActionApprovedCandidate(string selectedIds)
        {
            using (var context = new VnrHrmDataContext())
            {
                BaseService service = new BaseService();
                string message = string.Empty;
                string status = string.Empty;
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                var repoCandidate = new Rec_CandidateRepository(unitOfWork);
                var repoHistory = new Rec_RecruitmentHistoryRepository(unitOfWork);
                List<Guid> lstcandidateIds = selectedIds.Split(',').Select(x => Guid.Parse(x)).ToList();
                var lstCandidates = repoCandidate.FindBy(m => m.ID != null && lstcandidateIds.Contains(m.ID)).ToList();

                var lstRecruimentHistory = repoHistory.FindBy(m => m.CandidateID != null && lstcandidateIds.Contains(m.CandidateID)).ToList();

                foreach (var Candidate in lstCandidates)
                {
                    Candidate.Status = HRM.Infrastructure.Utilities.EnumDropDown.CandidateStatus.E_APPROVE.ToString();
                    Candidate.DateUpdate = DateTime.Now;
                    var hisbycandidate = lstRecruimentHistory.Where(s => s.CandidateID == Candidate.ID).OrderByDescending(s => s.DateApply).FirstOrDefault();
                    hisbycandidate.Status = HRM.Infrastructure.Utilities.EnumDropDown.CandidateStatus.E_APPROVE.ToString();
                    hisbycandidate.CandidateID = Candidate.ID;
                    hisbycandidate.DateUpdate = DateTime.Now;
                }
                repoCandidate.SaveChanges();
                repoHistory.SaveChanges();
                message = NotificationType.Success.ToString();
                return message;
            }
        }
开发者ID:dtafe,项目名称:vnr,代码行数:30,代码来源:Rec_CandidateServices.cs


示例12: UpdateResource

        public bool UpdateResource(List<Sys_ResourceEntity> lstResource)
        {
            using (var context = new VnrHrmDataContext())
            {
                var isExistedUser = false;
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                var repo = new Sys_ResourceRepository(unitOfWork);
                string status = string.Empty;
                var resources = GetAllUseEntity<Sys_Resource>(ref status);
                var resourceAdding = new List<Sys_Resource>();
                foreach (var sysResource in lstResource)
                {
                    var resourceExist = resources.Where(p => p.ResourceName == sysResource.ResourceName).FirstOrDefault();
                    if (resourceExist == null)
                    {
                        if (sysResource != null && sysResource.ResourceType == HRM.Infrastructure.Utilities.ResourceType.Other.ToString() && !string.IsNullOrEmpty(sysResource.ResourceName))
                        {
                            sysResource.Category = sysResource.ModuleName;
                        }

                        var resourceAddNew = sysResource.CopyData<Sys_Resource>();
                        resourceAddNew.ID = Guid.NewGuid();
                        var resourceExisted = resourceAdding.Where(p => sysResource != null && p.ResourceName == sysResource.ResourceName).FirstOrDefault();
                        if (resourceExisted == null)
                        {
                            resourceAdding.Add(resourceAddNew);
                        }
                    }
                }
                repo.Add(resourceAdding);
                repo.SaveChanges();
            }
            return false;
        }
开发者ID:dtafe,项目名称:vnr,代码行数:34,代码来源:Sys_ResourceServices.cs


示例13: GetClaimApprovedList

        public List<FIN_ClaimEntity> GetClaimApprovedList(Guid UserLogin)
        {
            List<FIN_ClaimEntity> lstReturn = new List<FIN_ClaimEntity>();

            string appType = ApproveType.E_FIN_ClaimRequest.ToString();
            string status = string.Empty;
            using (var context = new VnrHrmDataContext())
            {
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                var repoFIN_Claim = new CustomBaseRepository<FIN_Claim>(unitOfWork);
                List<Sys_ConditionApproved> lstCondition = new List<Sys_ConditionApproved>();
                List<Hre_ProfileEntity> lstProfile = new List<Hre_ProfileEntity>();
                GetProfileWithPermissionLogin(UserLogin, appType, out lstCondition, out lstProfile);

                var lstExpensesCondition = lstCondition.Select(s => s.ExpensesType).Distinct().ToList();
                var dataClaim = repoFIN_Claim
                    .FindBy(s => s.IsDelete == null && lstExpensesCondition.Contains(s.ExpensesType))
                    .ToList().Translate<FIN_ClaimEntity>();

                foreach (var condition in lstCondition)
                {
                    List<Guid> lstGuidOrg = GetOrgInCondition(condition);
                    var profileInOrg = lstProfile.Where(s => lstGuidOrg.Contains(s.OrgStructureID.Value)).Select(a => a.ID).ToList();
                    
                    var resultCondition = dataClaim.Where(s => profileInOrg.Contains(s.ProfileID.Value)).ToList();
                    lstReturn.AddRange(resultCondition);
                }
            }
            return lstReturn;
        }
开发者ID:dtafe,项目名称:vnr,代码行数:30,代码来源:FIN_ClaimService.cs


示例14: CompleteComputingTask

        public void CompleteComputingTask(Guid asynTaskID, Guid userID,
            int totalComputed, int totalProfile, DataErrorCode dataErrorCode)
        {
            #region Lưu Sys_AsynTask khi xử lý xong

            if (asynTaskID != Guid.Empty)
            {
                using (var taskContext = new VnrHrmDataContext())
                {
                    IUnitOfWork taskunitOfWork = new UnitOfWork(taskContext);
                    var asynTask = taskunitOfWork.CreateQueryable<Sys_AsynTask>(s => s.ID == asynTaskID).FirstOrDefault();

                    if (asynTask != null)
                    {
                        asynTask.PercentComplete = 1D;
                        asynTask.TimeEnd = DateTime.Now;
                        asynTask.Status = AsynTaskStatus.Done.ToString();

                        var time = asynTask.TimeEnd.Value.Subtract(asynTask.TimeStart).TotalMinutes;
                        asynTask.Description += " - Result: " + totalComputed + "/" + totalProfile;
                        asynTask.Description += " - Time: " + time.ToString("N2");

                        if (dataErrorCode == DataErrorCode.Locked)
                        {
                            asynTask.PercentComplete = 1D;//Không cần nhân với 100
                            asynTask.Description = "Dữ Liệu Quẹt Thẻ Đã Bị Khóa";
                        }

                        dataErrorCode = taskunitOfWork.SaveChanges();
                    }
                }
            }

            #endregion
        }
开发者ID:dtafe,项目名称:vnr,代码行数:35,代码来源:Can_TamServices.cs


示例15: SaveEvalutionData

 public string SaveEvalutionData(int year, Guid? TimesGetDataID, string orgStructureID, DateTime? _dateStart, DateTime? _dateEnd,string userLogin)
 {
     using (var context = new VnrHrmDataContext())
     {
         var evaServices = new Eva_ReportServices();
         List<Eva_EvalutionDataEntity> lstEvalutionDataEntity = new List<Eva_EvalutionDataEntity>();
         lstEvalutionDataEntity = evaServices.SummaryEvalutionData(year, TimesGetDataID, orgStructureID, _dateStart, _dateEnd,userLogin);
         var unitOfWork = (IUnitOfWork)new UnitOfWork(context);
         var repoEva_EvalutionData = new CustomBaseRepository<Eva_EvalutionData>(unitOfWork);
         List<Eva_EvalutionData> lstEvalutionData = new List<Eva_EvalutionData>();
         lstEvalutionData = lstEvalutionDataEntity.Translate<Eva_EvalutionData>();
         if (lstEvalutionData != null)
         {
             int _total = lstEvalutionData.Count;
             int _totalPage = _total / 200 + 1;
             int _pageSize = 200;
             for (int _page = 1; _page <= _totalPage; _page++)
             {
                 int _skip = _pageSize * (_page - 1);
                 var _listCurrenPage = lstEvalutionData.Skip(_skip).Take(_pageSize).ToList();
                 foreach (var item in _listCurrenPage)
                 {
                     repoEva_EvalutionData.Add(item);
                 }
                 unitOfWork.SaveChanges();
             }
         }
         return "SaveSuccess";
         //    #endregion
     }
 }  
开发者ID:dtafe,项目名称:vnr,代码行数:31,代码来源:Eva_EvalutionDataServices.cs


示例16: ComputeWorkdayAdjust

        public List<Att_WorkdayEntity> ComputeWorkdayAdjust(ListQueryModel lstModel, string UserLogin)
        {
            using (var context = new VnrHrmDataContext())
            {
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                string status = string.Empty;

                #region xử lý lấy lstProfileIds theo OrgStructureID
                //List<Hre_ProfileEntity> lstProfile = new List<Hre_ProfileEntity>();
                //List<Guid> lstProfileIDs = new List<Guid>();
                //List<object> lstObj = new List<object>();
                //lstObj.Add(search.OrgStructureID);
                //lstObj.Add(null);
                //lstObj.Add(null);
                //if (search.ProfileName != null && search.OrgStructureID == null)
                //{
                //}
                //else
                //{
                //    lstProfile = GetData<Hre_ProfileEntity>(lstObj, ConstantSql.hrm_hr_sp_get_ProfileIdsByOrg, ref status);
                //    lstProfileIDs = lstProfile.Select(s => s.ID).ToList();
                //}
                #endregion

                var lstWorkday = GetData<Att_WorkdayEntity>(lstModel, ConstantSql.hrm_att_sp_get_WorkDay, UserLogin, ref status);
                SetStatusLeaveOnWorkday(lstWorkday, unitOfWork);
                return lstWorkday;
            }
        }
开发者ID:dtafe,项目名称:vnr,代码行数:29,代码来源:Att_ComputeWorkdayAdjustServices.cs


示例17: ComputeAnnualLeaveAllowance

        public Guid ComputeAnnualLeaveAllowance(Sal_UnusualAllowanceEntity model)
        {
            using (var context = new VnrHrmDataContext())
            {
                var unitOfWork = (IUnitOfWork)new UnitOfWork(context);
                var repoSys_AsynTask = new CustomBaseRepository<Sys_AsynTask>(unitOfWork);
                var repoCat_Element = new CustomBaseRepository<Cat_Element>(unitOfWork);


                //tạo asynTask
                Sys_AsynTask asynTask = new Sys_AsynTask()
                {
                    ID = Guid.NewGuid(),
                    Summary = "Tính phép năm : " + model.MonthStart.Value.ToString("dd/MM/yyyy"),
                    Type = AsynTask.Payroll_Compute_AnnualLeaveAllowance.ToString(),
                    Status = AsynTaskStatus.Doing.ToString(),
                    TimeStart = DateTime.Now,
                    PercentComplete = 0.01,
                };
                repoSys_AsynTask.Add(asynTask);
                unitOfWork.SaveChanges();

                Thread threadCompute = new Thread(() => ComputeBonusUnusualAllowance_Progress(asynTask.ID, model, true));
                threadCompute.Start();

                return asynTask.ID;
            }
        }
开发者ID:dtafe,项目名称:vnr,代码行数:28,代码来源:Sal_UnusualAllowanceServices.cs


示例18: SaveList

 public string SaveList(List<Att_RosterEntity> lstModel)
 {
     using (var context = new VnrHrmDataContext())
     {
         List<Att_Roster> lstSave = new List<Att_Roster>();
         lstSave = lstModel.Translate<Att_Roster>();
         var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
         var repo = new CustomBaseRepository<Att_Roster>(unitOfWork);
         //int count = 0;
         foreach (var item in lstSave)
         {
             //count += 1;
             item.ID = Guid.NewGuid();
             repo.Add(item);
         }
         try
         {
             repo.SaveChanges();
             return "Success";
         }
         catch (Exception)
         {
             return "Error";
         }
     }
 }
开发者ID:dtafe,项目名称:vnr,代码行数:26,代码来源:Att_RosterServices.cs


示例19: GetEnumDataInfo

        public static List<EnumDataInfo> GetEnumDataInfo(Type enumType)
        {
            var listEnumDataInfo = Utilities.GetEnumDataInfo(enumType);

            using (var context = new VnrHrmDataContext())
            {
                IUnitOfWork unitOfWork = new UnitOfWork(context);

                var listEnumName = unitOfWork.CreateQueryable<Sys_EnumFilter>(Guid.Empty,
                    d => d.EnumType == enumType.Name).Select(d => d.EnumName).ToList();

                if (listEnumName != null && listEnumName.Count() > 0)
                {
                    listEnumDataInfo = listEnumDataInfo.Where(d => !listEnumName.Contains(d.Name)).ToList();
                }

                foreach (var item in listEnumDataInfo)
                {
                    var enumValue = Enum.Parse(enumType, item.Name);
                    item.Translate = item.Name.TranslateString();
                }
            }

            return listEnumDataInfo;
        }
开发者ID:dtafe,项目名称:vnr,代码行数:25,代码来源:EnumRepository.cs


示例20: AddApprovers

        public FIN_ApproverECLAIMEntity AddApprovers(FIN_ApproverECLAIMEntity model)
        {
            var result = new FIN_ApproverECLAIMEntity();
            using (var context = new VnrHrmDataContext())
            {
                var status = string.Empty;
                var unitOfWork = (IUnitOfWork)(new UnitOfWork(context));
                //lay ds Approved theo profileId
                var profileId = Common.DotNetToOracle(string.Empty.ToString());
                if (model != null && model.ProfileID != null)
                {
                    profileId = Common.DotNetToOracle(model.ProfileID.ToString());
                }

                if (model != null)
                {
                    model.ApprovedIDs = model.ApprovedIDs.Where(m => m != Guid.Empty).ToList();
                    var lstEvaluators = model.ApprovedIDs == null ? new List<Guid>() : model.ApprovedIDs;
                    foreach (var evaluator in lstEvaluators)
                    {
                        result = model.CopyData<FIN_ApproverECLAIMEntity>();
                        result.ApprovedID = evaluator;
                        Add(result);
                    }
                    if (!lstEvaluators.Any())
                    {
                        //khi khong chon nguoi danh gia
                        result = model.CopyData<FIN_ApproverECLAIMEntity>();
                        result.ApprovedID = null;
                        Add(result);
                    }
                }
            }//end context
            return result;
        }
开发者ID:dtafe,项目名称:vnr,代码行数:35,代码来源:FIN_ApproverECLAIMService.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# HRSim.Minion类代码示例发布时间:2022-05-26
下一篇:
C# Domain.Hre_ProfileServices类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap