public bool AddBatch(Batch batch)
 {
     db.Batches.Add(batch);
     return(db.SaveChanges() > 0);
 }
        public Batch GetById(int id)
        {
            Batch batch = db.Batches.Find(id);

            return(batch);
        }
示例#3
0
 //Update Batches
 public bool Update(Batch batch)
 {
     db.Entry(batch).State = EntityState.Modified;
     return(db.SaveChanges() > 0);
 }
示例#4
0
        public async Task <IList <ESRTransaction> > GetBatchTransactions(Batch batch)
        {
            string Command = SelectBase().Append($@"WHERE BatchID = '{batch.ID}' ORDER BY Member ASC;").ToString();

            return(await GetTransactionsAsync(Command));
        }
示例#5
0
 public void AddToBatch(Batch batch)
 {
     UpdateText = $@"UPDATE ESRTransactions SET BatchID = '{batch.ID}' WHERE ID = '{ID}';";
     new Database(this).UpdateEntry(this);
 }
示例#6
0
 public void CompleteBatchTransactions(Batch batch)
 {
     UpdateText = $@"UPDATE ESRTransactions SET Complete = 'True' WHERE BatchID = '{batch.ID}';";
     new Database(this).UpdateEntry(this);
 }
示例#7
0
        public async Task <IList <Comment> > GetBatchComments(Batch batch)
        {
            string cmd = $@"SELECT CreatedBy, CreatedOn, CommentText, TransactionID, BatchID FROM Comments WHERE BatchID = '{batch.ID}' ORDER BY CreatedOn ASC;";

            return(await GetComments(cmd));
        }