public ICallReportVO ProcessCallReport(ICallReportVO callReport, string action) { IUserVO loginUser = UserDAO.RetrieveUserByLoginId(callReport.LastUpdateBy); if (callReport.Id == 0) { callReport.Owner = loginUser; } CallReportDAO.SaveCallReport(callReport); ITaskVO task = TaskDAO.RetrieveTaskByRefIdAndFlowType(callReport.Id, WORKFLOW_TYPE); if (task == null) { task = new TaskVO() { ReferenceId = callReport.Id, WorkflowType = WORKFLOW_TYPE }; task.LastUpdateBy = callReport.LastUpdateBy; task.Initiator = loginUser; } task.PreviousOwner = loginUser; task.TaskAction = action; task = WorkflowManager.ExecuteWorkflow(task, callReport.Reviewer); TaskDAO.SaveTask(task); callReport.Status = task.TaskStatus; callReport.WorkflowProcessId = task.WorkflowProcessId; callReport.TaskStatus = task.TaskStatus; callReport.CurrentRecipient = UserDAO.RetrieveUserById(task.CurrentOwner.Id); return(callReport); }
/// <summary> /// Constructeur /// </summary> public TaskService() : base() { taskDAO = new TaskDAO(); groupDAO = new GroupDAO(); personDAO = new PersonDAO(); followingDAO = new FollowingDAO(); }
public IActionResult PushUpdateTaskToDB(long taskid, string taskName, long employeeId, long priorityId, long statusId, string comment) { TaskModel task = TaskDAO.SelectFirst(new Dictionary <string, object>() { { TaskDAO.Columns.IdTask, taskid } }); task.Title = taskName; if (statusId != 0) { task.StatusId = statusId; } task.EmployeeId = employeeId; task.PriorityId = priorityId; task.Comment = comment; EmployeeModel model = EmployeeController.EmployeeDAO.SelectFirst(new Dictionary <string, object>() { { "IdEmployee", employeeId } }); TaskDAO.Update(taskid, task); TaskModel fullTask = task; List <TaskModel> fullTasks = TaskDAO.Select(TaskDAO.Columns.Fill(task, true)); if (fullTasks.Count > 0) { fullTask = fullTasks[0]; } MailMessageSender.SendMessage(model.Email, model.Name + " " + model.SurName, "Edytowano Twoje zadanie", fullTask, MailTypes.editTask); return(RedirectToAction("MainPage", "Home")); }
private List <TaskModel> GetTasksForAuthor(long id, int mode) { return(TaskDAO.Select(new Dictionary <string, object>() { { "T." + TaskDAO.Columns.IdAuthor, id }, { "Mode", mode } })); }
public static TaskDAO getInstance() { if (taskDAO == null) { taskDAO = new TaskDAOImplementation(); } return(taskDAO); }
public MeetingService(IUserAuthorization userAuthorization, IUserProvider userProvider, MeetingDAO meetingDao, InvitationDAO invitationDao, TaskDAO taskDao, ResultDAO resultDao) { _userAuthorization = userAuthorization; _meetingDao = meetingDao; _invitationDao = invitationDao; _taskDao = taskDao; _resultDao = resultDao; _userId = userProvider.GetUserId(); }
public static TaskDTO GetAll() { TaskDTO taskdto = new TaskDTO(); taskdto.Employees = EmployeeDAO.GetEmployees(); taskdto.Departments = DepartmentDAO.GetDepartments(); taskdto.Positions = PositionDAO.GetPositions(); taskdto.TaskStates = TaskDAO.GetTaskStates(); taskdto.Tasks = TaskDAO.GetTasks(); return(taskdto); }
public List <Response> saveTasks() { try { User requester = UserDAO.instanceByAlias(HttpContext.Current.Request.LogonUserIdentity.Name); Log log = new Log("saveTasks", "POST", requester, DateTime.Now, "", "", ""); LogDAO.insert(log); return(TaskDAO.insertOrUpdate(requester, Task.xmlToArrayOfTasks(requester, HttpContext.Current))); } catch (Exception ex) { throw new Exception(string.Format("Ops! An error has ocurred: {0}", ex.Message)); } }
public List <Task> getTasks(int projectId) { try { User requester = UserDAO.instanceByAlias(HttpContext.Current.Request.LogonUserIdentity.Name); Log log = new Log("getTasks", "POST", requester, DateTime.Now, projectId.ToString(), "", ""); LogDAO.insert(log); return(TaskDAO.select(requester, projectId)); } catch (Exception ex) { throw new Exception(string.Format("Ops! An error has ocurred: {0}", ex.Message)); } }
public Response finishTask(int taskId) { try { User requester = UserDAO.instanceByAlias(HttpContext.Current.Request.LogonUserIdentity.Name); Log log = new Log("finishTask", "POST", requester, DateTime.Now, taskId.ToString(), "", ""); LogDAO.insert(log); return(TaskDAO.finishTask(requester, TaskDAO.instanceById(taskId))); } catch (Exception ex) { throw new Exception(string.Format("Ops! An error has ocurred: {0}", ex.Message)); } }
public IActionResult PushAddTaskToDB(string name, long typeId, long employeeId, long priorityId, string comment) { TaskModel taskModel = new TaskModel(0, typeId, HomeController.ActualUser.Id, employeeId, name, null, null, comment, 1, priorityId); TaskController.TaskDAO.Insert(taskModel); EmployeeModel model = EmployeeController.EmployeeDAO.SelectFirst(new Dictionary <string, object>() { { "IdEmployee", employeeId } }); //ściągnąć model po id razem z słownikiem TaskModel fullTask = TaskDAO.Select(TaskDAO.Columns.Fill(taskModel, true))[0]; MailMessageSender.SendMessage(model.Email, model.Name + " " + model.SurName, "Przydzielono Ci zadanie", fullTask, MailTypes.addTask); return(RedirectToAction("MainPage", "Home")); }
public void AddNewTask(string taskName) { Random random = new Random(); Task task = new Task(); task.Id = TimeUtils.DataTime2Stamp(DateTime.Now); task.StartTime = TimeUtils.DataTime2Stamp(DateTime.Now); task.EndTime = task.StartTime + 60 * 60 * 24; task.TagId = 1; task.Progress = 0; task.Describe = taskName; task.Detail = " "; task.Finish = false; TaskDAO taskDAO = new TaskDAO(); taskDAO.insert(task); }
public IActionResult ChangeStatus(long id, int status, DateTime date) { TaskModel taskToChange = TaskDAO.SelectFirst(new Dictionary <string, object>() { { TaskDAO.Columns.IdTask, id } }); taskToChange.StatusId = status; if (status == 2) { taskToChange.DateStart = date; } else { taskToChange.DateEnd = date; } TaskDAO.Update(id, taskToChange); return(PartialView()); }
public IActionResult PushUpdateTaskToDB(long taskid, string name, long employeeId, long priorityId, long statusId, string comment) { TaskModel task = TaskDAO.SelectFirst(new Dictionary <string, object>() { { TaskDAO.Columns.IdTask, taskid } }); task.Title = name; if (statusId != 0) { task.StatusId = statusId; } task.EmployeeId = employeeId; task.PriorityId = priorityId; task.Comment = comment; TaskDAO.Update(taskid, task); return(RedirectToAction("MainPage", "Home")); }
public static void AddTask(TASK task) { TaskDAO.AddTask(task); }
public void Init() { taskDao = new TaskDAO(); taskController = new PrTaskController(taskDao); DeleteAllTasks(); }
public TaskService() { dao = new TaskDAO(); }
public static void ApproveTask(int taskID, bool isAdmin) { TaskDAO.ApproveTask(taskID, isAdmin); }
public ApiResult GetAll(DateTime?BeginDate = null, DateTime?EndDate = null, int pageindex = 1, int pagesize = 10, ClassTypeEnums?ClassType = null) { ApiResult result = new ApiResult(); string message = string.Empty; try { BeginDate = BeginDate ?? Convert.ToDateTime("1900-01-01"); EndDate = EndDate ?? Convert.ToDateTime("2099-12-31"); using (FLDbContext db = new FLDbContext()) { var tasklist = from task in db.FLTask join taskflow in db.TaskFlow on task.ID equals taskflow.TaskID where taskflow.BeginDate >= BeginDate && taskflow.BeginDate <= EndDate && (ClassType == null || task.ClassType == ClassType) && taskflow.MaintainUserID == LoginHelper.CurrentUser.ID select new { TaskName = task.TaskName, TaskID = task.ID, BeginDate = taskflow.BeginDate, EndDate = taskflow.EndDate, RemindDate = taskflow.RemindDate, IsAudit = taskflow.IsAudit, ApplyType = taskflow.ApplyType }; int total = tasklist.Count(); List <object> returnlist = new List <object>(); TaskDAO taskdao = new TaskDAO(); foreach (var data in tasklist.OrderByDescending(t => t.EndDate).Skip((pageindex - 1) * pagesize).Take(pagesize).ToList()) { returnlist.Add(new { TaskName = data.TaskName, TaskID = data.TaskID, BeginDate = data.BeginDate.ToString("yyyy-MM-dd HH:mm"), EndDate = data.EndDate.ToString("yyyy-MM-dd HH:mm"), RemindDate = data.RemindDate.ToString("yyyy-MM-dd HH:mm"), Status = taskdao.GetApplyTypeName(data.IsAudit, data.ApplyType) }); } result = ApiResult.NewSuccessJson(new { Total = total, List = returnlist }); } } catch { result = ApiResult.NewErrorJson("请检查网络状态或联系系统管理员"); } if (!string.IsNullOrEmpty(message)) { //回滚 result = ApiResult.NewErrorJson(message); } return(result); }
public static void UpdateTask(TASK task) { TaskDAO.UpdateTask(task); }
public static void DeleteTask(int taskID) { TaskDAO.DeleteTask(taskID); }
private TaskBLO() { baseDao = TaskDAO.Current; dao = TaskDAO.Current; }
public static void addTask(TASK task) { TaskDAO.addTask(task); }
private TaskDTOImplementation() { Logging.singlton(nameof(TaskDTO)); taskDAO = TaskDAOImplementation.getInstance(); }
public CalendarTab() { InitializeComponent(); project = MainController.Instance.Project; MySqlDataReader dataReader = new TaskDAO().GetGanttTasks(project.Id); if (dataReader != null) { _values = new ChartValues <GanttPoint>(); taskData = new List <DTO.Task>(); while (dataReader.Read()) { //_values.Add(new GanttPoint(dataReader.IsDBNull(1) ? 0 : ((DateTime)dataReader.GetMySqlDateTime("start_date")).Ticks, dataReader.IsDBNull(2) ? 0 : ((DateTime)dataReader.GetMySqlDateTime("due_date")).Ticks)); taskData.Add(new DTO.Task(0, null, null, null, 0, dataReader.GetString(3), dataReader.GetString(4), 0, 0, dataReader.GetBoolean(5), (DateTime)dataReader.GetMySqlDateTime(1), (DateTime)dataReader.GetMySqlDateTime(2), DateTime.MinValue)); } } var labels = new List <string>(); for (int i = 0; i < taskData.Count; i++) { labels.Add(taskData.ElementAt(i).Name); _values.Add(new GanttPoint(taskData.ElementAt(i).StartDate.Ticks, taskData.ElementAt(i).DueDate.Ticks)); } Series = new SeriesCollection { new RowSeries { Values = _values, DataLabels = true, } }; Formatter = value => new DateTime((long)value).ToString("dd MMM"); DataContext = this; Gantt.Series = Series; Gantt.AxisY.Clear(); Gantt.AxisY.Add( new Axis { Labels = labels.ToArray(), Separator = new Separator { Step = 1 }, FontSize = 14, }); Gantt.AxisX.Clear(); Gantt.AxisX.Add( new Axis { MinValue = project.CreatedAt.AddDays(-1).Ticks, MaxValue = project.DueDate.AddDays(1).Ticks, LabelFormatter = Formatter, FontSize = 14, }); Gantt.Height = _values.Count * 50; }
private TaskServiceImpl() { taskDAO = new TaskDAO(); }
public ProjectController(IConfiguration configuration) { _configuration = configuration; projectDao = new(_configuration); taskDao = new(_configuration); }
public PrTaskController() { taskDao = new TaskDAO(); }
public PrTaskController(TaskDAO t) { taskDao = t; }
private async static Task DoDBStuff(string dbConnString) { ITaskDAO taskDAO = new TaskDAO(dbConnString); await taskDAO.SaveExecutionInformation(new TaskExecutionInformation { Id = Guid.NewGuid(), Duration = 457, Status = "Success" }); }