Showing posts with label webform. Show all posts
Showing posts with label webform. Show all posts

Thursday, March 29, 2012

Please advise on how to create an invoice system

i'm trying to create an asp webform for my own development. I'm trying to create an online invoice where people can enter details like "Customer Name, Address, Date, Total amount".

I'm able to create a webform which captures those details and insert/delete/delete to/from a mssql db.

But because each invoice should have some items, so i created another table (InvoiceDetails) which reference to the Invoice table. So i can create as many items as i want in each invoice.

How should i create webforms for the invoicedetails? Because i need to add dynamically and not fix 10 records to add/edit in the form. THus most probably i'll need to put all sql statements into 1 transaction in case 1 InvoiceDetail record fail, so i can rollback the Invoice and InvoiceDetail record.

are there any samples which has a similar scenario as me?Its an interesting scenario Michael, especially the cardinality of relationship & dynamic nature of this application. If formatting doesn't matter much at data-entry level, you can use editable datagrid to insert/edit/delete data. This will totally accomodate the dynamic nature of InvoiceDetails using this strong data-aware component in ASP.NET. However, for printing & display in invoice report format, you may need to postion the dynamic controls on the fly which may get difficult if positions need customized.

MSDN's article "Adding Controls to a Web Forms Page Programmatically" may help.
http://msdn.microsoft.com/library/en-us/vbcon/html/vbtskaddingcontrolstowebformspageprogrammatically.asp?frame=true

I hope it helps.

-Adnan Masood
This is a job for a new application model. HTML sucks for this stuff. Imagine writing an ERP application for the Web.. Wait Oracle did it.. sort of.

You will probably want to employ some thrd party web controls from the folks at Infragistics. Adding detail lines to invoices without them will be a little kludgy.

I did it once and ended up doing it with a series of frames. A button on the header page took you to a detail page. After adding the data on the detail page you went back to the header. It was a lot of tedious work.
Hmm, I would have a form that adds a single item to the order. Then two buttons, one says "Add another item" and one says "Finish Order". Add another item just reloads the form and Finish Order goes to whatever the next step is.

For editing just use a datalist that binds to the order number.

I do a similar type system for magazine advertising rates for each year. A particular magazine can have 10 years worth of prices and each year can have 20 different rates (for various sizes). The datalist shows all 10 years (queried by the magazine ID) and when they select the edit button it changes all the prices into textboxes for that year only. So your datalist would show all items for a single order, and then allow editing of each individual item inside that order.
hmm... datalist.. but what if its a new invoice? Thus it will not be given a Invoice ID until its inserted into the database. So its kinda hard to bind the individual items to that invoice

thats why i'm asking for advise on whats the best practise for people who has done similar development..
While you are entering the invoice keep the database in some temp tables. Identify the record with a GUID.. after you are done editing copy that data from the temp tables into the production tables. This works well and requires no whacky state management. It depends on the level of sophistication you want. In my current business we don;t start out by entering an order/invoice. We enter contracts the contracts get attached to jobs and several people may be involved with entering the data about the contracts and jobs. As the work on the contract proceeds incremental invoices are issued.

Saturday, March 24, 2012

PLEASE HELP = odd TextChanged behavior

I have 2 TextBox controls on a webform. Both perform a procedure when the
TextChanged event is fired. The page should reload and display a new value
in another textbox. Both are WebControls.

The first Textbox performs the appropriate action.

The SECOND does not fire TextChanged until AFTER I click the Submit button.
It does not fire when I change the text and lose the control focus. Both
code blocks for the event handlers are IDENTICAL.

Anyone know why?Just to make sure:

have you set the autopostback flag to true?

Seb.
Just to make sure:

have you set the autopostback flag to true?

Seb.
heh... *sheepish grin*

"Seb" <anonymous@.discussions.microsoft.com> wrote in message
news:073501c39869$48c82490$a501280a@.phx.gbl...
> Just to make sure:
> have you set the autopostback flag to true?
> Seb.
heh... *sheepish grin*

"Seb" <anonymous@.discussions.microsoft.com> wrote in message
news:073501c39869$48c82490$a501280a@.phx.gbl...
> Just to make sure:
> have you set the autopostback flag to true?
> Seb.

Wednesday, March 21, 2012

please help me

i have a qustions
please help me
for example i have 3 webform names (webform1.aspx.webform2.aspx,webform3.aspx) in webform1.aspx,webform2.aspx this is a hyperlink that url is webform3.aspx when i click this go to webform3
now i know when i in webform3 i login in webform1 or webform2
this is write which webform loginHello,
I didnt get you but maybe you want to get the page redirected from, use this

request.UrlReferrer
regards

Please help me ..(:

Hi,

When user clicks on the PRINT button, i like the system automatically print a WEBFORM ASPX file (which is in Report format)..ie, OnClick it should call that ASPX file and print it...

Please advice me (:You have to make a "Printer Friendly Version" button that the user can click to go to that page (or load a pop up) and then call window.print(); (I think).
You can also create a style in your stylesheet that will resize the controls differently for "print" and "screen" situations. This will allow you to auto-resize all pages so they
are printer-friendly.
Hello -

I'm assuming you have something like an array (list) of documents that
you would like to choose from to print...

I had the same type of task...

I completed it with having a button for each entry on the form, and when
the user pressed a button, a child window (popup) would display the
form (or PDF)
The popup window had a header frame that allowed the user to print or
cancel the form...

the trick was, once the popup window ready to be displayed, i would create
a DIV tag around the entire contents, and the print button would print the
contents of the DIV tag...

I also added a little model window magic - to keep the child window
open until the user closes the popup.

Worked like a champ.

best of luck

take care
tony
Hi,

it's a much cleaner solution to use css for this one. Take a look at this article:CSS Design: Going to Print.

Grz, Kris.

Friday, March 16, 2012

please help me to solve my provblem..its very urgent

i have a button in my webform. whenever i click that button it should display the crystal report designer window so that the end user can design his own report...
i don't know how to display crystal report designer window at runtime in asp.net.please help me...

please please help me...its very very urgent

Hello Niranjana,

A CrystalReportViewer needs a CrystalReportSource in order to function. So, in the scenario you outlined above, you'd need to dynamically add both to the page. In VB.NET, this would look something like the following:

 Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim crs As New CrystalDecisions.Web.CrystalReportSource crs.ID = "CrystalReportSource1" crs.Report.FileName = "CrystalReport1.rpt" form1.Controls.Add(crs) Dim crv As New CrystalDecisions.Web.CrystalReportViewer crv.Height = New Unit("200px") crv.Width = New Unit("200px") crv.AutoDataBind = True crv.ReportSourceID = "CrystalReportSource1" form1.Controls.Add(crv) End Sub

HTH,
Clay


sir,

thank you so much for ur information.

but my problem is different. I need to design the crystal report at runtime... ie one end user be able to design his crystal report.. ie adding fields ,formatting crystal reports all those things...

if u have any idea please help me sir

thanks & regards

nisha


Hi nish,

I dont whether its possible to enable the users to design his own reports... But try the below logic...

1. You need to list all of the fileds available in the reports...

2. Create the query which fetches the data from the table for the fields selected by the user and empty for unselected fileds. (initially you need to design the reports with all the fields)

3. suppress the fields in crystal reports if the field value is empty.

I hope the above will help you...


that i can do sir,i have already listed all the fields of a table in a listbox and use that to create crystal report...

my problem is really different...the end user should able to design his own crystal reports.

at runtime the designer should come. can we use any Report Designer Component(RDC) in asp.net...i am not getting an exact idea from net also. if u can please help me sir...


Hi nish,

Sorry I dont know whether its possible or not... I think its not available in Crystal reports... but may be in some other third party report tools...


anyway..thank you sir..