I am new to ASP.net C#. I have an application to get inputs from users and save in database. I have followed the N-tier architecture in creating this app upon request. I have created an object in the codebehind and set the input values to them and pass the object to a method in the Business Layer and also called a method in Data Access Layer to the Business Layer. The data is saved to the database within the method of the Data Access Layer. Please help.
Here's my codebehind :
try
{
OtherCompany om = new OtherCompany();
NDAStaff ns = new NDAStaff();
DateTime dt = Convert.ToDateTime(RadDatePicker1.SelectedDate);
om.Date = dt.ToShortDateString();
om.ComName = compName.Text;
om.RegNumber = compReg.Text;
om.Country = countryIncorp.Text;
om.RegOfficeAddress = officeAddr.Text;
om.ComRef = compRef.Text;
om.CoreBuss = busiCore.Text;
om.ComService = reqServ.Text;
int index = servList.Items.Count;
for (int i = 0; i < index; i++)
{
om.ReqServiceDetails[i] = servList.Items[i].Value;
}
om.ReprentName = fullName2.Text;
om.ReprentDesig = desigOther.Text;
om.Witness1Name = witFullName3.Text;
om.Witness1Desig = witDesig1.Text;
om.Witness1Address = witDept1.Text;
om.Witness2Name = witFullName4.Text;
om.Witness2Desig = witDesig4.Text;
om.Witness2Adress = witAddr4.Text;
ns.Staffname = fullName1.Text;
ns.Designation = desigSriLan.Text;
ns.Wit1Name = witFullName1.Text;
ns.Wit1Designation = witDesig1.Text;
ns.Wit1Department = witDept1.Text;
ns.Wit2Name = witFullName2.Text;
ns.Wit2Designation = witDesig2.Text;
ns.Wit2Department = witDept2.Text;
NDAGenProcessor ndap = new NDAGenProcessor();
OtherCompanyProcessor ocp = new OtherCompanyProcessor(om);
NDAstaffProcessor nsp = new NDAstaffProcessor();
int NADid = ocp.createNDAID();
//ndap.createPDF(om, ns, NADid);
ocp.getCompanyDetails(NADid);
nsp.addNDAstaffData(ns, NADid);
}
catch (Exception ex)
{
throw ex;
}