Exemplo n.º 1
0
        protected override void OnViewSet()
        {
            _invoiceDetailView = this._detailView as InvoiceDetailView;
            _invoiceDetailView.OnStatusCodeChanged += OnStatusCodeChanged;
            base.OnViewSet();
            Katrin.Domain.Impl.Invoice invoice = this.ObjectEntity as Katrin.Domain.Impl.Invoice;
            System.Data.Services.Client.DataServiceCollection <InvoiceContract> inviceContracts =
                invoice.InvoiceContracts;
            var selectedContracts = new List <Guid>();

            foreach (var inviceContract in inviceContracts)
            {
                Guid contractId = inviceContract.ContractId;
                selectedContracts.Add(contractId);
            }

            _invoiceDetailView.BindContract(selectedContracts);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Ruft einen WCF- Datenservice ab, über den Abfragen an die FileFeatureDB abgesetzt werden können.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAllFilesRequery_Click(object sender, EventArgs e)
        {
            try
            {
                var proxy = new FileFeaturesDbDataServiceRef.FileFeaturesDbEntities(new Uri("http://localhost:9091/FileFeaturesDataService.svc/"));

                // Alle Einträge von FileClasses anzeigen
                var alleKlassen = proxy.FileClasses;

                // Aufbereiten des Resultsets zur Anzeige in einem Gridview
                var dsCollAlleKlassen = new System.Data.Services.Client.DataServiceCollection <FileFeaturesDbDataServiceRef.FileClass>(alleKlassen);

                // Ausgabe im GirdView
                grdDataServiceResult.DataSource = dsCollAlleKlassen;

                // Alle Klassen, deren Name mit O beginnt
                var alleMitO = proxy.FileClasses.Where(r => r.name.StartsWith("O"));

                var dsCollAlleKlassenMitO = new System.Data.Services.Client.DataServiceCollection <FileFeaturesDbDataServiceRef.FileClass>(alleMitO);

                grdDataServiceResult.DataSource = dsCollAlleKlassenMitO;


                var lst = new List <FileView>();
                foreach (var r in proxy.Files.Select(r => new FileView {
                    Name = r.filename, Dir = r.Dir.path
                }))
                {
                    lst.Add(r);
                }
                //var resColl = new System.Data.Services.Client.DataServiceCollection<FileFeaturesDbDataServiceRef.File>(ctx.Files);
                //bindingSource1.DataSource = resColl;

                grdDataServiceResult.DataSource = lst;
            }
            catch (Exception ex)
            {
                log.Log(mko.Log.RC.CreateError("Beim Abrufen aller Files :" + ex.Message));
            }
        }