示例#1
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);
    }