WS on page based Navison and Visual studio (C# and ASP.net)

sbilly
Member Posts: 231
Hi all;
I am working with WS on page based Navison and Visual studio (C# and ASP.net)
I reproduced the customer card, but I need to put Button previous and next to see different customers like in classic Navision.
who have an idea about how can I do it
thanks
I am working with WS on page based Navison and Visual studio (C# and ASP.net)
I reproduced the customer card, but I need to put Button previous and next to see different customers like in classic Navision.
who have an idea about how can I do it
thanks
0
Comments
-
You could buffer customers to a datatable and use http://www.vbforums.com/showthread.php?t=244549 to move to prev or next. Or You could use an array to temp-save customers-no and/or key. But You allways have to remember that s. o. else could have added new customers which are not in your temp-array.
I am sure there are more solutions to solve this.
Volker0 -
thanks volker,
but i am working with C# and I don't have any idea about VB.0 -
If you use a web service for the customer page (21) and add it to your C# project, then you can use ReadMultiple to read an array of customers. Set a FormView up on a ASP.NET page using the array as the datasource and handle the paging and paging template to use Prev and Next.
Not the most memory efficient use perhaps (as the entire array will be in memory), but you could tune it pretty easily to suit your needs.
I did a project as an example but mibuso won't let me attach zip files.
Default.aspx.cs:using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CustomerWebService; public partial class _Default : System.Web.UI.Page { private Customer_Service _customerService = null; private Customer[] _customerArray = null; protected void Page_Load(object sender, EventArgs e) { this.CreateCustomerService(); this.LoadCustomers(); if (!this.Page.IsPostBack) { this.BindFormView(); } } private void CreateCustomerService() { this._customerService = new Customer_Service(); this._customerService.UseDefaultCredentials = true; } private void LoadCustomers() { if (this._customerService != null) { this._customerArray = this._customerService.ReadMultiple(null, null, 0); } } private void BindFormView() { this._formViewGeneral.DataSource = this._customerArray; this._formViewGeneral.DataBind(); } protected void _formViewGeneral_PageIndexChanging(object sender, FormViewPageEventArgs e) { this._formViewGeneral.PageIndex = e.NewPageIndex; this.BindFormView(); } }
Default.aspx:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <%@ Register assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" namespace="System.Web.UI.WebControls" tagprefix="asp" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <asp:FormView ID="_formViewGeneral" runat="server" AllowPaging="True" onpageindexchanging="_formViewGeneral_PageIndexChanging"> <PagerSettings Mode="NextPreviousFirstLast" /> <ItemTemplate> <asp:Label ID="_lblCustomerNo" runat="server" Text="No."></asp:Label> <asp:TextBox ID="_txtCustomerNo" runat="server" Text='<%# Bind("No") %>'></asp:TextBox> <br /> <asp:Label ID="_lblCustomerName" runat="server" Text="No."></asp:Label> <asp:TextBox ID="_txtCustomerName" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox> </ItemTemplate> <PagerTemplate> <asp:Button ID="_btnFirst" runat="server" Text="First" CommandName="Page" CommandArgument="First"/> <asp:Button ID="_btnBack" runat="server" Text="Previous" CommandName="Page" CommandArgument="Prev"/> <asp:Button ID="_btnNext" runat="server" Text="Next" CommandName="Page" CommandArgument="Next"/> <asp:Button ID="_btnLast" runat="server" Text="Last" CommandName="Page" CommandArgument="Last"/> </PagerTemplate> </asp:FormView> </form> </body> </html>
As I said, this is rough, but it should illustrate the idea.0 -
thanks very much
please can u send me the project by e-mail.
This my adress : sandi_bilel@yahoo.fr
thanks again0 -
Hi, sent it to you in a PM0
-
Soory But I didn't recieve anything, nothing is attached;
Please send it on my yahoo mail
thanks0 -
Apologies... forgot to hit the "add the file" button in the PM. You should have it now.0
-
MattKeyes wrote:Apologies... forgot to hit the "add the file" button in the PM. You should have it now.
Please can you see this topic and give me your advice:
viewtopic.php?f=32&t=472820 -
0
-
Shall I use "gridview" or "listview" and how can I use them0
-
It depends on your requirements. As for how to use them... that is a bit like saying "how do I program?" It is a broad question and not really directly answerable, sorry. Practice and study is what I would suggest unless you have specific questions.0
-
Hi all. just to let you know that this topic helps me a lot on how displaying the NAV data in ASP.NET using webservice.
how can I make the FormView is enabled for editing, insert new records and or deleting records from th NAV database? I saw a video tutorial on how to make this posible using SQLDataSource by selecting Generate INSERT, UPDATE, and DELETE statements, but it seem cannot be applied using a data colection received from readMultiple method.
any idea how to mimic the behavior of update hyperlink colomn when we enable editing of a gridview?
Thx0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions