Esempio n. 1
0
        public OpenWorkItemsResult GetDefaultWorkItem()
        {
            OpenWorkItemsResult result = new OpenWorkItemsResult();

            _dummyNumber--;
            result.Number          = _dummyNumber;
            result.UseApplications = UseApplications;

            var type       = result.GetType();
            var properties = type.GetProperties();

            foreach (var kp in ContextValues.Where(kp => kp.Value != 0))
            {
                if (FindProperty(properties, kp.Key, out PropertyInfo property))
                {
                    property.SetValue(result, kp.Value);
                }
            }

            if (AppendIfMissing?.Any() ?? false)
            {
                foreach (var kp in AppendIfMissing.Where(kp => kp.Value != 0))
                {
                    if (FindProperty(properties, kp.Key, out PropertyInfo property) && !ContextValues.ContainsKey(kp.Key))
                    {
                        property.SetValue(result, kp.Value);
                    }
                }
            }

            return(result);
        }
Esempio n. 2
0
        public SelectList MilestoneSelect(OpenWorkItemsResult item = null, bool withIndirectOptions = false)
        {
            var items = AllMilestones.ToList();

            if (withIndirectOptions)
            {
                items.InsertRange(0, new IndirectMilestones().GetSelectListItems());
            }

            return(new SelectList(items, "Value", "Text", item?.MilestoneId));
        }
Esempio n. 3
0
 public SelectList ProjectSelect(OpenWorkItemsResult item = null)
 {
     return((item?.UseApplications ?? true) ?
            new SelectList(ProjectsByApp[item?.ApplicationId ?? 0].Concat(ProjectsWithoutApps[item?.TeamId ?? 0]).OrderBy(row => row.Text), "Value", "Text", item?.ProjectId) :
            new SelectList(ProjectsByTeam[item?.TeamId ?? 0], "Value", "Text", item?.ProjectId));
 }
Esempio n. 4
0
 public SelectList AppSelect(OpenWorkItemsResult item = null)
 {
     return(new SelectList(AllApps[item.TeamId], "Value", "Text", item?.ApplicationId));
 }
Esempio n. 5
0
 public SelectList TeamSelect(OpenWorkItemsResult item = null)
 {
     return(new SelectList(Teams, "Value", "Text", item?.TeamId));
 }
Esempio n. 6
0
 public SelectList CloseReasonSelect(OpenWorkItemsResult item = null)
 {
     return(new SelectList(CloseReasons, "Value", "Text", item?.CloseReasonId));
 }
Esempio n. 7
0
 public SelectList SizeSelect(OpenWorkItemsResult item = null)
 {
     return(new SelectList(Sizes, "Value", "Text", item?.SizeId));
 }
Esempio n. 8
0
 public static IHtmlContent MilestoneDisplay(this IHtmlHelper <dynamic> html, OpenWorkItemsResult item)
 {
     throw new NotImplementedException();
 }
Esempio n. 9
0
 public SelectList ProjectSelect(OpenWorkItemsResult item = null)
 {
     return(new SelectList(AllProjects[item?.ApplicationId ?? 0], "Value", "Text", item?.ProjectId));
 }
Esempio n. 10
0
 public SelectList MilestoneSelect(OpenWorkItemsResult item = null)
 {
     return(new SelectList(Milestones, "Value", "Text", item?.MilestoneId));
 }