public void Connect(Control _control, ConnectorFactory _factory)
        {
            WACControl          myContainer           = null;
            WACControlConnector myContainersConnector = null;

            try { myContainer = (WACControl)WACNamingContainer(_control); } catch (Exception) { }
            if (myContainer != null)
            {
                myContainersConnector = getConnector(myContainer, _factory);
            }
            if (myContainersConnector != null)
            {
                myContainersConnector.TryAdd((WACControl)_control);
            }
            if (ServiceFactory.IsDisconnectedControl(_control))
            {
                return;
            }
            if (ServiceFactory.IsIndependentControl(_control))
            {
                _connect(_control, _factory, null);
            }
            else
            {   // Dependent
                if (myContainersConnector != null)
                {
                    if (myContainersConnector.ViewModel == null)
                    {
                        myContainersConnector.Connect(myContainer, _factory);
                    }
                    _connect(_control, _factory, myContainersConnector.ViewModel);
                }
            }
            this.ContainedControls = getContents(_control, this);
        }
 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);
 }
Esempio n. 3
0
        public override void ConnectControlSpecific(Control _control, ConnectorFactory _factory)
        {
            WACPR_TaxParcelFormVM vm = (WACPR_TaxParcelFormVM)ViewModel;

            if (vm.TaxParcelValidator == null)
            {
                vm.TaxParcelValidator = _factory.CreateValidator("WACPR_TaxParcelValidator") as WACPR_TaxParcelValidator;
            }
        }
        public override void ConnectControlSpecific(Control _control, ConnectorFactory _factory)
        {
            WACPR_TaxParcelOwnerContainerVM vm = ViewModel as WACPR_TaxParcelOwnerContainerVM;

            if (vm.ListSource == null)
            {
                vm.ListSource = new MasterDetailDataObject(TaxParcelOwner.MasterKeyName, TaxParcelOwner.PrimaryKeyName);
            }
        }
Esempio n. 5
0
        public override void ConnectControlSpecific(Control _control, ConnectorFactory _factory)
        {
            WACListViewModel vm = ViewModel as WACListViewModel;

            if (vm.ListSource == null)
            {
                vm.ListSource = new MasterDetailDataObject(ParticipantWAC.PrimaryKeyName, ParticipantWAC.PrimaryKeyName);
            }
        }
Esempio n. 6
0
        public override void ConnectControlSpecific(Control _control, ConnectorFactory _factory)
        {
            WACPR_TaxParcelFilterVM vm = ViewModel as WACPR_TaxParcelFilterVM;

            if (vm.DDLBinders.Count < 1)
            {
                vm.DDLBinders.TryAdd("ddlTaxParcelID", new DDLDataObject(new TaxParcelIDDP()));
                vm.DDLBinders.TryAdd("ddlSBL", new DDLDataObject(new TaxParcelSBLDP()));
            }
        }
        public override void ConnectControlSpecific(Control _control, ConnectorFactory _factory)
        {
            WACViewModel vm = ViewModel;
            WACUT_AttachedDocumentViewerDP dp = (WACUT_AttachedDocumentViewerDP)vm.DataProvider;

            if (vm.ListSource == null)
            {
                vm.ListSource = new MasterDetailDataObject(AttachedDocument.MasterKeyName, AttachedDocument.PrimaryKeyName);
            }
        }
        public override void ConnectControlSpecific(System.Web.UI.Control _control, ConnectorFactory _factory)
        {
            WACUT_AssociationsVM vm = (WACUT_AssociationsVM)ViewModel;
            WACUT_AssociationsDP dp = (WACUT_AssociationsDP)vm.DataProvider;

            if (vm.ListSource == null)
            {
                vm.ListSource = new MasterDetailDataObject(Association.PrimaryKeyName, Association.PrimaryKeyName);
            }
        }
Esempio n. 9
0
        public override void ConnectControlSpecific(Control _control, ConnectorFactory _factory)
        {
            WACPT_ParticipantListSearchVM pvm = (WACPT_ParticipantListSearchVM)ViewModel;
            WACPT_ParticipantListSearchDP pdp = (WACPT_ParticipantListSearchDP)pvm.DataProvider;

            if (pvm.DDLBinders.Count < 1)
            {
                pvm.DDLBinders.TryAdd("ddlParticipant", new DDLDataObject(new ParticipantOrganizationDP(), false, null, false, null));
            }
        }
Esempio n. 10
0
        public override void ConnectControlSpecific(Control _control, ConnectorFactory _factory)
        {
            WACPR_TaxParcelOwnerFormVM vm = ViewModel as WACPR_TaxParcelOwnerFormVM;

            //vm.WireUp();
            if (vm.TaxParcelOwnerValidator == null)
            {
                vm.TaxParcelOwnerValidator = _factory.CreateValidator("WACPR_TaxParcelOwnerValidator") as WACPR_TaxParcelOwnerValidator;
            }
        }
Esempio n. 11
0
 public WACDataProvider GetDataProvider(Control _control, ConnectorFactory _factory)
 {
     if (ServiceFactory.IsIndependentControl(_control))
     {
         return(_factory.CreateDataProvider(_factory.DataProviderName(_control)));
     }
     else
     {
         return(null);
     }
 }
        public override void ConnectControlSpecific(Control _control, ConnectorFactory _factory)
        {
            WACPR_TaxParcelPickerVM tpvm = (WACPR_TaxParcelPickerVM)ViewModel;
            WACPR_TaxParcelPickerDP tpdp = (WACPR_TaxParcelPickerDP)tpvm.DataProvider;

            if (ViewModel.DDLBinders.Count < 1)
            {
                tpvm.DDLBinders.TryAdd("ddlCounty", new DDLDataObject(new WACCountyDP(), true, "ddlJurisdiction", false, null));
                tpvm.DDLBinders.TryAdd("ddlJurisdiction", new DDLDataObject(new TaxJurisdictionDP(), true, "ddlTaxParcelID", true, "ddlCounty"));
                tpvm.DDLBinders.TryAdd("ddlTaxParcelID", new DDLDataObject(new TaxParcelPickerIDDP(), false, null, true, "ddlJurisdiction"));
            }
        }
Esempio n. 13
0
        public override void ConnectControlSpecific(Control _control, ConnectorFactory _factory)
        {
            WACAG_SupplementalAgreementFormVM vm = ViewModel as WACAG_SupplementalAgreementFormVM;

            if (vm.Validator == null)
            {
                vm.Validator = _factory.CreateValidator("WACAG_SupplementalAgreementValidator") as WACAG_SupplementalAgreementValidator;
            }
            if (vm.ListSource == null)
            {
                vm.ListSource = new MasterDetailDataObject(SupplementalAgreement.PrimaryKeyName, SupplementalAgreement.PrimaryKeyName);
            }
        }
        public override void ConnectControlSpecific(Control _control, ConnectorFactory _factory)
        {
            WACAG_FarmBusinessFormVM vm = ViewModel as WACAG_FarmBusinessFormVM;

            if (vm.Validator == null)
            {
                vm.Validator = _factory.CreateValidator("WACAG_FarmBusinessValidator") as WACAG_FarmBusinessValidator;
            }
            if (vm.ListSource == null)
            {
                vm.ListSource = new MasterDetailDataObject(FarmBusiness.PrimaryKeyName, FarmBusiness.PrimaryKeyName);
            }
            if (ViewModel.DDLBinders.Count < 1)
            {
                ViewModel.DDLBinders.TryAdd("ddlProgramWAC", new DDLDataObject(new WACProgramDP()));
                ViewModel.DDLBinders.TryAdd("ddlFarmSize", new DDLDataObject(new FarmSizeDP()));
                ViewModel.DDLBinders.TryAdd("ddlBasin", new DDLDataObject(new BasinDP()));
                ViewModel.DDLBinders.TryAdd("ddlSoldFarm", new DDLDataObject(new FarmIDFarmNameDP()));
            }
        }
Esempio n. 15
0
 public override void ConnectControlSpecific(Control _control, ConnectorFactory _factory)
 {
     WACPR_TaxParcelOwnerGridVM vm = (WACPR_TaxParcelOwnerGridVM)ViewModel;
     //vm.WireUp();
 }
 public override void ConnectControlSpecific(Control _control, ConnectorFactory _factory)
 {
     WACPR_TaxParcelPrintKeySearchVM tpvm = (WACPR_TaxParcelPrintKeySearchVM)ViewModel;
     WACPR_TaxParcelPrintKeySearchDP tpdp = (WACPR_TaxParcelPrintKeySearchDP)tpvm.DataProvider;
 }
Esempio n. 17
0
        //public override string GetConnectorType()
        //{
        //    return "USERCONTROL";
        //}

        public WACDataProvider GetDataProvider(string _dpName, ConnectorFactory _factory)
        {
            return(_factory.CreateDataProvider(_dpName));
        }
Esempio n. 18
0
 public abstract void ConnectControlSpecific(Control _control, ConnectorFactory _factory);
Esempio n. 19
0
        private WACControlConnector getConnector(Control _control, ConnectorFactory _cfac)
        {
            WACControlConnector cCon = _cfac.GetConnectorForControl(_control);

            return(cCon);
        }
 public override void ConnectControlSpecific(Control _control, ConnectorFactory _factory)
 {
     //throw new NotImplementedException();
 }
Esempio n. 21
0
 public override void ConnectControlSpecific(Control _page, ConnectorFactory _factory)
 {
 }
Esempio n. 22
0
        public static ConnectorFactory GetConnectorFactoryForSession(HttpSessionState _session)
        {
            ConnectorFactory cf = new ConnectorFactory(_session);

            return(cf);
        }
Esempio n. 23
0
 public WACViewModel GetViewModel(Control _control, ConnectorFactory _factory)
 {
     return(_factory.CreateViewModel(_factory.ViewModelName(_control)));
 }
 public override void ConnectControlSpecific(Control _control, ConnectorFactory _factory)
 {
     return;
 }
Esempio n. 25
0
 public override void ConnectControlSpecific(Control _control, ConnectorFactory _factory)
 {
     WACViewModel    vm = ViewModel;
     WACDataProvider dp = vm.DataProvider;
     //MasterDetailDataObject md = vm.ListSource;
 }