Example #1
0
 protected void bAddStudentRegister_Click(object sender, EventArgs e)
 {
     try
     {
         CY.GFive.Core.Business.StudentStatus ss = new CY.GFive.Core.Business.StudentStatus();
         CY.GFive.Core.Business.Student s = CY.GFive.Core.Business.Student.GetStudentByCode(txtStdCode.Text);
         if (s.StdState != ddlStdStatus.SelectedValue)
             s.StdState = ddlStdStatus.SelectedValue;
         ss.StdCode = txtStdCode.Text;
         if (!string.IsNullOrEmpty(ddlStdStatus.SelectedValue))
             ss.StdStatus = ddlStdStatus.SelectedValue;
         if (!string.IsNullOrEmpty(ddlTerminal.SelectedValue))
             ss.Terminal =Convert.ToInt32(ddlTerminal.SelectedValue.ToString());
         if (!string.IsNullOrEmpty(ddlYearNum.SelectedValue))
             ss.YearNum = ddlYearNum.SelectedValue;
         ss.Save();
         s.Save();
         txtStdCode.Text  = "";
         ErrorMsg.Text = "注册成功";
     }
     catch (Exception ex)
     {
         ErrorMsg.Text = "错误:" + ex.Message;
     }
 }
Example #2
0
 protected void bRegister_Click(object sender, EventArgs e)
 {
     try
     {
         CheckBox cb;
         string stdcode;
         CY.GFive.Core.Business.StudentStatus ss;
         for (int i = 0; i < GridView1.Rows.Count; i++)
         {
             cb = (CheckBox)GridView1.Rows[i].FindControl("chk");
             if (cb.Checked)
             {
                 stdcode = GridView1.DataKeys[i].Value.ToString();
                 CY.GFive.Core.Business.Semester s=CY.GFive.Core.Business.Semester.GetCurrentSemester();
                 CY.GFive.Core.Business.StudentStatus ssnew = new CY.GFive.Core.Business.StudentStatus();
                 ssnew.StdCode = stdcode;
                 ssnew.StdStatus = "InRegister";
                 ssnew.YearNum = s.StartTime.Year.ToString();
                 ssnew.Terminal = s.Id;
                 ssnew.Save();
             }
         }
     }
     catch (Exception ex)
     {
         ErrorMsg.Text = "错误:" + ex.Message;
     }
     bindGridView(sql);
 }
Example #3
0
        protected void btnChangeState_Click(object sender, EventArgs e)
        {
            CheckBox cb;
            CY.GFive.Core.Business.AcademicYear ayear = CY.GFive.Core.Business.AcademicYear.GetCurrentAcademicYear();

            for (int i = 0; i < gvUnregister.Rows.Count; i++)
            {
                cb = (CheckBox)gvUnregister.Rows[i].FindControl("cbSelect");
                if (cb.Checked)
                {
                    try
                    {
                        CY.GFive.Core.Business.Student student = CY.GFive.Core.Business.Student.Load(int.Parse(gvUnregister.DataKeys[i].Value.ToString()));
                        CY.GFive.Core.Business.StudentStatus stdStatus = new CY.GFive.Core.Business.StudentStatus();

                        stdStatus.StdCode = student.Code;
                        stdStatus.StdStatus = "Unarrive";
                        stdStatus.Terminal = ayear.Semesters[0].Id;
                        stdStatus.YearNum = ayear.Name;

                        stdStatus.Save();
                    }
                    catch (Exception ex)
                    {
                        lbError.Text = ex.Message;
                        return;
                    }
                }
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('未注册处理成功!');window.location.href='HandlerNonarrivalStudent.aspx';</script>");
            }
        }
Example #4
0
        protected void bRegister_Click(object sender, EventArgs e)
        {
            string code = Request.QueryString["Code"];

            CY.GFive.Core.Business.Student std = CY.GFive.Core.Business.Student.GetStudentByCode(code);
            CY.GFive.Core.Business.Semester semester = CY.GFive.Core.Business.Semester.GetCurrentSemester();
            CY.GFive.Core.Business.StudentStatus stdstatus = new CY.GFive.Core.Business.StudentStatus();

            try
            {
                stdstatus.StdStatus = "InRegister";
                stdstatus.YearNum = semester.AcademicYear.Name;
                stdstatus.Terminal = semester.Id;
                stdstatus.StdCode = std.Code;
                stdstatus.Save();
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('注册成功!');window.location.href='StudentStatusModify.aspx?Code=" + code + "&&state=1';</script>");
            }
            catch (Exception ex)
            {
                lbError.Text = ex.Message;
                return;
            }
        }
Example #5
0
        protected void btnRegister_Click(object sender, EventArgs e)
        {
            tabid.Value = "1";
            CheckBox cb;
            try
            {
                int count = 0;
                CY.GFive.Core.Business.AcademicYear ayear = CY.GFive.Core.Business.AcademicYear.GetCurrentAcademicYear();
                for (int i = 0; i < gvUnregister.Rows.Count; i++)
                {
                    cb = (CheckBox)gvUnregister.Rows[i].FindControl("cbSelect");

                    if (cb.Checked)
                    {
                        count++;

                        CY.GFive.Core.Business.Student student = CY.GFive.Core.Business.Student.Load(int.Parse(gvUnregister.DataKeys[i].Value.ToString()));
                        CY.GFive.Core.Business.StudentStatus stdStatus = new CY.GFive.Core.Business.StudentStatus();

                        IList<CY.GFive.Core.Business.StudentStatus> stdStatusList = CY.GFive.Core.Business.StudentStatus.GetListByQuery(" [StdCode]='" + student.Code + "'");

                        if (stdStatusList.Count == 0)
                        {
                            student.StdState = "InRegister";
                            student.RegisteDate = System.DateTime.Now;
                            student.Save();

                            stdStatus.StdCode = student.Code;
                            stdStatus.StdStatus = "InRegister";
                            stdStatus.YearNum = ayear.Name;
                            stdStatus.Terminal = ayear.Semesters[0].Id;
                            stdStatus.Save();
                        }
                        else
                        {
                            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('"+ student.StdName +"已入籍!');</script>");
                            return;
                        }
                    }
                }

                if (count == 0)
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('请选择要入籍的学生!');</script>");
                    return;
                }

                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('入籍成功!');</script>");
                BindGvUnRegisterStdData("");
                BindGvRegisteredStdData("");
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('" + ex.Message + "');</script>");
            }
        }
Example #6
0
 protected void bRegister_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(ddlProfess.SelectedValue) || ddlProfess.SelectedValue == "0" || string.IsNullOrEmpty(ddlGrade.SelectedValue) || ddlGrade.SelectedValue == "0" || string.IsNullOrEmpty(ddlClass.SelectedValue) || ddlClass.SelectedValue == "0")
     {
         Page.ClientScript.RegisterClientScriptBlock(GetType(), "script", "<script type='text/javascript'>alert('没有供选择的数据!')</script>");
         return;
     }
     if (GridView1.Rows.Count < 0)
     {
         Page.ClientScript.RegisterClientScriptBlock(GetType(), "script", "<script type='text/javascript'>alert('没有供选择的数据!')</script>");
         return;
     }
     try
     {
         CheckBox cb;
         string stdcode;
         for (int i = 0; i < GridView1.Rows.Count; i++)
         {
             cb = (CheckBox)GridView1.Rows[i].FindControl("chk");
             if (cb.Checked)
             {
                 stdcode = GridView1.DataKeys[i].Value.ToString();
                 CY.GFive.Core.Business.Semester s = CY.GFive.Core.Business.Semester.GetCurrentSemester();
                 CY.GFive.Core.Business.StudentStatus ssnew = new CY.GFive.Core.Business.StudentStatus();
                 ssnew.StdCode = stdcode;
                 ssnew.StdStatus = "InRegister";
                 ssnew.YearNum = s.StartTime.Year.ToString();
                 ssnew.Terminal = s.Id;
                 ssnew.Save();
             }
         }
     }
     catch (Exception ex)
     {
         ErrorMsg.Text = "错误:" + ex.Message;
     }
     bindGridView(sql);
 }