public List<Alert> AddStatusUpdate(string Text, int AccountID) { if (IsValid()) { long alertID = 0; IUserSession userSession = ObjectFactory.GetInstance<IUserSession>(); IAlertService alertService = ObjectFactory.GetInstance<IAlertService>(); if (userSession.CurrentUser.AccountID == AccountID) { StatusUpdate su = new StatusUpdate(); su.CreateDate = DateTime.Now; su.AccountID = userSession.CurrentUser.AccountID; su.Status = Text; StatusUpdate.SaveStatusUpdate(su); alertID = alertService.AddStatusUpdateAlert(su); } else { alertID = alertService.AddAlertToWallFriend(Text, AccountID); } return alertService.GetAlertsByAlertID(alertID); } return null; }
public static void SaveStatusUpdate(StatusUpdate statusUpdate) { if (statusUpdate.StatusUpdateID > 0) { StatusUpdate.Update(statusUpdate); } else { statusUpdate.CreateDate = DateTime.Now; StatusUpdate.Add(statusUpdate); } }
public void AddStatus(string text) { StatusUpdate su = new StatusUpdate(); su.CreateDate = DateTime.Now; su.AccountID = _userSession.CurrentUser.AccountID; su.Status = text; StatusUpdate.SaveStatusUpdate(su); _alertService.AddStatusUpdateAlert(su); //_redirector.GoToHomePage(); ShowDisplay(); }