Ejemplo n.º 1
0
    protected void ddlGradeClass_SelectedIndexChanged(object sender, EventArgs e)
    {
        string[] asYearsClassID = ddlGradeClass.SelectedValue.Split(',');
        short    iYears         = short.Parse(asYearsClassID[0]);
        int      iClassID       = int.Parse(asYearsClassID[1]);

        if (iYears == 999)
        { //是否為歷屆班級
            Se.siYearsSel                   = 0;
            Se.siGradeIDSel                 = HealthShareUtil.YearsToGradeID(0);
            Se.siClassIDSel                 = 0;
            ddlGradeClassGrad.Visible       = true;
            ddlGradeClassGrad.SelectedIndex = 0;
        }
        else
        {
            Se.siYearsSel             = iYears;                                 //學年
            Se.siGradeIDSel           = HealthShareUtil.YearsToGradeID(iYears); //不知道幹嘛的
            Se.siClassIDSel           = (short)iClassID;                        //班級
            ddlGradeClassGrad.Visible = false;
        }

        sYearsGradeClass = ddlGradeClass.SelectedItem.ToString();
        sGradeClassSel   = DMHealth.GradeClass(Se.siYearsSel, Se.siClassIDSel);

        if (AfterClassChange != null)//AfterClassChange 事件
        {
            AfterClassChange(this, e);
        }
    }
Ejemplo n.º 2
0
    protected void ddlGradeGrad_SelectedIndexChanged(object sender, EventArgs e)
    {
        short iYears = short.Parse(ddlGradeGrad.SelectedValue);

        Se.siYearsSel   = iYears;
        Se.siGradeIDSel = HealthShareUtil.YearsToGradeID(iYears);
        if (AfterGradeChange != null)
        {
            AfterGradeChange(this, e);
        }
    }
Ejemplo n.º 3
0
 void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ddlGrade.DataBind();
         //歷屆年級資料繫結
         ddlGradeGrad.DataSource = GradSqlDataAdapter();
         ddlGradeGrad.DataBind();
         if (Se.siYearsSel == 0)
         {
             ddlGrade.SelectedIndex     = 0;
             ddlGradeGrad.SelectedIndex = 0;
             ddlGradeGrad.Visible       = false;
         }
         else
         {
             string   sSel       = Se.siYearsSel.ToString();
             ListItem crItemGrad = ddlGradeGrad.Items.FindByValue(sSel);
             ListItem crItem     = ddlGrade.Items.FindByValue(sSel);
             try
             {
                 if (crItem != null)
                 {
                     crItem.Selected      = true;
                     ddlGradeGrad.Visible = false;
                 }
                 else
                 {
                     ddlGrade.SelectedIndex = ddlGrade.Items.Count - 1;
                     crItemGrad.Selected    = true;
                     ddlGradeGrad.Visible   = true;
                 }
             }
             catch
             {
                 ddlGrade.SelectedIndex     = 0;
                 ddlGradeGrad.SelectedIndex = 0;
                 Se.siYearsSel   = 0;
                 Se.siGradeIDSel = HealthShareUtil.YearsToGradeID(0);
             }
         }
     }
     //歷屆年級字顏色
     if (isShowGrad)
     {
         ddlGrade.Items[ddlGrade.Items.Count - 1].Attributes.Add("style", "color:Blue");
     }
 }
Ejemplo n.º 4
0
    protected void ddlGradeClassGrad_SelectedIndexChanged(object sender, EventArgs e)
    {
        string[] asYearsClassID = ddlGradeClassGrad.SelectedValue.Split(',');
        short    iYears         = short.Parse(asYearsClassID[0]);
        int      iClassID       = int.Parse(asYearsClassID[1]);

        Se.siYearsSel   = iYears;
        Se.siGradeIDSel = HealthShareUtil.YearsToGradeID(iYears);
        Se.siClassIDSel = (short)iClassID;

        sYearsGradeClass = ddlGradeClassGrad.SelectedItem.ToString();           //年級班級
        sGradeClassSel   = DMHealth.GradeClass(Se.siYearsSel, Se.siClassIDSel); //年級(小一入學學年度)班級

        //AfterClassChange 事件
        if (AfterClassChange != null)
        {
            AfterClassChange(this, e);
        }
    }
Ejemplo n.º 5
0
    protected void ddlGradeClass_SelectedIndexChanged(object sender, EventArgs e)
    {
        //lbGradeGrade_AfterClick();//HideDetail
        short iYears = short.Parse(ddlGrade.SelectedValue);

        if (iYears == 999) //選擇歷屆年級
        {
            Se.siYearsSel              = 0;
            Se.siGradeIDSel            = HealthShareUtil.YearsToGradeID(0);
            ddlGradeGrad.Visible       = true;
            ddlGradeGrad.SelectedIndex = 0;
        }
        else
        {
            Se.siYearsSel        = iYears;
            Se.siGradeIDSel      = HealthShareUtil.YearsToGradeID(iYears);
            ddlGradeGrad.Visible = false;
        }
        if (AfterGradeChange != null)
        {
            AfterGradeChange(this, e);
        }
    }
Ejemplo n.º 6
0
 public void updateStatus()
 {
     if (Se.siYearsSel == 0)
     {
         ddlGradeClass.SelectedIndex     = 0;
         ddlGradeClassGrad.SelectedIndex = 0;
         ddlGradeClassGrad.Visible       = false;
     }
     else
     {
         string   sSel       = Se.siYearsSel.ToString();
         ListItem crItemGrad = ddlGradeClassGrad.Items.FindByValue(sSel);
         ListItem crItem     = ddlGradeClass.Items.FindByValue(sSel);
         try
         {
             if (crItem != null)
             {
                 crItem.Selected           = true;
                 ddlGradeClassGrad.Visible = false;
             }
             else
             {
                 ddlGradeClass.SelectedIndex = ddlGradeClass.Items.Count - 1;
                 crItemGrad.Selected         = true;
                 ddlGradeClassGrad.Visible   = true;
             }
         }
         catch
         {
             ddlGradeClass.SelectedIndex     = 0;
             ddlGradeClassGrad.SelectedIndex = 0;
             Se.siYearsSel   = 0;
             Se.siGradeIDSel = HealthShareUtil.YearsToGradeID(0);
         }
     }
 }