Example #1
0
 public static Backlog CreateBacklog(Category category)
 {
     return new Backlog
     {
         CategoryId = category.Id,
         CreatedAt = DateTime.Now,
         CreatedById = ConnectedUserId,
         TypeId = GetBacklogTypeId()
     };
 }
Example #2
0
        private TreeNode CreateTreeNodeItem(Category category)
        {
            var mn = new TreeNode(category.Name)
            {
                Tag = category
            };

            if (category.SubCategories != null && category.SubCategories.Any())
                foreach (Category mcategory in category.SubCategories
                                                       .Where(mcategory => mcategory.SubCategories != null &&
                                                                           mcategory.SubCategories.Any()))
                    mn.Nodes.AddRange(mcategory.SubCategories
                                               .Select(CreateTreeNodeItem)
                                               .ToArray());

            return mn;
        }
        public async Task LoadTasks(Spring spring, Category category)
        {
            Logger.Log("Show backLogs for " + (category != null
                                                   ? $"category {category.Name}"
                                                   : $"spring {spring?.Name}"));

            try
            {
                UIHelper.ShowLoader("Get backlogs");

                pnlBackLogs.SuspendLayout();

                ClearControls();

                var mres = await WebCallFactory.GetAllBackLogs(spring?.Id, category?.Id);

                if (mres.Error)
                    throw mres.Exception;

                pnlBackLogs.Controls.AddRange(mres.Backlogs.Select(CreateBackLogControl).Cast<Control>().ToArray());
                UIHelper.UpdateStatusBarTexts();

                UIHelper.HideLoader();
            }
            catch (Exception mex)
            {
                UIHelper.HideLoader();
                UIHelper.ShowError(mex);
            }
            finally
            {
                RecalculateColumns();         //something weird happen is remove this line
                pnlBackLogs.ResumeLayout();
            }
        }