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);
        }
Esempio n. 3
0
 //Update Batches
 public bool Update(Batch batch)
 {
     db.Entry(batch).State = EntityState.Modified;
     return(db.SaveChanges() > 0);
 }
Esempio n. 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));
        }
Esempio n. 5
0
 public void AddToBatch(Batch batch)
 {
     UpdateText = $@"UPDATE ESRTransactions SET BatchID = '{batch.ID}' WHERE ID = '{ID}';";
     new Database(this).UpdateEntry(this);
 }
Esempio n. 6
0
 public void CompleteBatchTransactions(Batch batch)
 {
     UpdateText = $@"UPDATE ESRTransactions SET Complete = 'True' WHERE BatchID = '{batch.ID}';";
     new Database(this).UpdateEntry(this);
 }
Esempio n. 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));
        }