Example #1
0
 public bool Save()
 {
     if (_db.SaveChanges() > 0)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Example #2
0
 private static void SaveChangeToDatabase(Microsoft.EntityFrameworkCore.DbContext context)
 {
     try
     {
         context.SaveChanges();
     }
     catch (Exception e)
     {
         Console.WriteLine(e.GetBaseException());
     }
 }
Example #3
0
        protected override void AfterInsert(RfidCard item, Microsoft.EntityFrameworkCore.DbContext dbContext)
        {
            CardIssue issue = new CardIssue();

            issue.CardNo = item.RfidNo;
            issue.CardId = item.RecordId;

            issue.WorkstationId   = -1;
            issue.WorkstationCode = "";
            issue.WorkstationName = "";

            SystemUser currentUser = GlobalConstants.GetCurrentUser();

            issue.IssueUserId   = currentUser.RecordId;
            issue.IssueUserCode = currentUser.UserCode;
            issue.IssueUserName = currentUser.UserName;

            issue.IssueQty = item.IssueQty;

            dbContext.Add(issue);
            dbContext.SaveChanges();
        }
Example #4
0
 /// <summary>
 /// Saves the changes.
 /// </summary>
 public void SaveChanges()
 {
     _context.SaveChanges();
 }