Exemple #1
0
 public ActionResult Edit([Bind(Include = "Id,Email,EmailConfirmed,PasswordHash,SecurityStamp,PhoneNumber,PhoneNumberConfirmed,TwoFactorEnabled,LockoutEndDateUtc,LockoutEnabled,AccessFailedCount,UserName")] ApplicationUser applicationUser)
 {
     if (ModelState.IsValid)
     {
         db.Entry(applicationUser).State = EntityState.Modified;
         db.SaveChanges();
         _logRepo.Create(new Log()
         {
             Usuario = applicationUser,
             Acao    = "Editado",
             Data    = DateTime.Now
         });
         return(RedirectToAction("Index"));
     }
     return(View(applicationUser));
 }
Exemple #2
0
        private static void OnRenamed(object source, RenamedEventArgs e)
        {
            var o = e.OldName;
            var n = e.Name;

            LogRepo.Create(Timestamp.Now, e.ChangeType.ToString(), e.FullPath, e.OldName);
            ConsoleLogger.Log(Timestamp.Now + " File: {0} renamed to {1}", o, n);
        }
Exemple #3
0
 private static void OnChanged(object source, FileSystemEventArgs e)
 {
     //<<<<<<<<<<TODO>>>>>>>>>>>>
     //if file = text lo posso leggere
     //tell to signalr
     //distingui r/rw/eccetera
     //recupera IDseriale della macchina
     //<<<<<<<<<<OOOO>>>>>>>>>>>>
     LogRepo.Create(Timestamp.Now, e.ChangeType.ToString(), e.FullPath);
     ConsoleLogger.Log("Directory Watcher >> File: {0} {1} ", e.FullPath, e.ChangeType);
 }
Exemple #4
0
 private static void OnChanged(object source, FileSystemEventArgs e)
 {
     //<<<<<<<<<<TODO>>>>>>>>>>>>
     //if file = text lo posso leggere
     //tell to signalr
     //distingui r/rw/eccetera
     //recupera IDseriale della macchina
     //<<<<<<<<<<OOOO>>>>>>>>>>>>
     LogRepo.Create(Timestamp.Now, e.ChangeType.ToString(), e.FullPath);
     //Console.WriteLine(Timestamp.Now  + " File: " + e.FullPath + " " + e.ChangeType);
 }
Exemple #5
0
        public static void log(BaseController baseController, Product productImport = null)
        {
            string ip         = baseController.Request.UserHostAddress;
            string email      = (string)(baseController.Session["User"] ?? "Anonymous");
            string action     = baseController.ControllerContext.RouteData.Values["action"].ToString();
            string controller = baseController.ControllerContext.RouteData.Values["controller"].ToString();
            string httpMethod = baseController.ControllerContext.HttpContext.Request.HttpMethod;

            string param = "";

            if (productImport == null)
            {
                param = getParam(baseController);
            }
            else
            {
                param = getParam(baseController, productImport);
            }

            if (baseController.ModelState.Keys.Count > 0)
            {
                foreach (string key in baseController.ModelState.Keys)
                {
                    string value = baseController.ModelState[key].Value.AttemptedValue;
                    param = param + "" + key + "=" + value + ",  ";
                }
            }

            DateTime now  = DateTime.Now;
            long     time = now.Ticks;

            var logRepo = new LogRepo();
            Log log     = new Log
            {
                Id         = 0,
                Date       = time,
                Username   = email,
                IP         = ip,
                Controller = controller,
                Action     = action,
                HttpMethod = httpMethod,
                Params     = param
            };

            logRepo.Create(log);
        }