Beispiel #1
0
        public static void AddOrUpdate(SpareEntities db, TA_WORKLINE selectedData, TS_OPERATOR oper)
        {
            var logType = db.TA_WORKLINE.Any(p => p.UID == selectedData.UID) ? LogType.BaseDataModify : LogType.BaseDataCreate;

            try
            {
                db.TA_WORKLINE.AddOrUpdate(p => p.WorklineCode, selectedData);
                OperLogController.AddLog(db, logType, oper.OperName, selectedData.ToString());
            }
            catch (DbEntityValidationException dbEx)
            {
                Console.WriteLine(dbEx.ToString());
                throw;
            }
        }
Beispiel #2
0
 public static void Delete(SpareEntities db, TA_WORKLINE data, TS_OPERATOR oper)
 {
     db.Entry(data).State = EntityState.Deleted;
     OperLogController.AddLog(db, LogType.BaseDataDelete, oper.OperName, data.ToString());
 }