public void Update()
 {
     //connect to the database
     clsDataConnection DB = new clsDataConnection();
     //set the parameters for the stored procedure
     DB.AddParameter("@ConsultantNo", thisConsultant.ConsultantNo);
     DB.AddParameter("@FirstName", thisConsultant.FirstName);
     DB.AddParameter("@LastName", thisConsultant.LastName);
     DB.AddParameter("@DateOfBirth", thisConsultant.DateOfBirth);
     DB.AddParameter("@Address", thisConsultant.Address);
     DB.AddParameter("@Email", thisConsultant.Email);
     DB.AddParameter("@TelephoneNo", thisConsultant.TelephoneNo);
     DB.AddParameter("@EmergencyContact", thisConsultant.EmergencyContact);
     DB.AddParameter("@EmploymentDate", thisConsultant.EmploymentDate);
     DB.AddParameter("@HoursOfWork", thisConsultant.HoursOfWork);
     DB.AddParameter("@EmploymentHistory", thisConsultant.EmploymentHistory);
     DB.AddParameter("@Status", thisConsultant.Status);
     DB.AddParameter("@DateAdded", thisConsultant.DateAdded);
     //execute the stored procedure to insert data
     DB.Execute("sproc_tblConsultant_Update");
 }
Ejemplo n.º 2
0
 public bool Find(int EventCode)
 {
     //create an instance of the data connection
     clsDataConnection DB = new clsDataConnection();
     //add the parameter for the event code to search for
     DB.AddParameter("EventCode", EventCode);
     //execute the stored procedure
     DB.Execute("sproc_tblEvent_FilterByEventCode");
     //if one record is found ,there should be either one or zero!
     if (DB.Count == 1)
     {
         //copy the data from the databse to the private data members
         eventCode = Convert.ToInt32(DB.DataTable.Rows[0]["EventCode"]);
         eventName = Convert.ToString(DB.DataTable.Rows[0]["EventName"]);
         companyName = Convert.ToString(DB.DataTable.Rows[0]["CompanyName"]);
         contact = Convert.ToString(DB.DataTable.Rows[0]["Contact"]);
         startDate = Convert.ToDateTime(DB.DataTable.Rows[0]["StartDate"]);
         guestSpeaker = Convert.ToString(DB.DataTable.Rows[0]["GuestSpeaker"]);
         location = Convert.ToString(DB.DataTable.Rows[0]["Location"]);
         typeOfEvent = Convert.ToString(DB.DataTable.Rows[0]["TypeOfEvent"]);
         consultantAttending = Convert.ToString(DB.DataTable.Rows[0]["ConsultantAttending"]);
         //return that everything worked ok
         return true;
     }
     //if no record was found
     else
     {
         //return false indicating a problem
         return false;
     }
 }
 public void Update()
 {
     //update an existing record based on the values of thisaddress
     //connect to the database
     clsDataConnection DB = new clsDataConnection();
     //set the parameters for the stored procedure
     DB.AddParameter("@CompanyCode", thisCompany.CompanyCode);
     DB.AddParameter("@CompanyAddress", thisCompany.CompanyAddress);
     DB.AddParameter("@CompanyEmailAddress", thisCompany.CompanyEmailAddress);
     DB.AddParameter("@InvolvedClient", thisCompany.InvolvedClient);
     DB.AddParameter("@InvolvedProject", thisCompany.InvolvedProject);
     DB.AddParameter("@MobileNumber", thisCompany.MobileNumber);
     DB.AddParameter("@PhoneNumber", thisCompany.PhoneNumber);
     //execute the query returning the primary key value
     DB.Execute("sproc_tblCompany_Update");
 }
 public void Delete()
 {
     //deletes the record pointed to by thisconsultant
     clsDataConnection DB = new clsDataConnection();
     //set the parameters for the stored procedure
     DB.AddParameter("@ConsultantNo", thisConsultant.ConsultantNo);
     //execute the stored procedure
     DB.Execute("sproc_tblConsultant_Delete");
 }
Ejemplo n.º 5
0
 public bool Find(int ProjectCode)
 {
     //create an instance of the data connection
     clsDataConnection DB = new clsDataConnection();
     //add the parameter for the event code to search for
     DB.AddParameter("ProjectCode", ProjectCode);
     //execute the stored procedure
     DB.Execute("sproc_tblProject_FilterByProjectCode");
     //if one record is found ,there should be either one or zero!
     if (DB.Count == 1)
     {
         //copy the data from the databse to the private data members
         ProjectCode = Convert.ToInt32(DB.DataTable.Rows[0]["ProjectCode"]);
         ProjectName = Convert.ToString(DB.DataTable.Rows[0]["ProjectName"]);
         CompanyName = Convert.ToString(DB.DataTable.Rows[0]["CompanyName"]);
         ProjectConsultant = Convert.ToString(DB.DataTable.Rows[0]["ProjectConsultant"]);
         CompanyContact = Convert.ToString(DB.DataTable.Rows[0]["CompanyContact"]);
         ExpectedEndDate = Convert.ToDateTime(DB.DataTable.Rows[0]["ExpectedEndDate"]);
         StartDate = Convert.ToDateTime(DB.DataTable.Rows[0]["StartDate"]);
         ProjectLocation = Convert.ToString(DB.DataTable.Rows[0]["ProjectLocation"]);
         //return that everything worked ok
         return true;
     }
     //if no record was found
     else
     {
         //return false indicating a problem
         return false;
     }
 }
 public void Delete()
 {
     //deletes the record pointed to by thisCompany
     //connects to the database
     clsDataConnection DB = new clsDataConnection();
     //set the parameters for the stored procedure
     DB.AddParameter("@CompanyCode", thisCompany.CompanyCode);
     //execute the stored procedure
     DB.Execute("sproc_tblCompany_Delete");
 }
 public void Update()
 {
     //update an existing record based on the values of thisaddress
     //connect to the database
     clsDataConnection DB = new clsDataConnection();
     //set the parameters for the stored procedure
     DB.AddParameter("@EventCode", thisEvent.EventCode);
     DB.AddParameter("@EventName", thisEvent.EventName);
     DB.AddParameter("@CompanyName", thisEvent.CompanyName);
     DB.AddParameter("@ConsultantAttending", thisEvent.ConsultantAttending);
     DB.AddParameter("@Contact", thisEvent.Contact);
     DB.AddParameter("@StartDate", thisEvent.StartDate);
     DB.AddParameter("@GuestSpeaker", thisEvent.GuestSpeaker);
     DB.AddParameter("@Location", thisEvent.Location);
     DB.AddParameter("@TypeOfEvent", thisEvent.TypeOfEvent);
     //execute the query returning the primary key value
     DB.Execute("sproc_tblEvent_Update");
 }
        public int Add()
        {
            //adds a new record to the database based on the values of thisEvent
            //set the primary key value pof the new record
            clsDataConnection DB = new clsDataConnection();

               //set the parameters for the stored procedure
            DB.AddParameter("@EventCode", thisEvent.EventCode);
            DB.AddParameter("@EventName", thisEvent.EventName);
            DB.AddParameter("@CompanyName", thisEvent.CompanyName);
            DB.AddParameter("@ConsultantAttending", thisEvent.ConsultantAttending);
            DB.AddParameter("@Contact", thisEvent.Contact);
            DB.AddParameter("@StartDate", thisEvent.StartDate);
            DB.AddParameter("@GuestSpeaker", thisEvent.GuestSpeaker);
            DB.AddParameter("@Location", thisEvent.Location);
            DB.AddParameter("@TypeOfEvent", thisEvent.TypeOfEvent);
            //execute the query returning the primary key value
            return DB.Execute("sproc_tblEvent_Insert");
        }
 public void Update()
 {
     //update an existing record based on the values of thisaddress
     //connect to the database
     clsDataConnection DB = new clsDataConnection();
     //set the parameters for the stored procedure
     DB.AddParameter("@ClientNo", thisClient.ClientNo);
     DB.AddParameter("@ClientName", thisClient.ClientName);
     DB.AddParameter("@ClientEmail", thisClient.ClientEmail);
     DB.AddParameter("@ClientPosition", thisClient.ClientPosition);
     DB.AddParameter("@ClientQualification", thisClient.ClientQualification);
     DB.AddParameter("@ClientService", thisClient.ClientService);
     DB.AddParameter("@ClientAddress", thisClient.ClientAddress);
     DB.AddParameter("@ClientTel", thisClient.ClientTel);
     DB.AddParameter("@DateAdded", thisClient.DateAdded);
     DB.AddParameter("@Active", thisClient.Active);
     //execute the query returning the primary key value
     DB.Execute("sproc_tblClient_Update");
 }
Ejemplo n.º 10
0
        public bool Find(int ClientNo)
        {
            //create an instance of the data connection
            clsDataConnection DB = new clsDataConnection();
            //add the parameter for the clientno to search for
            DB.AddParameter("ClientNo", ClientNo);
            //execute the stored procedure
            DB.Execute("sproc_tblClient_FilterByClientNo");
            //if one record is found (there should be either one or zero!)
            if (DB.Count == 1)
            {

                //set the private data member to the test data value
                clientNo = Convert.ToInt32(DB.DataTable.Rows[0]["ClientNo"]);
                clientName = Convert.ToString(DB.DataTable.Rows[0]["ClientName"]);
                clientEmail = Convert.ToString(DB.DataTable.Rows[0]["ClientEmail"]);
                clientPosition = Convert.ToString(DB.DataTable.Rows[0]["ClientPosition"]);
                clientQualification = Convert.ToString(DB.DataTable.Rows[0]["ClientQualification"]);
                clientService = Convert.ToString(DB.DataTable.Rows[0]["ClientService"]);
                clientAddress = Convert.ToString(DB.DataTable.Rows[0]["ClientAddress"]);
                clientTel = Convert.ToInt32(DB.DataTable.Rows[0]["ClientTel"]);
                dateAdded = Convert.ToDateTime(DB.DataTable.Rows[0]["DateAdded"]);
                active = Convert.ToBoolean(DB.DataTable.Rows[0]["Active"]);
                //always return true
                return true;
            }
            //if no record was found
            else
            {
                //return false indicating a problem
                return false;
            }
        }
Ejemplo n.º 11
0
 public bool Find(int CompanyCode)
 {
     //create an instance of the data connection
     clsDataConnection DB = new clsDataConnection();
     //add the parameter for the event code to search for
     DB.AddParameter("CompanyCode", CompanyCode);
     //execute the stored procedure
     DB.Execute("sproc_tblCompany_FilterByCompanyCode");
     //if one record is found ,there should be either one or zero!
     if (DB.Count == 1)
     {
         //copy the data from the databse to the private data members
         companyCode = Convert.ToInt32(DB.DataTable.Rows[0]["CompanyCode"]);
         companyAddress = Convert.ToString(DB.DataTable.Rows[0]["CompanyAddress"]);
         companyEmailAddress = Convert.ToString(DB.DataTable.Rows[0]["CompanyEmailAddress"]);
         involvedClient = Convert.ToString(DB.DataTable.Rows[0]["InvolvedClient"]);
         involvedProject = Convert.ToString(DB.DataTable.Rows[0]["InvolvedProject"]);
         mobileNumber = Convert.ToString(DB.DataTable.Rows[0]["MobileNumber"]);
         phoneNumber = Convert.ToString(DB.DataTable.Rows[0]["PhoneNumber"]);
         //return that everything worked ok
         return true;
     }
     //if no record was found
     else
     {
     //return false indicating a problem
         return false;
     }
 }