Exemple #1
0
 private void updateDVh(IAudit model)
 {
     try
     {
         generateDVh(model);
         Type     type      = model.GetType();
         string   tableName = getTableName(type);
         AuditDvh dvh       = findDV(tableName, model.id.ToString());
         if (dvh == null)
         {
             dvh = new AuditDvh(tableName, model.id.ToString(), model.dv);
             db.DVHs.Add(dvh);
         }
         else
         {
             dvh.dv = model.dv;
             db.Entry(dvh).State = EntityState.Modified;
         }
         db.SaveChanges();
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
     }
 }
Exemple #2
0
 private AuditDvh findDV(string tableName, string id)
 {
     try
     {
         AuditDvh result = db.DVHs.Where(x => x.tableName == tableName && x.id == id).FirstOrDefault();
         return(result);
     }
     catch (Exception err)
     {
     }
     return(null);
 }
Exemple #3
0
        public bool validateDVv(string tableName, string dvv)
        {
            bool result = true;

            dvv = Cryptog.EncriptarMD5(dvv);
            AuditDvh currentDv = findDV(tableName, "DVV");

            if (currentDv != null)
            {
                result = dvv == currentDv.dv;
            }
            else
            {
                result = false;
            }
            return(result);
        }
Exemple #4
0
        public bool validateDVh(IAudit model)
        {
            bool   result    = true;
            Type   type      = model.GetType();
            string tableName = getTableName(type);

            model.dv = generateDVh(model);
            AuditDvh currentDv = findDV(tableName, model.id.ToString());

            if (currentDv != null)
            {
                result = model.dv == currentDv.dv;
            }
            else
            {
                result = false;
            }

            return(result);
        }
Exemple #5
0
 private void updateDVv(string tableName, string dvv)
 {
     try
     {
         dvv = Cryptog.EncriptarMD5(dvv);
         AuditDvh dv = findDV(tableName, "DVV");
         if (dv == null)
         {
             dv = new AuditDvh(tableName, "DVV", dvv);
             db.DVHs.Add(dv);
         }
         else
         {
             dv.dv = dvv;
             db.Entry(dv).State = EntityState.Modified;
         }
         db.SaveChanges();
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
     }
 }