예제 #1
0
        public ActionResult AddTask()
        {
            DSRCManagementSystemEntities1 objdb = new DSRCManagementSystemEntities1();

            try
            {
                var          userId = (int)Session["UserId"];
                AddTaskModel atm    = new AddTaskModel();
                List <int>   list   = new List <int>();
                list = objdb.ProjectPhases.Where(x => x.IsACTIVE == true).Select(o => o.ProjectID).ToList();

                var obj = (from p in db.UserProjects.Where(x => x.UserID == userId)
                           join t in db.Projects.Where(x => list.Contains(x.ProjectID) && (x.IsDeleted == false || x.IsDeleted == null)) on p.ProjectID equals t.ProjectID
                           select new
                {
                    ProjectId = p.ProjectID,
                    ProjectName = t.ProjectName
                }).OrderBy(x => x.ProjectName).ToList();

                ViewBag.ProjectList = new SelectList(obj, "ProjectId", "ProjectName");
            }
            catch (Exception Ex)
            {
                string actionName     = this.ControllerContext.RouteData.Values["action"].ToString();
                string controllerName = this.ControllerContext.RouteData.Values["controller"].ToString();
                ExceptionHandlingController.ExceptionDetails(Ex, actionName, controllerName);
            }
            return(View());
        }
예제 #2
0
        public IActionResult AddTask(AddTaskModel model)
        {
            Db.ToDoId++;
            Db.SubTaskId++;

            ToDo todo = new ToDo()
            {
                Id              = Db.ToDoId,
                Title           = model.Title,
                Descrition      = model.Description,
                ImporanceOfTask = model.ImporanceOfTask,
                Status          = Status.NotDone,
                Type            = model.Type,
            };

            SubTask subtask = new SubTask()
            {
                Id         = Db.SubTaskId,
                Title      = model.SubTaskTitle,
                Descrition = model.SubTaskDescrition,
                SubStatus  = model.SubStatus
            };

            todo.SubTasks.Add(subtask);

            Db.Users.FirstOrDefault(u => u.FirstName == "John").ToDos.Add(todo);

            return(View("_AddedTask"));
        }
예제 #3
0
        public IActionResult AddTask(string error)
        {
            ViewBag.Error = error == null ? "" : error;
            AddTaskModel model = new AddTaskModel();

            return(View(model));
        }
예제 #4
0
        public PartialViewResult AddTask(AddTaskModel taskModel)
        {
            if (ModelState.IsValid)
            {
                _taskBlo.CreateTask(taskModel.Name);
            }

            return(PartialView("_AddTask"));
        }
예제 #5
0
        public async void addButton_Clicked(object sender, EventArgs e)
        {
            var model = new AddTaskModel()
            {
                Category         = category.Text,
                Description      = description.Text,
                Title            = task.Text,
                ProjectId        = TaskPage.ProjectId.ToString(),
                Priority         = priority.Text,
                ExpectedWorkTime = Int32.Parse(expectedWork.Text)
            };

            var result = await App.Client.AddTasks(model);

            App.GoToMainPage();
        }
예제 #6
0
        public ActionResult AddTask([FromBody] AddTaskModel task)
        {
            TaskListModel newtask = new TaskListModel();

            newtask.Title                   = task.Title;
            newtask.WfInstanceID            = task.WfInstanceID;
            newtask.FormLink                = task.FormLink;
            newtask.DueDate                 = task.DueDate;
            newtask.SenderProjectMemberRef  = task.SenderProjectMemberRef;
            newtask.ReciverProjectMemberRef = task.ReciverProjectMemberRef;
            newtask.Priority                = task.Priority;
            newtask.ProjectInfoRef          = task.ProjectInfoRef;
            newtask.EvaluationPeriodRef     = task.EvaluationPeriodRef;

            db.TaskLists.Add(newtask);

            return(Json(newtask.TaskId));
        }
예제 #7
0
        public async Task <TaskModel> AddTasks(AddTaskModel model)
        {
            var         json    = JsonConvert.SerializeObject(model);
            HttpContent content = new StringContent(json);

            content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");

            HttpResponseMessage req = await client.PostAsync("/api/addtask", content);

            if (req != null && req.IsSuccessStatusCode)
            {
                var data = await req.Content.ReadAsStringAsync();

                return(JsonConvert.DeserializeObject <TaskModel>(data));
            }

            return(null);
        }
예제 #8
0
        public AjaxResponse Command(AddTaskModel inModel)
        {
            var task = new Core.Domain.TaskCategory();

            if(inModel.TaskId.IsNotEmpty())
            {
               task = _taskCategoryService.Get(inModel.TaskId);
            }

            task.Name = inModel.TaskName;

            var notification = _taskCategoryService.SaveTask(task);

            if (notification.IsValid())
                return new AjaxResponse()
                           {
                               Success = true,
                               Item = task
                           };

            return new AjaxResponse() {Success = false};
        }
예제 #9
0
 public AddDownloadTask()
 {
     InitializeComponent();
     _model      = new AddTaskModel();
     DataContext = _model;
 }