locked
Help understanding a good flow course on my asp webform proyect. RRS feed

  • Question

  • User-2037392709 posted

    Hello, I have some concerns about understanding and making a good design within my proyect complete flow path. Lets say I have 2 webform page1, page2 and 2 controls control1, control2 and using ado.net. The idea is that in the first page you fill data from the buyer and generate an ID to that sale. The next page fill data of products for that sale. In both pages you complete the form and makes the insertion into the db (first one data from the buyer and second products of that sale). Now theses doubts I have..

    The proyect employ 3 layer architecture (BO, BLL, DAL). In the page1, it contains control1 (basically most of the user info goes here), few data concerning the (sale date, user who is making the sale, etc) and the save button that after everything is ok it redirects to the next page. Here comes my doubts, after everything is inserted/selected from that page. When saving, btnclick event fire, it validate the page using validationsummary and then, should I call a public method of the control1 to create BO object and populate them like cuControl1.populate()? or call a method of the page1 and populate BO oject accesing control1 controls via public properties one by one? After populating them I save them making a call to the SP and adding the parameters. It then redirect to the second page. Here another doubt, im going to use data from BO objects created in the page1 in the page2. Before redirecting to page2, should I save those BO ojects in a Session (Session["person"]) or should I just create an SP to retrieve the data and create a method in the page2 when I need them like Person person = call SP that return person object populated and make person an static variable in page2? What if from page2 I go back to page1, should i use session or call sp? What if after finishing everything another person (from a menu) he inserts the ID of that sale to check the data, in this case should be almost obligatory to call an SP right?

    page2 behaviour is pretty much the same as page1, validate page, create bo object, insert to bd, etc. I know this post is very messy and confusing but I hope someone could help me since I really want to make an optimal design for this type of flow.

    Friday, May 4, 2018 2:43 AM

Answers

All replies