logo

Assignment on Object Oriented Programming

7 Pages477 Words169 Views
   

Added on  2020-05-04

Assignment on Object Oriented Programming

   Added on 2020-05-04

ShareRelated Documents
JUSTIFICATION OF USING.1.OBJECT ORINTED PRORAMMING.2.IMPLEMENTING SEARCHING OF CHILDREN AGE GROUPS.3.IMPLEMETING THE PAYMENT METHODS.
Assignment on Object Oriented Programming_1
i.Object oriented programming.The system was developed using the object oriented programming using the C# and asp.netwhere class and polymorphism has been used as below.i.Classes.The system has used the classes which are the constructs that allows user to have customclass which is made of collection of the variables methods and the events. Below is a sample class used in the system.using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data.SqlClient;using System.Data;using System.Configuration;using System.Data.OleDb; namespace LOLSYSTEM{publicpartialclassparents : System.Web.UI.Page {//the parents class {//this is the method for loading the data from the data table and display it on a gridview.protectedvoid Page_Load(object sender, EventArgs e) {string con2 = ""; con2 = ConfigurationManager.ConnectionStrings["Conn"].ToString();OleDbConnection scon = newOleDbConnection(con2); scon.Open();OleDbCommand scmd = newOleDbCommand("Select * from PARENTSDETAILS",scon);
Assignment on Object Oriented Programming_2
GridView1.DataSource = scmd.ExecuteReader(); GridView1.DataBind(); }ii.Polymorphism.The polymorphism is the situation where there is abilities of holding or using multiple formsof codes and the below is sample code used to implement it.protectedvoid GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) {// deleting the record from the databaseint index = Convert.ToInt32(e.RowIndex);int index1 = Convert.ToInt32(GridView1.Rows[index].Cells[1].Text);string conn = ConfigurationManager.ConnectionStrings["Conn"].ConnectionString;using (OleDbConnection scon = newOleDbConnection(conn)) {using (OleDbCommand scmd = newOleDbCommand("DELETE FROMPARENTSDETAILS WHERE PARENTSID = @PARENTSID")) { scmd.Parameters.AddWithValue("@PARENTSID", index1); scmd.Connection = scon; scon.Open(); scmd.ExecuteNonQuery(); scon.Close(); } }string con2 = ""; con2 = ConfigurationManager.ConnectionStrings["Conn"].ToString();OleDbConnection scon2 = newOleDbConnection(con2); scon2.Open();OleDbCommand scmd1 = newOleDbCommand("Select * from PARENTSDETAILS",scon2); GridView1.DataSource = scmd1.ExecuteReader();
Assignment on Object Oriented Programming_3

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Working with Sessions and Collections in .NET Web Forms Applications
|4
|860
|356

The Java Programming Document
|19
|2557
|43