Exemplo n.º 1
0
        public static void AddOrUpdate(SpareEntities db, TA_STORE_WHSE data, TS_OPERATOR oper)
        {
            var logType = db.TA_STORE_WHSE.Any(p => p.UID == data.UID) ? LogType.BaseDataModify : LogType.BaseDataCreate;

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