Exemplo n.º 1
0
        internal void AddLogAction(string logID, string actionType)
        {
            try
            {
                ImpAccount_LogAction impAccount_LogAction = new ImpAccount_LogAction();
                Account_LogAction    account_LogAction    = new Account_LogAction();
                account_LogAction.DateLog = DateTime.Now;
                if (!string.IsNullOrEmpty(logID))
                {
                    account_LogAction.logActionID = logID;
                }
                else
                {
                    account_LogAction.logActionID = "";
                }

                account_LogAction.actionType = Convert.ToInt32(actionType);
                account_LogAction.IP         = Common.Common.GetIPHelper();
                account_LogAction.Username   = ((cms_Account)HttpContext.Session["UserInfo"]).Username;
                string url = HttpContext.Request.RawUrl.ToLower();
                account_LogAction.menu = url;

                impAccount_LogAction.InsertAccount_LogAction(account_LogAction);
            }
            catch { }
        }
Exemplo n.º 2
0
 public List <Account_LogAction> GetAllAccount_Log(DateTime dateTime, int page, int pageSize)
 {
     try
     {
         if (dateTime != null && page >= 0 && pageSize >= 0)
         {
             IEnumerable <Account_Log> model = dal.GetAllAccount_Log(dateTime, page, pageSize);
             List <Account_LogAction>  lst   = new List <Account_LogAction>();
             foreach (var item in model)
             {
                 Account_LogAction a = new Account_LogAction()
                 {
                     EmployeeName = item.Employee.EmployeeName,
                     Action       = item.Action,
                     IpAddress    = item.IpAddress,
                     Time         = item.Time.ToString()
                 };
                 lst.Add(a);
             }
             return(lst);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }