Exemple #1
0
 public void AddExamDate(Entities.ExamDate c1, Entities.Subjects s2, Entities.Section s3, Entities.Class c2, Entities.personalInfo p1, Entities.ExamType e1)
 {
     using (WSqlCommand s1 = new WSqlCommand(dbconstring, "[dbo].[spInsertExamDate]"))
     {
         s1.AddParameter("@subjectName", System.Data.SqlDbType.NVarChar, s2.subjectName);
         s1.AddParameter("@sectionName", System.Data.SqlDbType.NVarChar, s3.sectionName);
         s1.AddParameter("@className", System.Data.SqlDbType.NVarChar, c2.className);
         s1.AddParameter("@examTypeId", System.Data.SqlDbType.NVarChar, e1.examTypeId);
         s1.AddParameter("@iAm", System.Data.SqlDbType.NVarChar, p1.pKId);
         s1.AddParameter("@examDate", System.Data.SqlDbType.Date, c1.examDate);
         s1.AddParameter("@totalMarks", System.Data.SqlDbType.Int, c1.totalMarks);
         s1.Execute();
     }
 }
        protected void AddExamDate(object sender, EventArgs e)
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('ExamDate')", true);
            if (Page.IsValid)
            {

                DBHandler.DBHandler db = new DBHandler.DBHandler(con);
                Entities.ExamDate cc1 = new Entities.ExamDate()
                {
                    examDate = EDate.Text,
                    totalMarks = Convert.ToInt32(TotalMarks.Value),

                };
                Entities.Section s1 = new Entities.Section()
                {
                    sectionName = DropDownList2.SelectedValue,

                };
                Entities.Class c1 = new Entities.Class()
                {
                    className = DropDownList1.SelectedValue,

                };
                Entities.Subjects s2 = new Entities.Subjects()
                {
                    subjectName = DropDownList3.SelectedValue,

                };
                Entities.personalInfo p1 = new Entities.personalInfo()
                {
                    pKId = Session["School"].ToString(),

                };

                Entities.ExamType e1 = new Entities.ExamType()
                {
                    examTypeId = DropDownList4.SelectedValue,
                };
                db.AddExamDate(cc1, s2, s1, c1, p1, e1);
                GridView1.DataBind();
                UpdatePanel1.Update();

            }
        }
        protected void AddExamDate(object sender, EventArgs e)
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "id", "toggle_forms('ExamDate')", true);
            if (Page.IsValid)
            {
                DBHandler.DBHandler db  = new DBHandler.DBHandler(con);
                Entities.ExamDate   cc1 = new Entities.ExamDate()
                {
                    examDate   = EDate.Text,
                    totalMarks = Convert.ToInt32(TotalMarks.Value),
                };
                Entities.Section s1 = new Entities.Section()
                {
                    sectionName = DropDownList2.SelectedValue,
                };
                Entities.Class c1 = new Entities.Class()
                {
                    className = DropDownList1.SelectedValue,
                };
                Entities.Subjects s2 = new Entities.Subjects()
                {
                    subjectName = DropDownList3.SelectedValue,
                };
                Entities.personalInfo p1 = new Entities.personalInfo()
                {
                    pKId = Session["School"].ToString(),
                };

                Entities.ExamType e1 = new Entities.ExamType()
                {
                    examTypeId = DropDownList4.SelectedValue,
                };
                db.AddExamDate(cc1, s2, s1, c1, p1, e1);
                GridView1.DataBind();
                UpdatePanel1.Update();
            }
        }