// get uninterested in a theme category. public void getUninterestedThemeCategory(CategoriasTematica themeCategory) { // remove interest from the database. try { IndignadoDBDataContext indignadoContext = new IndignadoDBDataContext(); indignadoContext.ExecuteCommand("DELETE FROM Intereses WHERE (idCategoriaTematica = {0}) AND (idUsuario = {1})", themeCategory.id, UserInfo.Id); indignadoContext.SubmitChanges(); } catch (Exception error) { } }
// adds a new theme category. public void addThemeCategory(CategoriasTematica themeCategory) { // set foreign ids themeCategory.idMovimiento = IdMovement; // add the theme category to the database try { IndignadoDBDataContext indignadoContext = new IndignadoDBDataContext(); indignadoContext.CategoriasTematicas.InsertOnSubmit(themeCategory); indignadoContext.SubmitChanges(); } catch (Exception error) { } }
// get interested in a theme category. public void getInterestedThemeCategory(CategoriasTematica themeCategory) { // create an interest Interese interest = new Interese(); interest.idCategoriaTematica = themeCategory.id; interest.idUsuario = UserInfo.Id; // add interest to the database. try { IndignadoDBDataContext indignadoContext = new IndignadoDBDataContext(); indignadoContext.Intereses.InsertOnSubmit(interest); indignadoContext.SubmitChanges(); } catch (Exception error) { } }
public static DTThemeCategoryMeetings ThemeCategoryToDTMeetings(CategoriasTematica themeCategory) { DTThemeCategoryMeetings dtThemeCategory = new DTThemeCategoryMeetings(); dtThemeCategory.id = themeCategory.id; dtThemeCategory.idMovement = themeCategory.idMovimiento; dtThemeCategory.title = themeCategory.titulo; dtThemeCategory.description = themeCategory.descripcion; dtThemeCategory.myInterest = (themeCategory.miInteres == null) ? 0 : themeCategory.miInteres.Value; return dtThemeCategory; }
public static CategoriasTematica DTToThemeCategory(DTThemeCategory dtThemeCategory) { CategoriasTematica themeCategory = new CategoriasTematica(); themeCategory.id = dtThemeCategory.id; themeCategory.idMovimiento = dtThemeCategory.idMovement; themeCategory.titulo = dtThemeCategory.title; themeCategory.descripcion = dtThemeCategory.description; themeCategory.miInteres = dtThemeCategory.myInterest; return themeCategory; }
partial void DeleteCategoriasTematica(CategoriasTematica instance);
partial void UpdateCategoriasTematica(CategoriasTematica instance);
partial void InsertCategoriasTematica(CategoriasTematica instance);
private void detach_CategoriasTematicas(CategoriasTematica entity) { this.SendPropertyChanging(); entity.Movimiento = null; }
// removes a current theme category. public bool removeThemeCategory(CategoriasTematica themeCategory) { try { IndignadoDBDataContext indignadoContext = new IndignadoDBDataContext(); indignadoContext.ExecuteCommand("DELETE FROM CategoriasTematicas WHERE (id = {0})", themeCategory.id); return true; } catch { return false; } }