コード例 #1
0
        public ActionResult AddWorkItem(string txtItemTitle, string selAssigneeType, string txtAssignee)
        {
            control = (管理工作單Control)Session["ManageWorkItemControl"];     // get the control object from the Session Object.
            WorkItemDTO dto = new WorkItemDTO();            // new a WorkItem DTO object.
            
            // put the form's value to the WorkItem DTO object.
            dto.item_title = txtItemTitle;            
            dto.assignee_name = txtAssignee;
            switch (selAssigneeType)
            { 
                case "ORGANIZATION" :
                    dto.assign_type = AssigneeType.ORGANIZATION;
                    break;
                case "ROLE":
                    dto.assign_type = AssigneeType.ROLE;
                    break;
                case "HUMAN":
                    dto.assign_type = AssigneeType.HUMAN;
                    break;
            }

            control.AddWorkItem(dto);       // put the WorkItem DTO object into the List object.

            return View();
        }
コード例 #2
0
 /// <summary>
 /// 新增工作單 (WorkItem)
 /// </summary>
 public void AddWorkItem(WorkItemDTO wkdto)
 {
     wkdto.ID = (workitemList.Count() + 1).ToString();       // Set the WorkItem ID
     workitemList.Add(wkdto);                                // Add the WorkItem DTO to the List
 }