Click here to Skip to main content
15,890,527 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
This is the Data Access (DA) layer

C#
public class TutorRegistratonDAL
{
        SqlConnection con = new SqlConnection();
        SqlTransaction tr = new SqlTransaction();
        
        public DataSet Inserttutor(DataSet ds_sub,DataSet ds_lang,DataSet ds_time)
        {
            con.ConnectionString = StrCon;
            try
            {
                con.Open();
                SqlBulkCopy sub_copy = new SqlBulkCopy(con);
                sub_copy.DestinationTableName = "tutor_subjects";
                DataTable sub_dt = new DataTable();
                sub_dt= ds_sub.Tables[0];
                sub_copy.WriteToServer(sub_dt);
                SqlBulkCopy lang_copy = new SqlBulkCopy(con);
                lang_copy.DestinationTableName = "tutor_languages";
                DataTable lang_dt = new DataTable();
                lang_dt = ds_lang.Tables[0];
                lang_copy.WriteToServer(lang_dt);
                tr.Commit();
                return true;
            }
            catch (Exception ex)
            {
                tr.Rollback();
                return false;
            }
            finally
            {            
                con.Close();
            }
         }



This is the Business layer

C#
public class TutorRegistratonBAL
    {
        public DataSet Inserttutor(
            DataSet ds_sub,DataSet ds_lang)
        {
            TutorRegistratonDAL DALobj = new TutorRegistratonDAL();
            return DALobj.Inserttutor(ds_sub,ds_lang);
        }
}



How would the code for the UI layer be?
Posted
Updated 8-Apr-10 0:58am
v2

Well, usually the UI is there to grab the data that you need, validating it prior to sending it to the Business Logic Layer. It also acts as a source of information for the user, either as feedback from the system or the result of some action that has been performed that is supposed to return a result.

Having said that, how do you expect us to know what it is you want on the UI?
 
Share this answer
 
sankarbrr wrote:
How would the code for the UI layer be?


Hmm, dont you mean where?

If so, probably the same place you copied the other code from.
 
Share this answer
 
v2
More information required.

How do you want the UI to look, or handle data, or what outputs to it will be required.

There is no Generic UI interpretation.

Give us a clue.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900