public void DeleteActivities(string ids) { OrganizeDataAccess oda = new OrganizeDataAccess(); string[] aId = ids.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); int tempID = 0; Activity oActivity; foreach (string id in aId) { try { tempID = Convert.ToInt32(id); } catch { continue; } oActivity = cda.GetActivityByID(tempID); cda.DeleteActivityParticipants(oActivity.ActivityParticipants.ToList()); List <OrganizeSchedular> events = oda.GetEventsByActivityID(oActivity.ID); oda.DeleteEvents(events); cda.DeleteActivity(oActivity); cda.Save(); } }
public bool updateToOrganize(int ActivityId, string start, string end, string title, string body, string color) { OrganizeDataAccess oda = new OrganizeDataAccess(); List <OrganizeSchedular> organizeSchedular = new List <OrganizeSchedular>(); organizeSchedular = oda.GetEventsByActivityID(ActivityId); oda.DeleteEvents(organizeSchedular); bool success = addToOrganize(ActivityId, start, end, title, body, color); oda.Save(); return(success); }
public bool updateToOrganize(int ActivityId, string start, string end, string title, string body, string color) { OrganizeDataAccess oda = new OrganizeDataAccess(); List<OrganizeSchedular> organizeSchedular = new List<OrganizeSchedular>(); organizeSchedular = oda.GetEventsByActivityID(ActivityId); oda.DeleteEvents(organizeSchedular); bool success = addToOrganize(ActivityId, start, end, title, body, color); oda.Save(); return success; }
public void DeleteActivities(string ids) { OrganizeDataAccess oda = new OrganizeDataAccess(); string[] aId = ids.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); int tempID = 0; Activity oActivity; foreach (string id in aId) { try { tempID = Convert.ToInt32(id); } catch { continue; } oActivity = cda.GetActivityByID(tempID); cda.DeleteActivityParticipants(oActivity.ActivityParticipants.ToList()); List<OrganizeSchedular> events = oda.GetEventsByActivityID(oActivity.ID); oda.DeleteEvents(events); cda.DeleteActivity(oActivity); cda.Save(); } }