public override IList GetItem(List <WACParameter> parms, IList list) { List <FarmBusiness> ilist = list as List <FarmBusiness>; int key = WACGlobal_Methods.KeyAsInt(WACParameter.GetSelectedKey(parms).ParmValue); return(ilist.Where(w => w.pk_farmBusiness == key).ToList()); }
private void _connect(Control _control, ConnectorFactory _factory, WACViewModel _containerViewModel) { if (ViewModel == null) { ViewModel = GetViewModel(_control, _factory); } if (String.IsNullOrEmpty(ViewModel.UserName)) { ViewModel.UserName = _control.Page.Session["userName"] as string; ViewModel.UserID = WACGlobal_Methods.KeyAsInt(_control.Page.Session["userID"]); } if (_containerViewModel == null) { ViewModel.DataProvider = GetDataProvider(_control, _factory); } else { ViewModel.DataProvider = _containerViewModel.DataProvider; ViewModel.ListSource = _containerViewModel.ListSource; } if (SessionID == null) { SessionID = _control.Page.Session.SessionID; } else if (!_control.Page.Session.SessionID.Equals(SessionID, StringComparison.OrdinalIgnoreCase)) { throw new Exception("Connector / Control SessionID mismatch"); } ConnectControlSpecific(_control, _factory); }
public override IList GetItem(List <WACParameter> parms, IList list) { List <ParticipantCommunication> ilist = list as List <ParticipantCommunication>; int key = WACGlobal_Methods.KeyAsInt(WACParameter.GetSelectedKey(parms).ParmValue); return(ilist.Where(w => w.pk_participantCommunication == key).ToList()); }
public override IList GetItem(List <WACParameter> parms, IList list) { List <SupplementalAgreement> ilist = list as List <SupplementalAgreement>; int key = WACGlobal_Methods.KeyAsInt(WACParameter.GetSelectedKey(parms).ParmValue); return(ilist.Where(w => w.pk_supplementalAgreement == key).ToList()); }
public override IList GetFilteredList(List <WACParameter> parms) { try { using (WACDataClassesDataContext wac = new WACDataClassesDataContext()) { int pk_participantCommunication = WACGlobal_Methods.KeyAsInt(WACParameter.GetSelectedKey(parms).ParmValue); var e = wac.participantCommunications.Where(w => w.pk_participantCommunication == pk_participantCommunication).Select(s => new ParticipantCommunication(s.pk_participantCommunication, s.fk_participant, s.fk_communication, s.fk_communicationType_code, s.fk_communicationUsage_code, s.fk_organization, s.extension, s.note, s.source, s.created, s.created_by, s.modified, s.modified_by)); if (e.Any()) { return(e.ToList <ParticipantCommunication>()); } else { return(new List <ParticipantCommunication>()); } } } catch (Exception ex) { throw new WACEX_GeneralDatabaseException("Error loading ParticipantCommunication. " + ex.Message, -1); } }
public override IList GetFilteredList(List <WACParameter> parms) { try { using (WACDataClassesDataContext wac = new WACDataClassesDataContext()) { int pk_participant = WACGlobal_Methods.KeyAsInt(WACParameter.GetPrimaryKey(parms).ParmValue); var e = wac.participants.Where(w => w.pk_participant == pk_participant).Select(s => new Participant(s.pk_participant, s.lname, s.fname, s.email, s.fk_gender_code, s.list_gender.gender, s.fk_ethnicity_code, s.list_ethnicity.ethnicity, s.fk_race_code, s.list_race.race, s.fk_diversityData_code, s.list_diversityData.dataSetVia, s.fk_mailingStatus_code, s.list_mailingStatus.status, s.fk_property, s.fk_organization, s.organization.org, s.active, s.form_W9_signed_date, s.fk_regionWAC_code, s.list_regionWAC.regionWAC, s.fk_prefix_code, s.list_prefix.prefix, s.mname, s.nickname, s.fk_suffix_code, s.list_suffix.suffix, s.fullname_LF_dnd, s.fullname_FL_dnd, s.web, s.fk_dataReview_code, s.dataReview_note, s.fk_participant_split)); if (e.Any()) { return(e.ToList <Participant>()); } else { return(new List <Participant>()); } } } catch (Exception ex) { throw new WACEX_GeneralDatabaseException("Error loading Participant. " + ex.Message, -1); } }
public override IList GetFilteredList(List <WACParameter> parms) { try { using (WACDataClassesDataContext wac = new WACDataClassesDataContext()) { int pk_participantProperty = WACGlobal_Methods.KeyAsInt(WACParameter.GetSelectedKey(parms).ParmValue); var e = wac.participantProperties.Where(w => w.pk_participantProperty == pk_participantProperty).Select(s => new ParticipantProperty(s.pk_participantProperty, s.fk_participant, s.fk_participant_cc, s.fk_property, s.master, s.created, s.created_by, s.modified, s.modified_by)); if (e.Any()) { return(e.ToList <ParticipantProperty>()); } else { return(new List <ParticipantProperty>()); } } } catch (Exception ex) { throw new WACEX_GeneralDatabaseException("Error loading Participant Properties. " + ex.Message, -1); } }
public override IList GetItem(List <WACParameter> parms, IList list) { if (list == null) { list = GetFilteredList(parms); } List <TaxParcelOwner> ilist = list as List <TaxParcelOwner>; return(ilist.Where(w => w.pk_taxParcelOwner == WACGlobal_Methods.KeyAsInt(WACParameter.GetParameterValue(parms, TaxParcelOwner.PrimaryKeyName))).ToList()); }
public override IList GetItem(List <WACParameter> parms, IList list) { if (list == null) { list = GetFilteredList(parms); } List <TaxParcel> ilist = list as List <TaxParcel>; return(ilist.Where(w => w.pk_taxParcel == WACGlobal_Methods.KeyAsInt(WACParameter.GetParameterValue(parms, WACParameter.ParameterType.SelectedKey))).ToList()); }
public override IList <DDLListItem> GetList(List <WACParameter> parms) { int _pkCounty = WACGlobal_Methods.KeyAsInt(WACParameter.GetParameterValue(parms, "pk_list_countyNY")); using (WACDataClassesDataContext wac = new WACDataClassesDataContext()) { var c = wac.vw_taxParcel_jurisdictions.Where(w => w.pk_list_countyNY == _pkCounty).Distinct((x, y) => x.Jurisdiction == y.Jurisdiction). OrderBy(o => o.Jurisdiction).Select(s => new DDLListItem(s.SWIS, s.Jurisdiction)); return(c.ToList()); } }
public override IList <DDLListItem> GetList(List <WACParameter> parms) { int fk_County = WACGlobal_Methods.KeyAsInt(WACParameter.GetParameterValue(parms, "pk_County")); using (WACDataClassesDataContext wac = new WACDataClassesDataContext()) { if (fk_County > 0) { var x = wac.list_basins.Where(w => w.list_countyNYBasins.Any(a => a.fk_list_countyNY == fk_County)).OrderBy(o => o.basin).Select(s => new DDLListItem(s.pk_basin_code, s.basin)); return(x.ToList()); } else { var x = wac.list_basins.OrderBy(o => o.basin).Select(s => new DDLListItem(s.pk_basin_code, s.basin)); return(x.ToList()); } } }
public override void OpenDefaultDataView(List <WACParameter> parms) { BindOrganization(WACGlobal_Methods.KeyAsInt(WACParameter.GetParameterValue(parms, WACParameter.ParameterType.PrimaryKey))); }
public void PageGridView(GridView gv, List <WACParameter> parms) { gv.PageIndex = WACGlobal_Methods.KeyAsInt(WACParameter.GetParameterValue(parms, WACParameter.ParameterType.ListPage)); BindGridView(gv); }
private IList GetList(object key, AssociationLoader _loader) { primaryKey = WACGlobal_Methods.KeyAsInt(key); _loader(primaryKey); return(associations); }