Exemplo n.º 1
0
        protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            Utility u = new Utility();
            int     i = u.GetAdmissionNumber(ListBox1.SelectedValue);

            StudentAdno = i.ToString();
            SimplePupil p  = new SimplePupil(); p.Load_Left(i);
            Encode      en = new Encode();

            SqlDataSource2.SelectCommand    = GetQueryString();
            SqlDataSource2.ConnectionString = en.GetDbConnection();
            SqlDataSource2.DataBind();
            string s = "SELECT COUNT (ExamEntryID)  FROM dbo.qry_Cerval_Exams_Entries " + GetWhereString();

            Label_Grid.Text = "Entries for " + p.m_GivenName + " " + p.m_Surname + " (" + StudentAdno + ") ....  Total Entries =" + en.Execute_one_SQL(s);
        }
        protected void TextBox1_TextChanged(object sender, EventArgs e)
        {
            int i = 0;

            try
            {
                i = System.Convert.ToInt32(TextBox_StudentAdno.Text);
                SimplePupil p = new SimplePupil(); p.Load_Left(i);
                StudentID = p.m_StudentId.ToString();
                Encode en = new Encode();
                SqlDataSource1.SelectCommand    = GetQueryString();
                SqlDataSource1.ConnectionString = en.GetDbConnection();
                SqlDataSource1.DataBind();
                Label_Grid.Text = "Entries for " + p.m_GivenName + " " + p.m_Surname + " (" + p.m_adno.ToString() + ")";
            }
            catch { }
        }
Exemplo n.º 3
0
 protected void TextBox1_TextChanged(object sender, EventArgs e)
 {
     switch (DisplayType)
     {
     case "Student":
         //so new Adno
         int i = 0;
         try
         {
             i           = System.Convert.ToInt32(TextBox1.Text);
             StudentAdno = i.ToString();
             SimplePupil p  = new SimplePupil(); p.Load_Left(i);
             Encode      en = new Encode();
             SqlDataSource2.SelectCommand    = GetQueryString();
             SqlDataSource2.ConnectionString = en.GetDbConnection();
             SqlDataSource2.DataBind();
             string s = "SELECT COUNT (ExamEntryID)  FROM dbo.qry_Cerval_Exams_Entries " + GetWhereString();
             Label_Grid.Text = "Entries for " + p.m_GivenName + " " + p.m_Surname + " (" + p.m_adno.ToString() + ") ....  Total Entries =" + en.Execute_one_SQL(s);
         }
         catch { }
         break;
     }
 }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Utility u = new Utility();
                Display_List.Items.FindByValue("Medical").Enabled = u.CheckStaffInConfigGroup(Context, "Medical");
                Display_List.Items.FindByValue("StudentDevelopment Log").Enabled = u.CheckStaffInConfigGroup(Context, "StudentDevelopment");
                StudentDetail1.Visible    = false;
                TimetableControl1.Visible = false;
                e1.Finished        += new EventHandler(e1_Finished);
                e1.Submit          += new EventHandler(e1_Finished);
                ResultGrid1.Visible = false;
                Label_Year.Text     = "";

                if (Request.QueryString.Count >= 1)
                {
                    string type = Request.QueryString["Type"];
                    ViewState.Add("ListType", type);// type = left for past students...
                    if (type == "Student")
                    {
                        string id1  = Request.QueryString["Id"];
                        string name = Request.QueryString["Name"];
                        TextBox_mask.Visible = false;
                        NameList.Visible     = true;
                        Label_Year.Text      = "Single Student";
                        Display_List.Visible = true;
                        ListItem Item = new ListItem(name, id1);
                        NameList.Items.Add(Item); Item.Selected = true; Display(); return;
                    }
                    if (type == "StudentByAdno")
                    {
                        string adno = Request.QueryString["Adno"];
                        try {
                            int         Adno = Convert.ToInt32(adno);
                            SimplePupil p1   = new SimplePupil(); p1.Load_Left(Adno);
                            string      id1  = p1.m_StudentId.ToString();
                            string      name = p1.m_GivenName + " " + p1.m_Surname;
                            TextBox_mask.Visible = false;
                            NameList.Visible     = true;
                            Label_Year.Text      = "Single Student";
                            Display_List.Visible = true;
                            ListItem Item = new ListItem(name, id1);
                            NameList.Items.Add(Item); Item.Selected = true; Display(); return;
                        }
                        catch { }
                    }
                    if ((Request.QueryString["Year"] == "0") || (Request.QueryString["Year"] == ""))
                    {
                        //do mask...
                        TextBox_mask.Visible = true;
                        NameList.Visible     = false;
                        Label_Year.Text      = "Type mask and return";
                        Display_List.Visible = false;
                    }
                    else
                    {
                        Build_NameList(Request.QueryString["Year"]);
                        if (type == "Left")
                        {
                            TextBox_mask.Visible = true;
                        }
                        Label_Year.Text = "Type mask and return";
                        Display();
                    }
                }
                RadioButtonList rbl1 = Display_List;
                try
                {
                    //going to read display keys
                    //StaffIntranet_StudentDetail_Disable
                    Cerval_Configuration c1 = new Cerval_Configuration("StaffIntranet_StudentDetail_Disable");
                    string[]             v1 = c1.Value.Split(',');
                    for (int i = 0; i < 12; i++)
                    {
                        rbl1.Items[i].Enabled = (v1[i] == "1") ? true : false;
                    }
                }
                catch {}
            }
        }