public JobIndex AddJobIndex(AbstractJobIndexId categoryId, string name , string dictionaryName, IList <CustomFieldTypeId> customFieldTypeIdList, Guid transferId) { try { using (var scope = new TransactionScope()) { var id = jobIndexRep.GetNextId(); var category = jobIndexRep.GetJobIndexCategory(categoryId); var jobIndex = new JobIndex(id, category, name, dictionaryName); assignJobIndexCustomField(jobIndex, customFieldTypeIdList); jobIndex.TransferId = transferId; jobIndexRep.Add(jobIndex); scope.Complete(); return(jobIndex); } } catch (Exception exp) { var res = jobIndexRep.TryConvertException(exp); if (res == null) { throw; } throw res; } }
public JobIndex AddJobIndex(PeriodId periodId, AbstractJobIndexId groupId, SharedJobIndexId jobIndexId, IDictionary <SharedJobIndexCustomFieldId, string> customFieldValues, bool isInquireable, int calculationOrder, long calculationLevel) { try { using (var tr = new TransactionScope()) { var period = periodRep.GetById(periodId); var sharedJob = pmsAdminService.GetSharedJobIndex(jobIndexId); var id = jobIndexRep.GetNextId(); if (groupId == null) { throw new ArgumentException("groupId is null"); } var group = jobIndexRep.GetJobIndexGroupById(groupId); var jobIndex = new JobIndex(id, period, sharedJob, group, isInquireable, calculationLevel, calculationOrder); var validateCustomFldValues = getSharedJobIndexCustomFields(jobIndexId, customFieldValues); jobIndex.UpdateCustomFields(validateCustomFldValues); jobIndexRep.Add(jobIndex); tr.Complete(); return(jobIndex); } } catch (Exception exp) { var res = jobIndexRep.TryConvertException(exp); if (res == null) { throw; } throw res; } }
public List <KeyValuePair <int, int> > GetSkillExtendIDs() { List <KeyValuePair <int, int> > list = new List <KeyValuePair <int, int> >(); if (!DataReader <JobIndex> .Contains(this.CurType)) { return(list); } JobIndex jobIndex = DataReader <JobIndex> .Get(this.CurType); List <int> list2 = new List <int>(); bool flag = this.IsAllRankUpFinish(); for (int i = 0; i < jobIndex.AdvancedJobId.get_Count(); i++) { if (jobIndex.AdvancedJobId.get_Item(i) <= this.CurCareer && (jobIndex.AdvancedJobId.get_Item(i) != this.CurCareer || flag)) { if (DataReader <AdvancedJob> .Contains(jobIndex.AdvancedJobId.get_Item(i))) { list2.Add(DataReader <AdvancedJob> .Get(jobIndex.AdvancedJobId.get_Item(i)).skillExtendId); } } } for (int j = 0; j < list2.get_Count(); j++) { list.Add(new KeyValuePair <int, int>(list2.get_Item(j), 1)); } return(list); }
protected void SetCareer(int index) { if (!DataReader <JobIndex> .Contains(this.TypeID)) { return; } JobIndex jobIndex = DataReader <JobIndex> .Get(this.TypeID); int num = (index >= 0) ? ((index <= jobIndex.AdvancedJobId.get_Count() - 1) ? index : (jobIndex.AdvancedJobId.get_Count() - 1)) : 0; this.CurCareer = jobIndex.AdvancedJobId.get_Item(num); for (int i = 0; i < this.careerUnitList.get_Count(); i++) { this.careerUnitList.get_Item(i).SetClickState(i == num); } if (!DataReader <AdvancedJob> .Contains(this.CurCareer)) { return; } AdvancedJob advancedJob = DataReader <AdvancedJob> .Get(this.CurCareer); this.SetPreview(advancedJob.advanced1Model); this.SetSuccessSign(); this.SetAttrText(advancedJob.attrsDelta); this.SetSkill(advancedJob.passiveSkill, advancedJob.description); }
private void assignJobIndexCustomField(JobIndex jobIndex, IList <CustomFieldTypeId> customFieldTypeIdList) { foreach (var customFieldId in customFieldTypeIdList) { var customField = customFieldRep.GetById(customFieldId); jobIndex.AssignCustomField(customField); } }
public void Add(JobPositionInquiryConfigurationItem itm, JobIndex jobIndex, string value) { using (var tr = new TransactionScope()) { var id = inquiryJobIndexPointRep.GetNextId(); var inquiryIndexPoint = new InquiryJobIndexPoint(new InquiryJobIndexPointId(id), itm, jobIndex, value); inquiryJobIndexPointRep.Add(inquiryIndexPoint); tr.Complete(); } }
public bool IsAllRankUpFinish() { if (!DataReader <JobIndex> .Contains(this.CurType)) { return(false); } JobIndex jobIndex = DataReader <JobIndex> .Get(this.CurType); if (jobIndex.AdvancedJobId.get_Count() == 0) { return(false); } if (this.CurCareer != jobIndex.AdvancedJobId.get_Item(jobIndex.AdvancedJobId.get_Count() - 1)) { return(false); } if (!DataReader <AdvancedJob> .Contains(this.CurCareer)) { return(false); } AdvancedJob advancedJob = DataReader <AdvancedJob> .Get(this.CurCareer); if (advancedJob.stageId.get_Count() == 0) { return(false); } if (this.CurStage != advancedJob.stageId.get_Item(advancedJob.stageId.get_Count() - 1)) { return(false); } if (!DataReader <StageInfo> .Contains(this.CurStage)) { return(false); } StageInfo stageInfo = DataReader <StageInfo> .Get(this.CurStage); if (stageInfo.taskid.get_Count() == 0) { return(false); } for (int i = 0; i < stageInfo.taskid.get_Count(); i++) { if (!this.IsTaskFinished(stageInfo.taskid.get_Item(i))) { return(false); } } return(true); }
protected bool IsAllRankUpFinish() { if (!DataReader <JobIndex> .Contains(this.TypeID)) { return(false); } JobIndex jobIndex = DataReader <JobIndex> .Get(this.TypeID); if (jobIndex.AdvancedJobId.get_Count() == 0) { return(false); } if (this.DefaultCareer != jobIndex.AdvancedJobId.get_Item(jobIndex.AdvancedJobId.get_Count() - 1)) { return(false); } if (!DataReader <AdvancedJob> .Contains(this.DefaultCareer)) { return(false); } AdvancedJob advancedJob = DataReader <AdvancedJob> .Get(this.DefaultCareer); if (advancedJob.stageId.get_Count() == 0) { return(false); } if (this.DefaultStage != advancedJob.stageId.get_Item(advancedJob.stageId.get_Count() - 1)) { return(false); } if (!DataReader <StageInfo> .Contains(this.DefaultStage)) { return(false); } StageInfo stageInfo = DataReader <StageInfo> .Get(this.DefaultStage); if (stageInfo.taskid.get_Count() == 0) { return(false); } for (int i = 0; i < stageInfo.taskid.get_Count(); i++) { if (!RankUpChangeManager.Instance.IsTaskFinished(stageInfo.taskid.get_Item(i))) { return(false); } } return(true); }
public static void CreateJobIndex(IJobIndexRepository jobIndexRepository, string name, string dictionaryName, string group) { if (jobIndexCategory == null) { jobIndexCategory = new JobIndexCategory(jobIndexRepository.GetNextId(), null, "شاخص های شغل/فردی", "JobIndices"); jobIndexRepository.Add(jobIndexCategory); } var jobIndex = new JobIndex(jobIndexRepository.GetNextId(), jobIndexCategory, name, dictionaryName); jobIndex.AssignCustomFields(DefinedCustomFields.Where(dc => dc.EntityId == EntityTypeEnum.JobIndex).ToList()); jobIndexRepository.Add(jobIndex); JobIndices.Add(jobIndex, group); }
public static void CreateJobIndex(IJobIndexRepository jobIndexRepository, PMSAdmin.Domain.Model.JobIndices.JobIndex adminJobIndex, JobIndexGroup jobIndexGroup, bool isInquireable, Dictionary <PMSAdmin.Domain.Model.CustomFieldTypes.CustomFieldType, string> customFieldsDictionary, long clacLevel) { var sharedJobIndex = new SharedJobIndex(new SharedJobIndexId(adminJobIndex.Id.Id), adminJobIndex.Name, adminJobIndex.DictionaryName); var jobIndex = new JobIndex(jobIndexRepository.GetNextId(), Period, sharedJobIndex, jobIndexGroup, isInquireable, clacLevel); var sharedCustomFieldsDic = customFieldsDictionary.ToDictionary( c => new SharedJobIndexCustomField(new SharedJobIndexCustomFieldId(c.Key.Id.Id), c.Key.Name, c.Key.DictionaryName, c.Key.MinValue, c.Key.MaxValue), c => c.Value); jobIndex.UpdateCustomFields(sharedCustomFieldsDic); jobIndexRepository.Add(jobIndex); jobIndices.Add(jobIndex); }
public void SetData(int theTypeID, int theDefaultCareer, int theCurState, List <int> completedTask) { this.TypeID = theTypeID; this.DefaultCareer = theDefaultCareer; this.DefaultStage = theCurState; if (!DataReader <JobIndex> .Contains(theTypeID)) { return; } JobIndex jobIndex = DataReader <JobIndex> .Get(theTypeID); WaitUI.OpenUI(5000u); this.InitCareerUnit(jobIndex.AdvancedJobId, delegate { WaitUI.CloseUI(0u); this.OnClickCareerBtn(this.DefauleCareerIndex); }); }
public InquiryJobIndexPoint(InquiryJobIndexPointId id, JobPositionInquiryConfigurationItem configurationItem, JobIndex jobIndex, string jobIndexValue) { if (id == null) { throw new ArgumentNullException("inquiryJobIndexPointId"); } this.id = id; if (id == null) { throw new ArgumentNullException("configurationItem"); } configurationItemId = configurationItem.Id; if (id == null) { throw new ArgumentNullException("jobIndex"); } jobIndexId = jobIndex.Id; this.jobIndexValue = jobIndexValue; }
public void AddJobIndexPoint(Period period, Calculation calculation, Employee employee, JobPosition jobPosition, JobIndex jobIndex, string name, decimal value, bool isFinal) { var oldpoint = savedCalculationPoints.OfType <JobIndexPoint>().SingleOrDefault( cp => cp.JobPositionId == jobPosition.Id && cp.JobIndexId == jobIndex.Id && cp.Name == name); if (oldpoint != null) { EmployeePointsForUpdate.Add(oldpoint.Id, value); } else { EmployeePointsForAdd.Add(new JobIndexPoint( jobIndexPointRep.GetNextId(), period, employee, calculation, jobPosition, jobIndex, name, value, isFinal)); } }
private static void CreateJobIndexPoint(InquiryJobIndexPointRepository inquiryRep, JobIndex jobIndex, JobPositionInquiryConfigurationItem itm, string value) { var inquiryIndexPoint = new Domain.Model.InquiryJobIndexPoints.InquiryJobIndexPoint( new Domain.Model.InquiryJobIndexPoints.InquiryJobIndexPointId(inquiryRep.GetNextId()), itm, jobIndex, value); inquiryRep.Add(inquiryIndexPoint); }
private static void CreateJobIndexIndexPointWithValue(InquiryJobIndexPointRepository inquiryRep, JobIndex jobIndex, JobPositionInquiryConfigurationItem itm, List <string> values) { if (itm.InquirerJobPositionLevel.Equals(JobPositionLevel.None)) { CreateJobIndexPoint(inquiryRep, jobIndex, itm, values[0]); } if (itm.InquirerJobPositionLevel.Equals(JobPositionLevel.Childs)) { CreateJobIndexPoint(inquiryRep, jobIndex, itm, values[1]); } if (itm.InquirerJobPositionLevel.Equals(JobPositionLevel.Parents)) { CreateJobIndexPoint(inquiryRep, jobIndex, itm, values[2]); } }
public void CheckUpdatingJobIndex(JobIndex jobIndex) { var period = periodRep.GetById(jobIndex.PeriodId); period.CheckModifingJobIndex(); }
public JobIndexPoint(CalculationPointId id, Period period, Employee employee, Calculation calculation, JobPosition jobPosition, JobIndex jobIndex, string name, decimal value, bool isFinal = false) : base(id, period, employee, calculation, jobPosition, name, value, isFinal) { this.jobIndexId = jobIndex.Id; }