private void ProjectSearchLookUpEdit_EditValueChanged(object sender, EventArgs e) { if (ProjectSearchLookUpEdit.EditValue == null) { return; } if (string.IsNullOrEmpty(ProjectSearchLookUpEdit.EditValue.ToString())) { return; } Guid projectId = (Guid)ProjectSearchLookUpEdit.EditValue; if (projectId != Guid.Empty) { ProjectIterationSearchLookUpEdit.ReLoadData(new BinaryOperator("ProjectId", projectId), "ProjectIteration"); ((Katrin.Domain.Impl.ProjectWeekReport)EntityBindingSource.Current).ProjectId = projectId; if (ProjectSearchLookUpEdit.Tag != null) { ((Katrin.Domain.Impl.ProjectWeekReport)EntityBindingSource.Current).ProjectIterationId = Guid.Empty; } ProjectSearchLookUpEdit.Tag = e; } }
public void BindNewTask(int minValue, int defaultValue, Guid projectId, object newTaskOne, object newTaskTwo) { _minValue = minValue; NewTaskOneBindingSource.DataSource = newTaskOne; NewTaskTwoBindingSource.DataSource = newTaskTwo; hourTrackBarControl.Value = defaultValue; ProjectIterationSearchLookUpEdit.ReLoadData(new BinaryOperator("ProjectId", projectId), "ProjectIteration"); NewProjectIterationSearchLookUpEdit.ReLoadData(new BinaryOperator("ProjectId", projectId), "ProjectIteration"); TNewProjectIterationSearchLookUpEdit.ReLoadData(new BinaryOperator("ProjectId", projectId), "ProjectIteration"); string[] splitTypes = { "RemainderTime", "Rate", "Manual" }; splitTypeRadio.Properties.Items.Clear(); for (int i = 0; i < splitTypes.Count(); i++) { RadioGroupItem item = new RadioGroupItem(i, ResourceService.GetString(splitTypes[i])); splitTypeRadio.Properties.Items.Add(item); } splitTypeRadio.EditValue = 0; if (OnValueChanged != null) { OnValueChanged(null, new EventArgs <int, int>(hourTrackBarControl.Value, 0)); } }
private void ProjectSearchLookUpEdit_EditValueChanged(object sender, EventArgs e) { ProjectIterationSearchLookUpEdit.Properties.ReadOnly = true; ProjectModuleSearchLookUpEdit.Properties.ReadOnly = true; if (ProjectSearchLookUpEdit.EditValue == null) { ProjectSearchLookUpEdit.EditValue = Guid.Empty; } if (string.IsNullOrEmpty(ProjectSearchLookUpEdit.EditValue.ToString())) { return; } Guid projectId = projectId = (Guid)ProjectSearchLookUpEdit.EditValue; if (projectId == Guid.Empty) { return; } ProjectIterationSearchLookUpEdit.Properties.ReadOnly = false; ProjectModuleSearchLookUpEdit.Properties.ReadOnly = false; // owner reload data EventHandler <EventArgs <Guid> > handler = OnProjectChange; if (handler != null) { handler(OwnerIdLookUpEdit, new EventArgs <Guid>(projectId)); } var taskEntity = (Katrin.Domain.Impl.ProjectTask)EntityBindingSource.Current; taskEntity.ProjectId = projectId; // iteration reload data CriteriaOperator filter = (new BinaryOperator("ProjectId", projectId)); filter &= new BinaryOperator("StatusCode", 2, BinaryOperatorType.NotEqual); if (taskEntity.ProjectIterationId != null && taskEntity.ProjectIterationId != Guid.Empty) { filter |= new BinaryOperator("ProjectIterationId", taskEntity.ProjectIterationId ?? Guid.Empty, BinaryOperatorType.Equal); } ProjectIterationSearchLookUpEdit.ReLoadData(filter, "ProjectIteration"); // iteration reload data ProjectModuleSearchLookUpEdit.ReLoadData(new BinaryOperator("ProjectId", projectId), "ProjectModule"); CriteriaOperator theOperator = Context.GetFilter("ProjectIterationId"); if (theOperator == null) { return; } if (!(theOperator is BinaryOperator)) { return; } OperandValue operandValue = ((BinaryOperator)theOperator).RightOperand as OperandValue; if (operandValue.Value is Guid) { ((Katrin.Domain.Impl.ProjectTask)EntityBindingSource.Current).ProjectIterationId = (Guid)operandValue.Value; } }