Esempio n. 1
0
    public bool UpdateTask(DateTime date, decimal time, string workDone, string notes, string woNum, string rfcNum, int serviceID, int projectID, int userID, int phaseID, int assetID, int categoryID, int taskID)
    {
        TimeKeeper.TasksDataTable tasks = Adaptor.GetTaskByTaskID(taskID);
        if (tasks.Count == 0)
        {
            return(false);
        }

        TimeKeeper.TasksRow task = tasks[0];

        task.Date       = date;
        task.Time       = time;
        task.WorkDone   = workDone;
        task.Notes      = notes;
        task.WONum      = woNum;
        task.RFCNum     = rfcNum;
        task.ServiceID  = serviceID;
        task.ProjectID  = projectID;
        task.UserID     = userID;
        task.PhaseID    = phaseID;
        task.AssetID    = assetID;
        task.CategoryID = categoryID;

        //Add the new task
        int rowsAffected = Adaptor.Update(task);

        //Return true if precisely one row was inserted, otherwise false
        return(rowsAffected == 1);
    }
Esempio n. 2
0
    public bool AddTask(DateTime date, decimal time, string workDone, string notes, string woNum, string rfcNum, int serviceID, int projectID, int userID, int phaseID, int assetID, int categoryID)
    {
        //Create a new TaskRow instance
        TimeKeeper.TasksDataTable Tasks = new TimeKeeper.TasksDataTable();
        TimeKeeper.TasksRow       task  = Tasks.NewTasksRow();

        task.Date       = date;
        task.Time       = time;
        task.WorkDone   = workDone;
        task.Notes      = notes;
        task.WONum      = woNum;
        task.RFCNum     = rfcNum;
        task.ServiceID  = serviceID;
        task.ProjectID  = projectID;
        task.UserID     = userID;
        task.PhaseID    = phaseID;
        task.AssetID    = assetID;
        task.CategoryID = categoryID;

        //Add the new task
        Tasks.AddTasksRow(task);
        int rowsAffected = Adaptor.Update(Tasks);

        //Return true if precisely one row was inserted, otherwise false
        return(rowsAffected == 1);
    }