コード例 #1
0
 public bool Save()
 {
     if (_db.SaveChanges() > 0)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
コード例 #2
0
 private static void SaveChangeToDatabase(Microsoft.EntityFrameworkCore.DbContext context)
 {
     try
     {
         context.SaveChanges();
     }
     catch (Exception e)
     {
         Console.WriteLine(e.GetBaseException());
     }
 }
コード例 #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();
        }
コード例 #4
0
 /// <summary>
 /// Saves the changes.
 /// </summary>
 public void SaveChanges()
 {
     _context.SaveChanges();
 }