override public String EvaluateDataBinding(String bindingContext) { String dataValue = String.Empty; String bindingContextPart = bindingContext.Split('.')[0]; switch (bindingContextPart) { case "EnrollmentId": // BACKWARDS COMPATIBILITY case "MemberEnrollment": dataValue = memberEnrollmentId.ToString(); break; case "PcpProviderId": dataValue = pcpProviderId.ToString(); break; case "ProviderAffiliationId": dataValue = providerAffiliationId.ToString(); break; case "EffectiveDate": dataValue = effectiveDate.ToString("MM/dd/yyyy"); break; case "TerminationDate": dataValue = terminationDate.ToString("MM/dd/yyyy"); break; case "PcpProvider": #region PCP Provider if (PcpProvider == null) { return("!Error"); } dataValue = PcpProvider.EvaluateDataBinding(bindingContext.Replace(bindingContextPart + ".", "")); #endregion break; case "ProviderAffiliation": #region PCP Affiliation if (ProviderAffiliation == null) { return("!Error"); } dataValue = ProviderAffiliation.EvaluateDataBinding(bindingContext.Replace(bindingContextPart + ".", "")); #endregion break; default: dataValue = base.EvaluateDataBinding(bindingContext); break; } return(dataValue); }
public void Delete(ProviderAffiliation entity) { var data = (from proAff in _context.ProviderAffiliations where proAff.ProviderId == entity.ProviderId && proAff.AffiliationId == entity.AffiliationId select proAff).FirstOrDefault(); if (data != null) { _context.ProviderAffiliations.Remove(data); } else { throw new Exception("Affiliation does not exist."); } }
public void AddProviderAffiliation(ProviderAffiliation entity) { var affiliation = (from proAff in _context.ProviderAffiliations join aff in _context.Affiliations on proAff.AffiliationId equals aff.AffiliationId where proAff.ProviderId == entity.ProviderId && aff.AffiliationId == entity.AffiliationId select proAff).FirstOrDefault(); if (affiliation == null) { _context.ProviderAffiliations.Add(entity); } else { throw new Exception("Affiliation already added"); } }