Exemple #1
0
        private int GetTotalPassCredit(int StudentId, string ProgramId)
        {
            int        Credits = 0;
            DBCommon   db      = new DBCommon();
            SqlCommand cmd     = new SqlCommand();

            cmd.CommandText = "sp_GetTotalPassCredits";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@studentid", StudentId.ToString());
            cmd.Parameters.AddWithValue("@ProgramId", ProgramId);

            Credits = Convert.ToInt32(db.GetValue(cmd));

            return(Credits);
        }
        protected void Search_Click1(object sender, EventArgs e)
        {
            DBCommon   db  = new DBCommon();
            SqlCommand cmd = new SqlCommand("select StudentId from tsstudent where SID=@SID ");

            cmd.Parameters.AddWithValue("@SID", TextBox1.Text);

            string StudentId = db.GetValue(cmd);

            Session.RemoveAll();
            if (StudentId != "")
            {
                Session["StudentId"] = Convert.ToInt32(StudentId);
                Response.Redirect("StudentPlans.aspx");
            }
            else
            {
                Label1.Text      = "Your SID is incorrect";
                Label1.ForeColor = System.Drawing.Color.Red;
            }
        }