Ejemplo n.º 1
0
        public override void InitEditors(Entity entity)
        {
            base.InitEditors(entity);
            string layoutResourceNamespace = "Katrin.Win.MainModule.DefaultLayout";

            ProjectSearchLookUpEdit.Bind(entity);
            ProjectIterationSearchLookUpEdit.Bind(entity);
            ProjectModuleSearchLookUpEdit.Bind(entity);
            OwnerIdLookUpEdit.Bind(entity);
            StatusCodeLookUpEdit.BindPickList(entity);
            priorityLookUpEdit.BindPickList(entity);
        }
Ejemplo n.º 2
0
 public override void InitEditors(Entity entity)
 {
     base.InitEditors(entity);
     ProjectSearchLookUpEdit.Bind(entity);
     ProjectIterationSearchLookUpEdit.Bind(entity, new BinaryOperator("StatusCode", 2, BinaryOperatorType.NotEqual));
     ProjectModuleSearchLookUpEdit.Bind(entity);
     ProjectIterationSearchLookUpEdit.Properties.ReadOnly = true;
     ProjectModuleSearchLookUpEdit.Properties.ReadOnly    = true;
     OwnerIdLookUpEdit.Bind(entity);
     StatusCodeLookUpEdit.BindPickList(entity);
     priorityLookUpEdit.BindPickList(entity);
     taskCategoryCodeLookUpEdit.BindPickList(entity);
 }
Ejemplo n.º 3
0
        private void ProjectSearchLookUpEdit_EditValueChanged(object sender, EventArgs e)
        {
            if (ProjectSearchLookUpEdit.EditValue == null)
            {
                return;
            }

            Guid projectId = projectId = (Guid)ProjectSearchLookUpEdit.EditValue;;

            if (projectId == Guid.Empty)
            {
                return;
            }


            // iteration reload data
            ProjectIterationSearchLookUpEdit.ReloadData(new BinaryOperator("ProjectId", projectId));

            // iteration reload data
            ProjectModuleSearchLookUpEdit.ReloadData(new BinaryOperator("ProjectId", projectId));
            // owner reload data
            EventHandler <EventArgs <Guid> > handler = OnProjectChange;

            if (handler != null)
            {
                handler(OwnerIdLookUpEdit, new EventArgs <Guid>(projectId));
            }

            EntityBindingSource.Current.AsDyanmic().ProjectId = projectId;

            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)
            {
                EntityBindingSource.Current.AsDyanmic().ProjectIterationId = operandValue.Value;
            }
        }
Ejemplo n.º 4
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;
            }
        }