Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • I have created PersistentClass from existing database with select/insert/update/delete stored procedure.

                                    Now i want to assign select stored procedure result to the view and insert/update records from Detail View using Insert/Update stored procedure.

                                    How can i do the above things in XFA with XPO.

                                    Thanks in advance.

                                    Regards,
                                    Jinal

                                0

                                Hello Jinal,

                                The task of showing the results of the stored procedure in the ListView was discussed in the stored procedure in 10.2.2 Support Center issue. I believe that it will be helpful in your case.

                                As for replacing the Insert/Update commands, I believe that it is better to accomplish this task using INSTEAD-OF triggers, as shown in the XPO - Stored Procedure Support coming in V2010 Vol 2 (Part 2) blog post.

                                Please let me know if you need any further help.

                                Thanks,
                                Anatol

                                0

                                Thanks Anatol for your reply.

                                I am very new for XFA.

                                For example, I want to bind Orders table's select stored procedure (sp_OrderDetails_Select) in Orders_ListView. FYI, sp_OrderDetails_Select return result data from two data table.

                                My Question:
                                1) Can you please tell me where (I mean in viewcontroller class or somewhere else) i have to write ToevoegenBA_Activated event?

                                2) How can i assign this event to Orders_ListView ?

                                Thanks in advance.

                                Regards,
                                Jinal

                                0

                                Hello Jinal,

                                The Activated event belongs to a ViewController, that should be associated with the Orders_ListView. Please review the following help topics for additional information:
                                Add a Simple Action
                                Controllers

                                Please note that Dennis did not recommend using this approach. Please use an approach with a custom CollectionSource, as Dennis suggested.

                                P.S. XAF is a complex product, and I suggest that you start learning it from the XAF Tutorial. Things you are trying to implement now can be difficult for the novice who does not know the XAF architecture well.

                                Thanks,
                                Anatol

                                0

                                Thanks Anatol for your help.

                                I am able to create XAF view from select stored procedure but result data are no display in list grid. I have create one class which is inherited from PersistentBase class and set class attribute to NonPersistent.

                                One static SprocHelper class is created. SprocHelper class have four different methods. Source code is as below:

                                [NonPersistent]
                                    public class sp_ContactTypes_xpoView_Select : PersistentBase
                                    {
                                        string fContactTypeID;
                                        public string ContactTypeID
                                        {
                                            get { return fContactTypeID; }
                                            set { SetPropertyValue<string>("ContactTypeID", ref fContactTypeID, value); }
                                        }

                                        string fTypeName;
                                        public string TypeName
                                        {
                                            get { return fTypeName; }
                                            set { SetPropertyValue<string>("TypeName", ref fTypeName, value); }
                                        }
                                        string fDescriptions;
                                        public string Descriptions
                                        {
                                            get { return fDescriptions; }
                                            set { SetPropertyValue<string>("Descriptions", ref fDescriptions, value); }
                                        }
                                        public sp_ContactTypes_xpoView_Select(Session session) : base(session) { }
                                        public sp_ContactTypes_xpoView_Select() : base(Session.DefaultSession) { }
                                        public override void AfterConstruction() { base.AfterConstruction(); }
                                    }

                                    public static class CommonSprocHelper
                                    {
                                        public static DevExpress.Xpo.DB.SelectedData Execsp_ContactTypes_xpoView_Select(Session session, int ContactTypeID)
                                        {
                                            return session.ExecuteSproc("sp_ContactTypes_xpoView_Select", ContactTypeID);
                                        }

                                        public static System.Collections.Generic.ICollection<sp_ContactTypes_xpoView_Select> Execsp_ContactTypes_xpoView_SelectIntoObjects(Session session, int ContactTypeID)
                                        {
                                            return session.GetObjectsFromSproc<sp_ContactTypes_xpoView_Select>("sp_ContactTypes_xpoView_Select", ContactTypeID);
                                        }

                                        public static XPDataView Execsp_ContactTypes_xpoView_SelectIntoDataView(Session session, int ContactTypeID)
                                        {
                                            DevExpress.Xpo.DB.SelectedData sprocData = session.ExecuteSproc("sp_ContactTypes_xpoView_Select", ContactTypeID);
                                            return new XPDataView(session.Dictionary, session.GetClassInfo(typeof(sp_ContactTypes_xpoView_Select)), sprocData);
                                        }
                                        public static void Execsp_ContactTypes_xpoView_SelectIntoDataView(XPDataView dataView, Session session, int ContactTypeID)
                                        {
                                            DevExpress.Xpo.DB.SelectedData sprocData = session.ExecuteSproc("sp_ContactTypes_xpoView_Select", ContactTypeID);
                                            dataView.PopulateProperties(session.GetClassInfo(typeof(sp_ContactTypes_xpoView_Select)));
                                            dataView.LoadData(sprocData);
                                        }

                                In Application.Module solution, I have added one ListView(ContactType_ListView) item in View. Set below properties of ContactType_ListView:
                                ModelClass = sp_ContactTypes_xpoView_Select
                                DetailView = sp_ContactTypes_xpoView_Select_DetailView

                                Add Two columns TypeName and Description in ContactType_ListView. Set PropertyName and ModelMember properties of each column.

                                My question:
                                When i run application I am able to see the header on the listview screen but data not display on the list grid? Can you please tell me how can i display results data on the screen ?

                                Thanks in advance.

                                Regards,
                                Jinal

                                0

                                Hello Jinal,

                                Generally, all objects of the specified type are loaded to the ListView. I.e. methods from the CommonSprocHelper class will not be used automatically. stored procedure in 10.2.2 Support Center issue explains two ways how to load records using a stored procedure - via the ViewController and custom CollectionSource. Have you tried to implement them? Please let me know in case of any difficulty with this.

                                Thanks,
                                Anatol

                                To start a chat you should create a support ticket


                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners