public bool LogActivity(string activity, string message, string ex)
    {
        if (LoggedInUser != null)
        {
            tblActivityLog model = new tblActivityLog();

            model.Activity = activity;
            model.ActivityDate = DateTime.Now;
            model.Exception = ex;
            model.IP = GetUserIP();
            model.Message = message;
            model.SessionID = Session.SessionID;
            model.UserID = LoggedInUser.ID;
            model.UserName = LoggedInUser.Name;
            model.URL = Request.Url.AbsoluteUri;

            ActivityLogBL bl = new ActivityLogBL();
            model = bl.AddActivityLog(model);
            return true;
        }
        else
        {
            return false;
        }
    }
 public tblActivityLog AddActivityLog(tblActivityLog model)
 {
     using (LoanPriceEntities context = new LoanPriceEntities())
     {
         context.tblActivityLogs.AddObject(model);
         context.SaveChanges();
         return model;
     }
 }
        public bool LogActivity(string activity, string message, string ex)
        {
            tblActivityLog model = new tblActivityLog();

            model.Activity = activity;
            model.ActivityDate = DateTime.Now;
            model.Exception = ex;

            model.Message = message;

            ActivityLogBL bl = new ActivityLogBL();
            model = bl.AddActivityLog(model);
            return true;
        }
 /// <summary>
 /// Create a new tblActivityLog object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="userID">Initial value of the UserID property.</param>
 /// <param name="userName">Initial value of the UserName property.</param>
 /// <param name="activity">Initial value of the Activity property.</param>
 /// <param name="activityDate">Initial value of the ActivityDate property.</param>
 /// <param name="sessionID">Initial value of the SessionID property.</param>
 /// <param name="iP">Initial value of the IP property.</param>
 /// <param name="uRL">Initial value of the URL property.</param>
 public static tblActivityLog CreatetblActivityLog(global::System.Int32 id, global::System.Int32 userID, global::System.String userName, global::System.String activity, global::System.DateTime activityDate, global::System.String sessionID, global::System.String iP, global::System.String uRL)
 {
     tblActivityLog tblActivityLog = new tblActivityLog();
     tblActivityLog.ID = id;
     tblActivityLog.UserID = userID;
     tblActivityLog.UserName = userName;
     tblActivityLog.Activity = activity;
     tblActivityLog.ActivityDate = activityDate;
     tblActivityLog.SessionID = sessionID;
     tblActivityLog.IP = iP;
     tblActivityLog.URL = uRL;
     return tblActivityLog;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the tblActivityLogs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTotblActivityLogs(tblActivityLog tblActivityLog)
 {
     base.AddObject("tblActivityLogs", tblActivityLog);
 }