示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string TaskId = Request.QueryString["Id"];

                AssigneeRepository assigneeRepository = new AssigneeRepository();
                ddlAssignee.DataSource = assigneeRepository.GetAllAssignees();
                ddlAssignee.DataBind();
                PriorityRepository priorityRepository = new PriorityRepository();
                ddlPriority.DataSource = priorityRepository.GetAllPriorities();
                ddlPriority.DataBind();
                StateRepository stateRepository = new StateRepository();
                ddlState.DataSource = stateRepository.GetAllStates();
                ddlState.DataBind();
                TagRepository tagRepository = new TagRepository();
                lstTags.DataSource = tagRepository.GetAllTags();
                lstTags.DataBind();

                if (TaskId != null)
                {
                    Guid taskId = Guid.Empty, taskIdOut;
                    if (Guid.TryParse(TaskId, out taskIdOut))
                    {
                        taskId = taskIdOut;
                    }
                    TaskRepository taskRepository = new TaskRepository();
                    Task           editingTask    = taskRepository.GetTaskById(taskId);
                    txtFirstDate.Text         = editingTask.StartDate.ToShortDateString();
                    txtLastDate.Text          = editingTask.FinishDate.Value.ToShortDateString();
                    txtTitle.Text             = editingTask.Title;
                    txtDescription.Text       = editingTask.Description;
                    ddlAssignee.SelectedValue = editingTask.AssigneeId.ToString();
                    ddlPriority.SelectedValue = editingTask.PriorityId.ToString();
                    ddlState.SelectedValue    = editingTask.StateId.ToString();

                    List <Tag> listTags           = tagRepository.GetTaskTags(taskId);
                    for (int item = 0; item < lstTags.Items.Count; item++)
                    {
                        foreach (Tag tag in listTags)
                        {
                            Guid tagId = Guid.Empty, tagIdOut;
                            if (Guid.TryParse(lstTags.Items[item].Value, out tagIdOut))
                            {
                                tagId = tagIdOut;
                            }
                            if (tag.Id == tagId)
                            {
                                lstTags.Items[item].Selected = true;
                            }
                        }
                    }
                    imgPicture.ImageUrl = editingTask.Picture;
                }
            }
        }
示例#2
0
        protected string GetAssigneeDetails(object id)
        {
            AssigneeRepository assigneeRepository = new AssigneeRepository();
            Guid Id = Guid.Empty, idOut;

            if (Guid.TryParse(id.ToString(), out idOut))
            {
                Id = idOut;
            }
            var assignee = assigneeRepository.GetAssigneeById(Id);

            return(String.Join(" ", assignee.LastName, assignee.FirstName));
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                AssigneeRepository assigneeRepository = new AssigneeRepository();
                ddlAssignees.DataSource = assigneeRepository.GetAllAssignees();
                ddlAssignees.DataBind();

                PriorityRepository priorityRepository = new PriorityRepository();
                ddlPriorities.DataSource = priorityRepository.GetAllPriorities();
                ddlPriorities.DataBind();
                FillRepeater();
            }
        }
示例#4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         AssigneeRepository ar = new AssigneeRepository();
         ddlAssignee.DataSource = ar.GetAllAssignees();
         ddlAssignee.DataBind();
         PriorityRepository pr = new PriorityRepository();
         ddlPriority.DataSource = pr.GetAllPriorities();
         ddlPriority.DataBind();
         StateRepository sr = new StateRepository();
         ddlState.DataSource = sr.GetAllStates();
         ddlState.DataBind();
         TagRepository tr = new TagRepository();
         cblTags.DataSource = tr.GetAllTags();
         cblTags.DataBind();
     }
 }
示例#5
0
 public ToDoService(ToDoRepository todoRepo, AssigneeRepository assigneeRepo)
 {
     this.todoRepo     = todoRepo;
     this.assigneeRepo = assigneeRepo;
 }
示例#6
0
 public TodoAppSrv(TodoRepository todorep, AssigneeRepository assigneerep)
 {
     this.todorep     = todorep;
     this.assigneerep = assigneerep;
 }
 public TodoService(TodoRepository todorepository, AssigneeRepository assigneeRepository)
 {
     this.todorepository     = todorepository;
     this.assigneeRepository = assigneeRepository;
 }