public void Post(UserEventsRequest model) { DataProvider.ExecuteNonQuery(GetConnection, "dbo.UserEvents_Insert" , inputParamMapper : delegate(SqlParameterCollection paramCollection) { //([RsvpStatus] //,[EventId] //,[UserId]) paramCollection.AddWithValue("@RsvpStatus", model.RsvpStatus); paramCollection.AddWithValue("@EventId", model.EventId); paramCollection.AddWithValue("@UserId", model.UserId); }, returnParameters : delegate(SqlParameterCollection param) { } ); //Create SystemEvents post for RSVP to event for recent activity feed //getting all event info - passing only event creator userid to SystemEvents Events e = EventsService.GetById(model.EventId); SystemEventsRequest newModel = new SystemEventsRequest(); newModel.ActorUserId = model.UserId; newModel.TargetId = model.EventId; newModel.EventType = SystemEventTypes.NewRSVP; newModel.TargetUserId = e.UserId; SystemEventsService.Post(newModel); }
public static int Post(EventsRequest model) { int outputId = 0; DataProvider.ExecuteNonQuery(GetConnection, "dbo.Events_Insert" , inputParamMapper : delegate(SqlParameterCollection paramCollection) { paramCollection.AddWithValue("@UserId", model.UserId); paramCollection.AddWithValue("@Title", model.Title); paramCollection.AddWithValue("@Description", model.Description); paramCollection.AddWithValue("@Start", model.Start); paramCollection.AddWithValue("@End", model.End); paramCollection.AddWithValue("@EventType", model.EventType); paramCollection.AddWithValue("@IsPublic", model.IsPublic); paramCollection.AddWithValue("@ExternalEventId", model.ExternalEventId); SqlParameter p = new SqlParameter("@Id", System.Data.SqlDbType.Int); p.Direction = System.Data.ParameterDirection.Output; paramCollection.Add(p); // adding new paramerter SqlParameter s = new SqlParameter("@TagsId", SqlDbType.Structured); if (model.Tags != null && model.Tags.Any()) { s.Value = new IntIdTable(model.Tags); } paramCollection.Add(s); }, returnParameters : delegate(SqlParameterCollection param) { int.TryParse(param["@Id"].Value.ToString(), out outputId); } ); //creating SystemEvents post for new Public Events for recent activity feed if (model.IsPublic) { SystemEventsRequest newModel = new SystemEventsRequest(); newModel.ActorUserId = model.UserId; newModel.EventType = SystemEventTypes.NewEvent; newModel.TargetId = outputId; SystemEventsService.Post(newModel); } return(outputId); }
public static int Post(UsersProfilesRequest model) { int OutputId = 0; DataProvider.ExecuteNonQuery(GetConnection, "dbo.UserProfile_Insert" , inputParamMapper : delegate(SqlParameterCollection paramCollection) { paramCollection.AddWithValue("@profileName", model.profileName); paramCollection.AddWithValue("@profileEmail", model.profileEmail); paramCollection.AddWithValue("@profilePhone", model.profilePhone); paramCollection.AddWithValue("@profileMobile", model.profileMobile); paramCollection.AddWithValue("@profileWebsite", model.profileWebsite); paramCollection.AddWithValue("@profileAddress", model.profileAddress); paramCollection.AddWithValue("@profileCompany", model.profileCompany); paramCollection.AddWithValue("@userId", model.userId); paramCollection.AddWithValue("@Tagline", model.Tagline); SqlParameter p = new SqlParameter("@Id", System.Data.SqlDbType.Int); p.Direction = System.Data.ParameterDirection.Output; paramCollection.Add(p); }, returnParameters : delegate(SqlParameterCollection param) { int.TryParse(param["@Id"].Value.ToString(), out OutputId); } ); //creating SystemEvents post for recent activity feed SystemEventsRequest newModel = new SystemEventsRequest(); newModel.ActorUserId = model.userId; newModel.EventType = SystemEventTypes.NewRegister; SystemEventsService.Post(newModel); return(OutputId); }