Ejemplo n.º 1
0
 protected void BtnAdd_Click(object sender, EventArgs e)
 {
     marks  = Convert.ToInt32(lblmarks.Text);
     marks1 = Convert.ToInt32(txtmarks.Text);
     if (marks1 > marks)
     {
         lblmsg.Text = "Marks Should Not More Then The Total Marks";
     }
     else
     {
         dt3 = obj.CheckSubSubjectMarks(Convert.ToInt32(ddnsubject.SelectedValue));
         if (dt3.Rows.Count > 0)
         {
             count = Convert.ToInt32(dt3.Rows[0]["Marks"]);
             if (count > marks)
             {
                 lblmsg.Text = "You Are Not Allowed To Enter Marks";
             }
             if (count <= marks)
             {
                 i = obj.AddSubSubject(Convert.ToInt32(ddnsubject.SelectedValue), txtsubsubjectname.Text, Convert.ToInt32(txtmarks.Text), "Admin", DateTime.Now.ToString());
                 if (i > 0)
                 {
                     txtsubsubjectname.Text = "";
                     txtmarks.Text          = "";
                     BindData();
                 }
             }
         }
     }
 }