Esempio n. 1
0
 public bool Update(int lineId, int assignId, string date)
 {
     try
     {
         var obj = Get(lineId, date);
         if (obj != null)
         {
             obj.AssignmentId = assignId;
             db.SaveChanges();
             return(true);
         }
         else
         {
             obj              = new P_HistoryPressedKeypad();
             obj.Id           = 0;
             obj.LineId       = lineId;
             obj.AssignmentId = assignId;
             obj.Date         = date;
             obj.IsDeleted    = false;
             Insert(obj);
         }
     }
     catch (Exception)
     { }
     return(false);
 }
Esempio n. 2
0
 public bool Insert(P_HistoryPressedKeypad objModel)
 {
     try
     {
         db.P_HistoryPressedKeypad.Add(objModel);
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     { }
     return(false);
 }