Archive for the ‘c-sharp’ Category

the project, part 2

ok. so i figured it out. my previous post set me on the right track. here’s what i arrived at, finally. just using the adapter that i created on the form and adding the database tables i need. and then just coding the on-click event of each button to perform the function – i.e. add/update a row. no need to create the connection to the database manually for each and every button. simple. not sure why the ’sample’ had such complicated coding.

as for loading the data … i simply attached the loading of the dataset to each tab page. only one page has data actually bound to the text/list box controls. the other forms are form entering data to add to the database. and there’s the report viewer. that’s it. simple.
then i figured out the audit thing. even handler, indeed. i changed the system to recordĀ  payment voids – the amount, date, ID. but i see from testing that information can be changed on my updates form. and so i need a second audits table to record changes made to information made on that form.

i question having an add lease form and a separate update lease form. once again, i followed the lead of the sample. but … now i wonder what the point of that separate form is, really. i suppose, if i’m still convinced its superfluous by monday a.m. i can just delete the controls and make it a welcome/instruction tab page.

project: design a program~c-sharp front-end; sql server back-end

ok. so i have a windows form with 4 tab-controlled pages. each tab page related to a different function of the program. tab 1 ~ add a lease ~ 2 buttons and several text boxes. tab 2 ~ crystal report viewer. tab 3 ~ update lease ~ 3 buttons and several text boxes. tab 4 ~ make payment ~ 1 button, 1 check box and several text boxes. at the back end, a SQL Server 2000 database. no class libraries for this project. just windows controls and event handlers and ADO.NET controls.

ok. so. i am looking at the source code of a ’sample’ … something given to me to inspire my own creation. its deficient. lacking in some of the basic, stated requirements. and coded weirdly. like … each windows control – i.e. button – click event has the ADO.NET objects coded within it. i wonder, why not just attach the connection to the tab-click of the tab page to which it pertains? why repeat the same code for so many buttons? i don’t get it.

and what of an event handler that considers the whole audit thing? the audit thing being that, an audit table must get updated in the event of any changes made to the lease table can i attach an audit-related event handler to ‘add lease’ (submit) and ‘update lease’ (update) buttons? is that what i do to implement the auditing system?

and what about the whole void payments thing? the ‘make payment’ tab page has a check box for users to indicate whether they are voiding the payment. does void now become a new field in my payments table? this void field would take on a boolean/binary type – 0 for false or not voided and 1 for true or voided, right? that seems to make sense.