Esempio n. 1
0
        /// <summary>
        /// Logs the action taken by the user by each controller
        /// </summary>
        /// <param name="action">The action to save in the table</param>
        public void logAction(string action)
        {
            IUser user = (IUser)HttpContext.Current.Session["User"];

            if (user == null)
                user = (IUser)COMET.Controllers.ContextController.getContext().Session["User"];

            ApplicationLog al = new ApplicationLog {
                Application_Name = (string)MainFactory.getConfiguration().get("application"),
                EmployeeID = user == null ? 0 : user.EmployeeID,
                LogTime = DateTime.Now,
                ActionTaken = action
            };

            try {
                using (UserDataContext dc = (UserDataContext) MainFactory.getDb("User", false)) {
                    dc.ApplicationLogs.InsertOnSubmit(al);
                    dc.SubmitChanges();
                }
            } catch (SqlException sqle) {
                logError("Logger", MethodBase.GetCurrentMethod().ToString(), sqle.ErrorCode.ToString(), "Unable to log Action: " + sqle.Message);
            }
        }
Esempio n. 2
0
 partial void DeleteApplicationLog(ApplicationLog instance);
Esempio n. 3
0
 partial void InsertApplicationLog(ApplicationLog instance);
Esempio n. 4
0
 partial void UpdateApplicationLog(ApplicationLog instance);
Esempio n. 5
0
		private void detach_ApplicationLogs(ApplicationLog entity)
		{
			this.SendPropertyChanging();
			entity.XXHR = null;
		}