Asp.net - Updating ListView From Business Logic Layer Method

Sep 7, 2011

I have a shopping cart ListView control backed by a custom object that has methods for selecting and deleting. In the ListView, one of the columns is an ImageButton that is essentially a delete icon, with the CommandName parameter set to CommandName="Delete".

My issue is related to updating the shopping cart ListView on delete; as the delete method is stored in the custom business entity object, I am having trouble in terms of updating the calculations made inside the cart (we have deleted an item, so I need to recalc shipping, taxes, etc).

[Code]...

View 1 Replies


ADVERTISEMENT

VB Code Behind The Business Logic Layer?

Oct 1, 2010

I also went though the whole "ASP.Net in 24 Hours" book by Scott Mictchell. I followed everything that went on in that book and built the final project successfully. I also used the tutorials here to better understand the whole Membership Provider/User tables setup that was going on in the book. Next, I thought I would learn more about accessing data for ASP.Net since that is what most application do.I went through the first Data Tutorial here. I seemed to understand what was going on just fine.The second Data Tutorial seemed to just show a lot of VB code to build the Business Logic Layer. There was not much explanation about how to do it yourself.I think I can keep going in the tutorials here. I downloaded the code from the second tutorial and went through it.I am guessing that the code in the second tutorial was given just to proceed with the overall project that is being built throughout the tutorial sequence.

View 2 Replies

VS 2008 Connect A Logic Layer Between Presentation Layer And Data Layer?

Feb 7, 2011

I am generally following this tutorial, the main differences being I'm using 2008 R2 Express and Windows Forms, he is using 2005 & ASP.NET Web Site:'m building a minimalist Windows Form project for learning purposes. So I'm using a 1-table database with 2 columns, ContactID & Name. I added a dataset file, 'ContactsDataSet.xsd' to my project and added a single minimalist table adapter with just a fill() & getdata() method.Then I added a DataGridView control and connected it to the ContactsDataSet to confirm it was working and that worked fine. I ran it and it filled up with data as expected. Everything up to this point was auto-generated code.

View 4 Replies

Business Layer Vs SQL Server

Jan 24, 2012

I have an application that does complex calculations for members. Each member can have multiple US states linked to their profile. Each state has got different calculations for each course a member completes. As of now I have been performing the calculations in the DB (SQL Server 2008) and then sending data back to app layer where they can see their history and then download a certificate for each course. I have a business logic layer but not a lot happens there. I know this has been asked a lot but where do you think I should perform these calculations: business layer or database? I am going back and forth

View 3 Replies

Writing Update() In The Business Layer

Sep 24, 2009

If code the parameter list as seperate arguments then this wouldnt be a problem, but following a taught pattern that i should take collection as parameters in update or create methods.

Assume the there are three members in a class and in the update or create methods that was told code them to take collection, therefore create.

update methods of that class take collection but the problme the caller faces that it doesnt know the order and names of each element of the collection.

Assume :[code...]

View 2 Replies

IDE :: Managing Dates Using Business Logic?

Feb 16, 2010

i am currently trying, to create some sort of a business logic within my class, that contains information about a machine, now this machine once sold, can be re-sold by its owner. the company needs to keep track of the machine and its owner for warranty claim purposes.the class takes in two values, a from date and a to date.now when a new owner is added to the owner collection of the machine, the TO date of the previous owner should automatically be updated to one day less than the From date of the new owner that is being added.

View 1 Replies

Logic To Calculate Business Hours?

Aug 16, 2010

I have tried searching all over the web for this logic. Got many but half of them did not match what i was looking for and half were malfunctioning.I want to calculate business working hours between 2 datetime, where in I should be able to set the working hours as well as weekends and holidays should not be calculated.

View 7 Replies

Programmatically Go Through Several .aspx's Business Logic?

Dec 6, 2011

I have several successive web pages going through a checkout process and they each have tons of business logic that time restraints limit me from pulling out and wrapping up elsewhere in the code the way it needs to be. What would be a good method for calling each one of these pages' Submit buttons in order from one page to the next?

The way I was going to do this was to (laugh at me go ahead) make PUBLIC all of the submit buttons' code and just call them. But what I have found is that all of them have, of course, certain calls to controls on their pages where it might make a label visible or change a text property then that will crash the app due to a null reference. I believe it is basically saying if the webpage is not visible then it is not going to let the code start setting certain GUI properties of the controls on the page. It seems like I recall this in VB6, too.

Anyway, what would you do if you were in this situation? I have started down the path of creating a flag that says whether or not I am in expresscheckoutmode and, if so, it just doesn't do the "illegal" things mixed into all of the code like making labels visible and all that. But that also means that I have an IF BLOCK everywhere where the code simply changes a label. It junked up the code bad and I still haven't finished that implementation of it all. I wanted to come here to ask the collective mind what programming principles I can best apply here.

View 4 Replies

Format Numbers In The Business Lyer Or In The Data Access Layer?

Aug 25, 2009

IN my daat access layer, the stored procedure returns value of the format "CCT1". But i need to format that value to "CCT00001". Should i do this formatting in the data access layer or in the business layer?

View 4 Replies

Moving From ASP Business Logic Trapped Inside Stored Procedures

Oct 28, 2010

How would you structure a large project with most of the business logic already inside stored procedures?We are moving from classic ASP to ASP.NET (VB) and pretty much all the business logic is inside stored procedures.Getting the logic out of there is pretty much impossible since my boss doesn't want to (too expensive, takes too long, no "real" added value).I was thinking about making a presentation layer made of aspx pages, a business logic / data access layer that would basically get the data and interact with the existing stored procedures and a business entities layer that would be made of classes (for entities and collections) containing the information to interact between those two layers.The reason I wanted to make those layers was to be able to reuse most of the code without duplicating it.

View 4 Replies

IDE - VB - Business Logic - Unable To Inherit Or Call The Location Collection Class

Feb 17, 2010

my form displays locations and owners for a same product, the forms have a data grid view that actually takes in the details of the location and owner of that particular product. a product can have multiple owners and locations once its manufactured over time, the forms actually display this all i need is some kind of business logic that can actually manage the historical events of the location and the owner that when a user actually goes in and adds a new entry, the end date of the previous owner gets reduced to one less than the start date of the new owner. this in formation is stored in business layers called the owner collection and the location collection, i am not able to actually inherit or call the location or the owner collection class in the classes.

View 1 Replies

Sharing Business Logic Between Windows Forms And Web Forms?

Feb 4, 2010

My question is, am I able to share a business logic layer seemlessly between the two presentation layers or is there anything I need to watch out for. I'd really like to not have any duplication of business logic, so any advice would be more than welcome.

View 3 Replies

Validate Business Object By Use Of Related Business Objects?

Oct 11, 2010

using an object-binding I have a an object representing "Employee". The employee has an ID-property. The ID of the employee must be unique.

My validation of the entered data is handled in the property set part of the object. In general, I validate criteria belonging to the object to validate only (eg numeric range of the ID, if it's value is not empy, ...). But in this case I need to know all ID's from the other employees. My tried this:

''' <summary>
''' Set EmployeeID
''' </summary>

[Code].....

View 2 Replies

Class - Add A Readonly Property To Layer That Is Calculated Using Some Layer Information?

Nov 30, 2010

I am working in VB.NET defining my own classes. I have 5 classes, Policy, Coverage, CoverageCollection, Layer, and LayerCollection. Policy has a bunch of data items, one of which is of type CoverageCollection. Coverage has a bunch of data items, one of which is of type LayerCollection.

Policy
private id as Long
private name as String[code].....

Then I do like "dim p as Policy". So, iIn order to get to properties on a Layer, I reference it like p.cov(0).lyr(0).face. What I am trying to do is add a readonly property to Layer that is calculated using some Layer information but also using something from Coverage (or even Policy). I can take this in as a parameter to the property, but I think there should be a way to get at Coverage/Policy information since I am "under" it already. Is there a way to do this?

View 1 Replies

Creating A Data Layer - Prototype An Application With A data Layer?

Jul 26, 2009

I am trying to prototype an application with a data layer on my computer at home using Visual Basic 2008 express edition with SQL Server Compact 3.5. My production situation at work is SQL Server 2000 and I am using Visual Basic 2005 professional for development.I am trying to write the code to create a seperate data layer. Here is my code. First the data layer:

Imports
System.Data
Imports[code].....

My Problem is that the data does not show up in the text boxes.

View 1 Replies

Gradually Transition To NHibernate Persistence Logic From Existing ADO.NET Persistence Logic?

Sep 3, 2010

The application uses ADO.NET to invoke sprocs for nearly every database operation. Some of these sprocs also contain a fair amount of domain logic. The data access logic for each domain entity resides in the domain class itself. ie, there is no decoupling between domain logic and data access logic. I'm looking to accomplish the following:

[Code]...

View 2 Replies

Game Programming :: Override On Paint Method Not Updating

Nov 12, 2009

Ok I'm trying write a simple 2d game. I have a base class to render the game sprites. It uses the forms graphics object to update the scene. The problem is it will draw only one picture then it seems like the onpaint event isn't raised again to update it. How do I use the raiseevent method to make a call to the onpaint method. Here is the code so you can understand a litte what I am doing. TYVM

[Code]...

View 1 Replies

VS 2008 Updating An Application From Internet - Hashing Method

Aug 5, 2009

I have created an updater for my application. When the application starts the user can launch an updater that will check for the latest version. Download it and copy the files to where the installation is.

Everything works fine.

However, I am looking for a more robust technique. And I have discovered it is better to hash the files on the web server with a hash algorithm and then when they have downloaded use the same hash algorithm to compare the hash values. If they are different either the files were corrupted when downloaded or some modified them without permission.

However, my problem is where do I store the hash values? I was thinking of hashing the files, and storing all the hash values for each file in a text file, and my updater will download that text file.

I am not sure if that is the best technique to use of not? Is this the normal and best way to do this?

View 5 Replies

WPF Label Not Updating While Performing A Time Consuming Method?

Dec 26, 2011

EDIT:I edited the question to show the code I have come up with. It does not work... No "test" caption becomes visible on the main form.

Private _dispatcher As Dispatcher
Delegate Sub SetLabelText(caption As String)
Private _setLabelText As SetLabelText

[code].....

View 1 Replies

Updating A ListView From A Second Thread?

Aug 5, 2010

I am writing a basic application to provide remote support to multiple computers over a TCP Stream. For example, if my brother/dad has an issue with their computer, rather than going over to help them I can just use remote support (Yes, I know Windows has Remove Desktop, and their is TeamViewer, ect. But where is the fun in using those =P)Anyway, it basically works by taking a PrintScreen of their computer, sending it to mine and displaying it in a PictureBox, then when I click the image, it records the coordinates of my mouse, sends it to theirs (Little Maths for resolutions and positions ofc) and clicks, then sends a new image.

My problem is, I want a ListView displaying the PC Info, like:

PCName - RAM - Free HDD Space - 32/64Bit - Processor Speed

Now, my problem is, I have a Class which does the TCP Server, and in that class when it Receives a Message, it calls the Sub "RunCommand(ByVal Command As String)", which then splits the String and works with it.So, for example, their PC would send the String "Info|DadPC|2GB|235GB|32Bit|2.2GhZ|" And mine would split it, and add that data accordingly.However, what happens is, nothing. If I put in "MsgBox()" anywhere in the Code, it shows it is all Split, and received correctly and everything is fine, but no matter what happens, it wont add to the ListView (Or anywhere else on the form, for example "GUI.Text = Info(1)" Wont work either)?

View 8 Replies

Updating Listview: Lags At 60+ Entries Being Added?

Jan 21, 2012

The scenario is i get a string sent to me that i split by a space. Any thing under 60 count when the split occurs it's fine. After that i have a problem.Now there is a lot that needs to happen before we can add this newly split array to the listview.First we need to check what the name starts with. Then assign an icon to this nick.When my server class gets sent this string. Raw Numeric 353 channel names i then send it to my nicklist class.

vb
Private Sub InitiateThread(ByVal nicks As String) Handles _server.NameListEventArgs
Dim thread As New Thread(DirectCast(Sub() DoWorkChannelNicks(nicks), ThreadStart))
thread.Start()
End Sub

Then we split the string and loop each item

vb
Private Sub DoWorkChannelNicks(ByVal users As String)
Dim nicks() As String = users.Split(" "c)

[code]....

how to speed the process up?

View 9 Replies

VS 2008 Updating A ListView From A BackGroundWorker Thread?

Sep 20, 2009

I'm using the following to check the state of checkboxes and then activate some public subs based on the checked state of the checkboxes:

vb.net
Public Sub TestSub() If Me.CheckBox1.InvokeRequired Then Me. CheckBox1.Invoke(New MethodInvoker(AddressOf TestSub)) Else Begin() End If End Sub

Within the Begin sub, I have code that performs specific actions and then updates a ListView with that information.As far as I can tell, the actions are being performed, but the ListView isn't being updated with the info.I'm calling the Test sub from a seperate form, within the BackGroundWorker's DoWork event.Would I have to check the InvokeRequired property of the ListView as well?I'm looking more into the documentation of the BackGroundWorker.

View 8 Replies

Playing Around With Ninject, A "Service Layer" And A "Repository Layer"?

Feb 24, 2011

Ok, so I was playing around with Ninject, a "Service Layer" and a "Repository Layer".I built a simple console application to to play around, this is what I came up with:

Imports Ninject
Module Module1
Sub Main()
Dim Kernel As IKernel = New StandardKernel(New CustomerModule)
Dim Service = Kernel.Get(Of CustomerService)()
Console.WriteLine(Service.GetCustomerByID(1).Name)
Console.Read()

[Code]...

View 2 Replies

Forms :: Updating Large List Instantly - Datagridview Vs. Listview ?

Nov 1, 2011

What I am trying to do is to instantly apply a filter to a large list of data such that the list is updated almost immediately regardless of the number of items in the list. I have this working using a listview right now but it is far from instant, a list of 5000 items takes over a minute to get through. What I do currently is to maintain a cache of my data that my listview entries are based on. When the user selects a filter I parse this data one item at a time and determine if each item should still be displayed in the listview, if not I remove it. The complexity of determining whether or not a data entry meets the filter requirements is O(1), but just getting through each element in a loop takes significant time, and so does updating the list view graphically at the end of the process.

I have considered using a datagridview instead, using a database connection. I have never done this before and my main question here is whether this would allow me to do what I have described. With the database I could form an SQL query to return only the items that meet the new filter requirements... but would the data in the form update immediately, or would there still be significant delay?

View 3 Replies

Forms :: Refresh Data In A Listview After Adding/deleting Or Updating A Record?

Jun 16, 2012

I have designed a form which contains a listview(to see the list records) and textboxes (used for adding or updating).an already save record into table using this

cmd.Connection = con
cmd.CommandText = "INSERT INTO student_info_tbl VALUES('" & txtUserId.Text & "','" & txtFirstName.Text & "','" & txtMiddleName.Text & "','" & txtLastName.Text _

[code].....

View 5 Replies

How To Cancel Insert In Listview Following Method VB?

Jun 6, 2011

I am stumped by being unable to cancel a list view insert operation following a method to validate a string. While the method validates the string and shows a modal popup when the string is not valid, then I want to stop the insert using e.cancel

Imports System.Data
'Imports System.Data.SqlClient
Public Class SecureOrderHCTPScan

[code].....

View 1 Replies

.net Thread Safe Method To Add A Listview Subitem?

Feb 21, 2011

I am trying to add a subitem to a listview in a threadsafe manner.In a single threaded application it works like so:

[Code]...

However if run in another thread it causes a cross threading error.I have looked at examples of delegate subs that use Invoke, but all examples i have seen involve updating the text property of an object, and i cant get my head round how to apply the concept to actually add a subitem to a listview.

View 3 Replies

Add A Text Changed Method To Listview Item?

Feb 5, 2009

im trying to add a text changed method to my listview item. all the items are dynamicly created so i would think id have to use an addhandler listviewitem1.textChanged addressof listviewitems_click where listviewitems_click is the generic sub to handle the click. but the listviewitem control doesnt have a text changed event, but you can rename the text in the control anyway.

View 2 Replies

Finding ListView LOAD Method In .net In Winforms?

May 30, 2012

what I am trying to do is, when a ListView loads, for the code to check the entry in column one, and then return a message box if the column contains a specific date.

I am using:

SUB I DONT KNOW THE METHOD TO INSERT THIS INTO. I NEED IT CHECKED WHEN THE LISTVIEW CHANGES
If lvuPreviousJobs.SelectedItems(0).SubItems(2).Text = "31/12/9999" Then
{
MsgBox("TEST")

[code]....

View 1 Replies

Fastest Method To Load A List Into ListView Control?

Aug 14, 2011

When ListView is not in Virtual mode the following method seems to be the fast method to load a large list into ListView:

Dim items As New List(Of ListViewItem)
Dim alllines as String()=System.IO.File.ReadAllLines("FilePath")
For each line as string in alllines
Dim item As New ListViewItem
item.Text = line
items.Add(item)
Next
ListView1.Items.AddRange(items.ToArray())

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved