예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["Tid"] == null)
            {
                Response.Redirect("Tutorlogin.aspx");
            }
            string         tutorid = Session["Tid"].ToString();
            string         sql     = "Select * from TDocuments where Type='Syllabus'  and Tid='" + tutorid + "'";
            SqlDataAdapter da1     = new SqlDataAdapter(sql, con);
            DataSet        ds      = new DataSet();
            da1.Fill(ds);
            int i = ds.Tables[0].Rows.Count;
            if (i > 0)
            {
                GridView1.DataSource = ds;
                GridView1.DataBind();
            }

            string         tid       = Session["Tid"].ToString();
            string         co        = "Select Cname from Course where Cid IN (Select Cid from TutorSubjects where Tid = '" + tid + "')";
            SqlDataAdapter daa1      = new SqlDataAdapter(co, con);
            DataSet        myDataSet = new DataSet();
            daa1.Fill(myDataSet, "Course");
            DropDownCourse.DataSource = myDataSet;
            DropDownCourse.DataBind();
            DropDownCourse.DataTextField  = "Cname";
            DropDownCourse.DataValueField = "Cname";
            DropDownCourse.DataBind();
            DropDownCourse.Items.Insert(0, "--Select--");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["videoupload"] == "upload")
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "msgtype", "alert('Tutorial Added Susscessfully.')", true);
                Session["videoupload"] = "";
            }

            if (Session["notesupload"] == "upload")
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "msgtype", "alert('Notes Added Susscessfully.')", true);
                Session["notesupload"] = "";
            }
            if (Session["Tid"] == null)
            {
                Response.Redirect("Tutorlogin.aspx");
            }
            string         tutorid = Session["Tid"].ToString();
            string         sql     = "Select * from TDocuments where Type='Notes'and Tid='" + tutorid + "'";
            SqlDataAdapter da1     = new SqlDataAdapter(sql, con);
            DataSet        ds      = new DataSet();
            da1.Fill(ds);
            int i = ds.Tables[0].Rows.Count;
            if (i > 0)
            {
                GridView1.DataSource = ds;
                GridView1.DataBind();
            }

            string         tid       = Session["Tid"].ToString();
            string         co        = "Select Cname from Course where Cid IN (Select Cid from TutorSubjects where Tid = '" + tid + "')";
            SqlDataAdapter daa1      = new SqlDataAdapter(co, con);
            DataSet        myDataSet = new DataSet();
            daa1.Fill(myDataSet, "Course");
            DropDownCourse.DataSource = myDataSet;
            DropDownCourse.DataBind();
            DropDownCourse.DataTextField  = "Cname";
            DropDownCourse.DataValueField = "Cname";
            DropDownCourse.DataBind();
            DropDownCourse.Items.Insert(0, "--Select--");

            DropDownCourse1.DataSource = myDataSet;
            DropDownCourse1.DataBind();
            DropDownCourse1.DataTextField  = "Cname";
            DropDownCourse1.DataValueField = "Cname";
            DropDownCourse1.DataBind();
            DropDownCourse1.Items.Insert(0, "--Select--");
        }
    }
예제 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            hfcount.Value = "Notchanged";
            string sql = "SELECT Tutor.Tid,Tutor.Name,Tutor.Email,Tutor.Contact,Tutor.Pass,TutorSubjects.Cid,Course.Cname,TutorSubjects.Sbid,Subjects.Sname  FROM Tutor full JOIN TutorSubjects ON Tutor.Tid = TutorSubjects.Tid full join Subjects on subjects.Sbid = TutorSubjects.Sbid full join Course on Course.Cid = TutorSubjects.Cid WHERE Tutor.TID != ''";

            SqlDataAdapter da1 = new SqlDataAdapter(sql, con);
            DataSet        ds  = new DataSet();
            da1.Fill(ds);
            int i = ds.Tables[0].Rows.Count;
            if (i > 0)
            {
                GridView1.DataSource = ds;
                GridView1.DataBind();
            }


            string         co        = "Select Cname from Course";
            SqlDataAdapter daa1      = new SqlDataAdapter(co, con);
            DataSet        myDataSet = new DataSet();
            daa1.Fill(myDataSet, "Course");
            DropDownCourse.DataSource = myDataSet;
            DropDownCourse.DataBind();
            DropDownCourse.DataTextField  = "Cname";
            DropDownCourse.DataValueField = "Cname";
            DropDownCourse.DataBind();
            DropDownCourse.Items.Insert(0, "--Select--");



            string         co1        = "Select Cname from Course";
            SqlDataAdapter d1         = new SqlDataAdapter(co1, con);
            DataSet        myDataSet1 = new DataSet();
            d1.Fill(myDataSet1, "Course");
            DropDownupdatecourse.DataSource = myDataSet1;
            DropDownupdatecourse.DataBind();
            DropDownupdatecourse.DataTextField  = "Cname";
            DropDownupdatecourse.DataValueField = "Cname";
            DropDownupdatecourse.DataBind();
            DropDownupdatecourse.Items.Insert(0, "--Select--");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["Tid"] == null)
            {
                Response.Redirect("Tutorlogin.aspx");
            }
            string         tid       = Session["Tid"].ToString();
            string         co        = "Select Cname from Course where Cid IN (Select Cid from TutorSubjects where Tid = '" + tid + "')";
            SqlDataAdapter daa1      = new SqlDataAdapter(co, con);
            DataSet        myDataSet = new DataSet();
            daa1.Fill(myDataSet, "Course");
            DropDownCourse.DataSource = myDataSet;
            DropDownCourse.DataBind();
            DropDownCourse.DataTextField  = "Cname";
            DropDownCourse.DataValueField = "Cname";
            DropDownCourse.DataBind();
            DropDownCourse.Items.Insert(0, "--Select--");

            maindiv.PreRender += new EventHandler(Panel1_OnPreRender);
        }
    }