コード例 #1
0
ファイル: TaskDao.cs プロジェクト: nirshandileep/DairyManager
        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;
        }
コード例 #2
0
ファイル: TaskDao.cs プロジェクト: nirshandileep/DairyManager
        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);
        }
コード例 #3
0
ファイル: TaskDao.cs プロジェクト: nirshandileep/DairyManager
        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;
        }
コード例 #4
0
ファイル: Task.cs プロジェクト: nirshandileep/DairyManager
 public bool UpdateTask(TaskEntity taskEntity)
 {
     return taskDao.UpdateTask(taskEntity);
 }
コード例 #5
0
ファイル: Task.cs プロジェクト: nirshandileep/DairyManager
 public bool IsWithinValidTimeFrameOnUpdate(TaskEntity taskEntity)
 {
     return taskDao.IsWithinValidTimeFrameOnUpdate(taskEntity);
 }
コード例 #6
0
ファイル: Task.cs プロジェクト: nirshandileep/DairyManager
 public Guid InsertTask(TaskEntity taskEntity)
 {
     return taskDao.InsertTask(taskEntity);
 }
コード例 #7
0
ファイル: Task.cs プロジェクト: nirshandileep/DairyManager
 public DataSet CalculateTask(TaskEntity taskEntity)
 {
     return taskDao.CalculateTask(taskEntity);
 }