Exemple #1
0
        public void SaveStaff(Staff staff)
        {
            using (var dbContext = new OADbContext())
            {

                if (staff.ID > 0)
                {
                    dbContext.Update<Staff>(staff);
                }
                else
                {
                    dbContext.Insert<Staff>(staff);
                }
            }
        }
Exemple #2
0
 public void SaveBranch(Branch branch)
 {
     using (var dbContext = new OADbContext())
     {
         if (branch.ID > 0)
         {
             dbContext.Update<Branch>(branch);
         }
         else
         {
             dbContext.Insert<Branch>(branch);
         }
     }
 }