public Guid InsertTask(TaskEntity taskEntity) { Guid result; Database db = DatabaseFactory.CreateDatabase(Constant.DiaryDBConnectionString); DbCommand dbCommand = db.GetStoredProcCommand("usp_TaskInsert"); db.AddInParameter(dbCommand, "@TaskDate", DbType.DateTime, taskEntity.TaskDate); db.AddInParameter(dbCommand, "@CaseId", DbType.Guid, taskEntity.CaseId); db.AddInParameter(dbCommand, "@TaskCreator", DbType.Guid, taskEntity.TaskCreator); db.AddInParameter(dbCommand, "@FeeEarner", DbType.Guid, taskEntity.FeeEarner); db.AddInParameter(dbCommand, "@TaskTypeId", DbType.Guid, taskEntity.TaskTypeId); db.AddInParameter(dbCommand, "@TaskDescription", DbType.String, taskEntity.TaskDescription); db.AddInParameter(dbCommand, "@TotalRemainingHours", DbType.Decimal, taskEntity.TotalRemainingHours); db.AddInParameter(dbCommand, "@StartTime", DbType.Time, taskEntity.StartTime); db.AddInParameter(dbCommand, "@EndTime", DbType.Time, taskEntity.EndTime); db.AddInParameter(dbCommand, "@TotalHours", DbType.Decimal, taskEntity.TotalHours); db.AddInParameter(dbCommand, "@CreatedBy", DbType.Guid, taskEntity.CreatedBy); db.AddOutParameter(dbCommand, "@TaskId", DbType.Guid, 30); db.ExecuteNonQuery(dbCommand); result = new Guid(db.GetParameterValue(dbCommand, "@TaskId").ToString()); return result; }
public DataSet CalculateTask(TaskEntity taskEntity) { Database db = DatabaseFactory.CreateDatabase(Constant.DiaryDBConnectionString); DbCommand command = db.GetStoredProcCommand("usp_TaskCalculate"); db.AddInParameter(command, "@TaskDate", DbType.Date, taskEntity.TaskDate); db.AddInParameter(command, "@FeeEarner", DbType.Guid, taskEntity.FeeEarner); // db.AddInParameter(command, "@CaseId", DbType.Guid, taskEntity.CaseId); return db.ExecuteDataSet(command); }
public bool IsWithinValidTimeFrameOnUpdate(TaskEntity taskEntity) { Database db = DatabaseFactory.CreateDatabase(Constant.DiaryDBConnectionString); DbCommand command = db.GetStoredProcCommand("usp_TaskIsValidTimeFrameOnUpdate"); db.AddInParameter(command, "@TaskId", DbType.Guid, taskEntity.TaskId); db.AddInParameter(command, "@TaskDate", DbType.Date, taskEntity.TaskDate); db.AddInParameter(command, "@FeeEarner", DbType.Guid, taskEntity.FeeEarner); db.AddInParameter(command, "@CaseId", DbType.Guid, taskEntity.CaseId); db.AddInParameter(command, "@StartTime", DbType.Time, taskEntity.StartTime); db.AddInParameter(command, "@EndTime", DbType.Time, taskEntity.EndTime); db.AddOutParameter(command, "@result", DbType.Boolean, 2); db.ExecuteNonQuery(command); bool result = false; result = bool.Parse(db.GetParameterValue(command, "@result").ToString()); return result; }
public bool UpdateTask(TaskEntity taskEntity) { return taskDao.UpdateTask(taskEntity); }
public bool IsWithinValidTimeFrameOnUpdate(TaskEntity taskEntity) { return taskDao.IsWithinValidTimeFrameOnUpdate(taskEntity); }
public Guid InsertTask(TaskEntity taskEntity) { return taskDao.InsertTask(taskEntity); }
public DataSet CalculateTask(TaskEntity taskEntity) { return taskDao.CalculateTask(taskEntity); }