예제 #1
0
 public async Task <bool> Delete(ActivityPriority ActivityPriority)
 {
     if (await ValidateId(ActivityPriority))
     {
     }
     return(ActivityPriority.IsValidated);
 }
예제 #2
0
        public Opportunity_ActivityPriorityDTO(ActivityPriority ActivityPriority)
        {
            this.Id = ActivityPriority.Id;

            this.Code = ActivityPriority.Code;

            this.Name = ActivityPriority.Name;

            this.Errors = ActivityPriority.Errors;
        }
        public Company_ActivityPriorityDTO(ActivityPriority ActivityPriority)
        {
            this.Id = ActivityPriority.Id;

            this.Code = ActivityPriority.Code;

            this.Name = ActivityPriority.Name;

            this.Errors = ActivityPriority.Errors;
        }
예제 #4
0
        public async Task <ActivityPriority> Get(long Id)
        {
            ActivityPriority ActivityPriority = await UOW.ActivityPriorityRepository.Get(Id);

            if (ActivityPriority == null)
            {
                return(null);
            }
            return(ActivityPriority);
        }
        public CustomerLead_ActivityPriorityDTO(ActivityPriority ActivityPriority)
        {
            this.Id = ActivityPriority.Id;

            this.Code = ActivityPriority.Code;

            this.Name = ActivityPriority.Name;

            this.Errors = ActivityPriority.Errors;
        }
예제 #6
0
        public static string GetPriorityTextColor(ActivityPriority priority)
        {
            switch (priority)
            {
            case ActivityPriority.Critical:
                return("color-danger");

            case ActivityPriority.High:
                return("color-warning");

            case ActivityPriority.Medium:
                return("color-primary");

            default:
                return("color-info");
            }
        }
예제 #7
0
        public static string GetPriorityBadgeColor(ActivityPriority priority)
        {
            switch (priority)
            {
            case ActivityPriority.Critical:
                return("badge-outline-danger");

            case ActivityPriority.High:
                return("badge-outline-warning");

            case ActivityPriority.Medium:
                return("badge-outline-primary");

            default:
                return("badge-outline-info");
            }
        }
예제 #8
0
        public async Task <ActivityPriority> Get(long Id)
        {
            ActivityPriority ActivityPriority = await DataContext.ActivityPriority.AsNoTracking()
                                                .Where(x => x.Id == Id)
                                                .Select(x => new ActivityPriority()
            {
                Id   = x.Id,
                Code = x.Code,
                Name = x.Name,
            }).FirstOrDefaultAsync();

            if (ActivityPriority == null)
            {
                return(null);
            }

            return(ActivityPriority);
        }
예제 #9
0
        public async Task <bool> ValidateId(ActivityPriority ActivityPriority)
        {
            ActivityPriorityFilter ActivityPriorityFilter = new ActivityPriorityFilter
            {
                Skip = 0,
                Take = 10,
                Id   = new IdFilter {
                    Equal = ActivityPriority.Id
                },
                Selects = ActivityPrioritySelect.Id
            };

            int count = await UOW.ActivityPriorityRepository.Count(ActivityPriorityFilter);

            if (count == 0)
            {
                ActivityPriority.AddError(nameof(ActivityPriorityValidator), nameof(ActivityPriority.Id), ErrorCode.IdNotExisted);
            }
            return(count == 1);
        }
예제 #10
0
 public IActionResult SetPriority(Guid id, ActivityPriority priority)
 {
     return(PartialView("_SetPriority"));
 }
예제 #11
0
        public async Task <IActionResult> CreateActivity(string requestName, Guid requestId, Guid?projectId, string projectName, string description, ActivityPriority priority, IFormFile file)
        {
            if (file != null)
            {
                await UploadFilesForRequest(projectName, projectId, requestName, requestId, file);
            }

            // Breadcrumb data
            ViewData["SecondNode"] = projectId.HasValue ? Mediator.Send(new GetProjectNameQuery {
                Id = projectId.Value
            }).Result : "No project";
            // Used to append project id to the parent breadcrumb node
            ViewBag.LinkToReplace  = Url.Action("Details", "Projects");
            ViewBag.BreadcrumbLink = Url.Action("Index", "Activities", new { id = projectId });

            var getAllProjects = User.UserHasThisPermission(Permissions.ProjectUpdate);

            ViewBag.Projects = Mediator.Send(new GetProjectsDtoQuery {
                GetAllProjects = getAllProjects
            }).Result;
            ViewBag.ActivityTypes = GetEnabledProjectActivityTypeSelectList(projectId.Value);

            if (projectId.HasValue && projectId.Value != Guid.Empty)
            {
                ViewBag.ApplicationUsers = Mediator.Send(new GetProjectMembersDtoQuery {
                    Id = projectId.Value
                }).Result;
                ViewBag.ActivityLists = Mediator.Send(new GetActivityListsDtoQuery {
                    ProjectId = projectId.Value
                }).Result;
                ViewBag.Sprints = Mediator.Send(new GetSprintsDtoQuery {
                    ProjectId = projectId.Value
                }).Result;
                ViewBag.ReturnId = projectId;

                return(View("Create", new CreateActivityCommand
                {
                    Name = string.IsNullOrEmpty(requestName) ? string.Empty : requestName,
                    Description = string.IsNullOrEmpty(description) ? string.Empty : description,
                    ProjectId = projectId.Value,
                    StartDate = DateTime.Now,
                    Priority = priority,
                    ChangeRequestId = requestId
                }));
            }

            return(View("Create"));
        }
예제 #12
0
 public async Task <bool> Create(ActivityPriority ActivityPriority)
 {
     return(ActivityPriority.IsValidated);
 }