public bool DeleteAfhang(ClubCloud_Afhang entity, ClubCloud_Setting settings = null) { if (settings != null) { ValidateSettings(ref settings); } return(DeleteAfhangById(entity.Id, settings)); }
public ClubCloud_Vereniging GetVerenigingForAfhangById(System.Guid Id, bool refresh = false, ClubCloud_Setting settings = null) { if (settings != null) { ValidateSettings(ref settings); } ClubCloud_Afhang entity = null; ClubCloud_Vereniging result = null; using (new SPMonitoredScope("Afhangen GetVerenigingForAfhangById")) { try { entity = beheerModel.ClubCloud_Afhangen.Find(Id); if (entity != null && entity.ClubCloud_Vereniging == null) { beheerModel.Entry(entity).Reference(e => e.ClubCloud_Vereniging).Load(); } if (entity != null) { result = entity.ClubCloud_Vereniging; } if (result == null || refresh) { result = GetVerenigingForAfhangById(settings.Id.ToString(), Id, refresh, settings); } if (result != null) { return(result); } } catch (Exception ex) { Logger.WriteLog(Logger.Category.Unexpected, ex.Source, ex.Message); } finally { if (entity != null) { try { beheerModel.ObjectContext.Detach(entity); } catch {} } if (result != null) { try { beheerModel.ObjectContext.Detach(result); } catch {} } } } return(new ClubCloud_Vereniging()); }
public bool SetVerenigingForAfhangById(ClubCloud_Vereniging Vereniging, System.Guid Id, bool refresh = false, ClubCloud_Setting settings = null) { if (settings != null) { ValidateSettings(ref settings); } ClubCloud_Afhang entity = null; bool succes = false; using (new SPMonitoredScope("Afhangen SetVerenigingForAfhangById")) { try { entity = beheerModel.ClubCloud_Afhangen.Find(Id); if (entity != null && entity.ClubCloud_Vereniging == null) { beheerModel.Entry(entity).Reference(e => e.ClubCloud_Vereniging).Load(); } if (entity != null) { entity.ClubCloud_Vereniging = Vereniging; } beheerModel.SaveChanges(); succes = true; } catch (Exception ex) { Logger.WriteLog(Logger.Category.Unexpected, ex.Source, ex.Message); } finally { if (entity != null) { try { beheerModel.ObjectContext.Detach(entity); } catch {} } } } return(succes); }
public async Task <Afhang> GetVerenigingSettingsAsync(Guid verenigingId) { Afhang afhang = new Afhang { Id = Guid.NewGuid(), VerenigingId = verenigingId }; ObservableCollection <ClubCloud_Afhang> ccAfhangen = await client.GetVerenigingAfhangSettingsAsync("00000000", verenigingId, false); ClubCloud_Afhang ccAfhang = ccAfhangen.FirstOrDefault(); if (ccAfhang != null) { afhang = new Afhang { Id = ccAfhang.Id, VerenigingId = ccAfhang.VerenigingId, BaanBegin = ccAfhang.BaanBegin, BaanEinde = ccAfhang.BaanEinde, Duur_Drie = ccAfhang.Duur_Drie, Duur_Een = ccAfhang.Duur_Een, Duur_Precisie = ccAfhang.Duur_Precisie, Duur_Twee = ccAfhang.Duur_Twee, Duur_Vier = ccAfhang.Duur_Vier, MaandBegin = ccAfhang.MaandBegin, MaandEinde = ccAfhang.MaandEinde } } ; return(afhang); }
public ClubCloud_Afhang SetAfhang(ClubCloud_Afhang entity, ClubCloud_Setting settings = null) { if (settings != null) { ValidateSettings(ref settings); } ClubCloud_Afhang tobeupdated = null; using (new SPMonitoredScope("Afhangen SetAfhang")) { try { entity = SetAfhang(settings.Id.ToString(), entity, settings); if (entity != null) { beheerModel.ClubCloud_Afhangen.AddOrUpdate(entity); } beheerModel.SaveChanges(); tobeupdated = beheerModel.ClubCloud_Afhangen.Find(entity.Id); return(tobeupdated); } catch (Exception ex) { Logger.WriteLog(Logger.Category.Unexpected, ex.Source, ex.Message); } finally { if (tobeupdated != null) { try { beheerModel.ObjectContext.Detach(tobeupdated); } catch {} } } } return(null); }
public bool DeleteAfhangById(System.Guid Id, ClubCloud_Setting settings = null) { if (settings != null) { ValidateSettings(ref settings); } bool succes = false; ClubCloud_Afhang tobedeleted = null; using (new SPMonitoredScope("Afhangen DeleteAfhangById")) { try { tobedeleted = beheerModel.ClubCloud_Afhangen.Find(Id); if (tobedeleted != null) { beheerModel.ClubCloud_Afhangen.Remove(tobedeleted); beheerModel.SaveChanges(); } succes = true; } catch (Exception ex) { Logger.WriteLog(Logger.Category.Unexpected, ex.Source, ex.Message); } finally { if (tobedeleted != null) { try { beheerModel.ObjectContext.Detach(tobedeleted); } catch {} } } } return(succes); }
protected void aantal_TextChanged(object sender, EventArgs e) { ClubCloud_Vereniging vereniging = Client.GetVerenigingByNummer("0000000", "82503", false); ClubCloud_Afhang settings = Client.GetVerenigingAfhangSettings("00000000", vereniging.Id, false); //Client.VerenigingenUpdate("12073385", true); }