Exemple #1
0
 /// <summary>
 /// 根据班级号查出班级名称
 /// </summary>
 /// <param name="ClassID"></param>
 /// <returns></returns>
 public string GetClassNameByClassID(int ClassID)
 {
     string str = "ID="+ClassID;
     LabMS.BLL.Class BClass=new LabMS.BLL.Class();
     string Class_Name = BClass.GetModelList(str)[0].Class_Name;
     return Class_Name;
 }
Exemple #2
0
 protected void Gv_DataBinds()
 {
     LabMS.BLL.Class Class = new LabMS.BLL.Class();
     List<LabMS.Model.Class> ls = new List<LabMS.Model.Class>();
     ls = Class.GetModelList(CombineStr());
     Gv_Class.DataSource = ls;
     Gv_Class.DataBind();
 }
Exemple #3
0
 protected void InitBindFromDB(int ID)
 {
     LabMS.BLL.Class BC = new LabMS.BLL.Class();
     LabMS.Model.Class MC = new LabMS.Model.Class();
     MC = BC.GetModel(ID);
     tbClassName.Text = MC.Class_Name;
     tbClassNumber.Text = MC.Class_Code;//班号
     ddlClass.SelectedValue = MC.Class_Year;
     tbNum.Text = MC.Class_StudentNum.Value.ToString();
     tb.Text = MC.Class_Professional.Value.ToString();//专业代号
     ExtendBLL.Class EC = new ExtendBLL.Class();
     tbClassMajor.Text=EC.ProessionalNameByID(int.Parse(tb.Text.Trim()));
 }
Exemple #4
0
 /// <summary>
 /// 班级编号是否存在
 /// </summary>
 /// <param name="Class"></param>
 /// <returns></returns>
 public int IsExistClass(string strClass)
 {
     string str = "Class_Code='"+strClass+"'";
     LabMS.BLL.Class BC = new LabMS.BLL.Class();
     if (BC.GetModelList(str).Count > 0)
     {
         //已经存在
         return 1;
     }
     else
     {
         //不存在,可以保存
         return 0;
     }
 }
        void bindClass(string Year, string Pro)
        {
            List<LabMS.Model.Class> listClass = new List<LabMS.Model.Class>();
            LabMS.BLL.Class bClass = new LabMS.BLL.Class();

            string strWhere = "1=1";
            if (Year != "0")
            {
                strWhere += " and  Class_Year ='" + Year + "'";
            }
            if (Pro!="0")
            {
                strWhere += " and  Class_Professional =" + Pro;
            }

            listClass = bClass.GetModelList(strWhere);
            ddlClass.DataSource = listClass;
            ddlClass.DataValueField = "ID";
            ddlClass.DataTextField = "Class_Name";
            ddlClass.DataBind();
            ddlClass.Items.Insert(0, new ListItem("", "0"));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            strPagePrivilege.Add("BJKB");
            strPageUserType.Add("student");

            if (!Page.IsPostBack)
            {
                if (!string.IsNullOrEmpty(UserID) && !string.IsNullOrEmpty(UserName))
                {
                    YearBind();

                    lb_Year.Text = ddl_Year.SelectedValue;
                    if (ddl_Term.SelectedValue == "1")
                    {
                        lb_Term.Text = "��ѧ��";

                    }
                    else
                    {
                        lb_Term.Text = "��ѧ��";
                    }

                    int TempID = 0;
                    if (int.TryParse(UserID,out TempID))
                    {
                        if (TempID > 0)
                        {
                            LabMS.BLL.Student Student = new LabMS.BLL.Student();
                            LabMS.Model.Student model = Student.GetModel(TempID);
                            if (model != null)
                            {
                                if (model.ClassID.HasValue)
                                {
                                    LabMS.BLL.Class Class = new LabMS.BLL.Class();
                                    LabMS.Model.Class classmodel = Class.GetModel(model.ClassID.Value);
                                    if (classmodel != null)
                                    {
                                        lb_ClassName.Text = classmodel.Class_Name;
                                    }
                                }
                            }
                        }
                    }

                    DataBinds();
                }
                else
                {
                    LabMS.Common.JShelper.JSAlert(this, "error", "ϵͳ��������ϵ����Ա");
                }
            }
        }
        protected void Save_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(tb_CourseCode.Text.Trim()))
            {
                LabMS.Common.JShelper.JSAlert(this, "error", "�γ̱�Ų���Ϊ��");
                return;
            }
            if (string.IsNullOrEmpty(tb_CourseName.Text.Trim()))
            {
                LabMS.Common.JShelper.JSAlert(this, "error", "���������");
                return;
            }
            if (ddl_Lab.SelectedValue == "0")
            {
                LabMS.Common.JShelper.JSAlert(this, "error", "��ѡ��е��γ̵�ʵ����");
                return;
            }
            if (string.IsNullOrEmpty(tb_ExpHouse.Text))
            {
                LabMS.Common.JShelper.JSAlert(this, "error", " ʵ��ѧʱ����Ϊ��");
                return;
            }
            if (string.IsNullOrEmpty(tb_StartWeek.Text))
            {
                LabMS.Common.JShelper.JSAlert(this, "error", "��ʼ�ܴβ���Ϊ����ӦΪ����");
                return;
            }
            if (!IsNumber(tb_StartWeek.Text.Trim()))
            {
                LabMS.Common.JShelper.JSAlert(this, "error", "��ʼ�ܴβ���Ϊ����ӦΪ����");
                return;
            }
            if (!IsNumber(tb_EndWeek.Text.Trim()))
            {
                LabMS.Common.JShelper.JSAlert(this, "error", "�����ܴβ���Ϊ����ӦΪ����");
                return;
            }
            int Num1 = 0;
            int Num2 = 0;
            if (int.TryParse(tb_StartWeek.Text, out Num1) && int.TryParse(tb_EndWeek.Text, out Num2))
            {
                if (Num2 < Num1)
                {
                    LabMS.Common.JShelper.JSAlert(this, "error", "��ʼ�ܴδ��ڽ����ܴ�");
                    return;
                }
            }
            else
            {
                LabMS.Common.JShelper.JSAlert(this, "error", "�ܴβ���Ϊ�գ���Ӧ��Ϊ����");
                return;
            }

            if (!IsNumber(tb_ComputerTime.Text.Trim()))
            {
                LabMS.Common.JShelper.JSAlert(this, "error", "�ϻ�����Ϊ����ӦΪ����");
                return;
            }
            if (string.IsNullOrEmpty(tb_Teacher.Text))
            {
                LabMS.Common.JShelper.JSAlert(this, "error", "��ʦ����Ϊ����ӦΪ����");
                return;
            }
            if (!(Gv_Class.Rows.Count > 0))
            {
                LabMS.Common.JShelper.JSAlert(this, "error", "��ѡ��γ̶�Ӧ�İ༶");
                return;
            }

            LabMS.BLL.TeachMission TeachMission = new LabMS.BLL.TeachMission();
            LabMS.Model.TeachMission model = new LabMS.Model.TeachMission();
            model.LabID = Convert.ToInt32(ddl_Lab.SelectedValue.Trim());

            model.Ms_CourseCode = (tb_CourseCode.Text);
            model.Ms_CourseName = tb_CourseName.Text;
            model.Ms_SubmitTime = DateTime.Now;
            model.Ms_Teacher = Convert.ToInt32(tb_TeacherID.Text);
            model.Ms_Conflict = rbl_Conflict.SelectedValue.Trim();
            model.Ms_StartWeek = Convert.ToInt32(tb_StartWeek.Text.Trim().ToString());
            model.Ms_EndWeek = Convert.ToInt32(tb_EndWeek.Text.Trim().ToString());
            model.Ms_CourseHourse = Convert.ToInt32(tb_ExpHouse.Text.Trim());
            model.Ms_ComputerHourse = Convert.ToInt32(tb_ComputerTime.Text.Trim());
            model.Ms_Year = ddl_Year.SelectedValue;
            model.Ms_Term = ddl_Season.SelectedValue;
            int ID = TeachMission.Add(model);
            string[] array = tb_ClassIDs.Text.Split(',');
            List<string> lsIDs = new List<string>();

            lsIDs.Add(array[0]);

            foreach (string item in array)
            {
                int Count = 0;
                foreach (string Pr in lsIDs)
                {
                    if (item != Pr)
                    {
                        Count++;
                    }
                }
                if (Count == lsIDs.Count)
                {
                    lsIDs.Add(item);
                }
            }

            ///�����༶��ѡ�ΰ༶ �Ϳγ̵�����
            ///\
            ///
            int CourseID = int.Parse(tb_CourseID.Text.Trim());
            LabMS.BLL.ClassItem ClassItem = new LabMS.BLL.ClassItem();
            LabMS.BLL.Class Class = new LabMS.BLL.Class();
            LabMS.Model.Class classModel;
            LabMS.Model.ClassItem classItemModel;
            for (int n = 0; n < lsIDs.Count; n++)
            {
                classModel = Class.GetModel(Convert.ToInt32(lsIDs[n]));
                classItemModel = new LabMS.Model.ClassItem();

                classItemModel.CourseID = CourseID;
                classItemModel.ClassItem_Code = classModel.Class_Code;
                classItemModel.ClassItem_Name = classModel.Class_Name;
                classItemModel.ClassItem_Num = classModel.Class_StudentNum;
                classItemModel.ClassItem_Degree = classModel.Class_Year;
                classItemModel.ClassID = Convert.ToInt32(lsIDs[n]);
                classItemModel.Time = DateTime.Now;
                classItemModel.TeachMissionID = ID;
                int classItemModelID = ClassItem.Add(classItemModel);
            }

            //������ʦ�Ϳγ�֮�����ϵ
            /// ��ʦ��ѡ��
            ///

            LabMS.BLL.TeacherCourse TC = new LabMS.BLL.TeacherCourse();
            LabMS.Model.TeacherCourse Model = new LabMS.Model.TeacherCourse();

            Model.CourseID = CourseID;
            Model.TeacherID = Convert.ToInt32(tb_TeacherID.Text.Trim());

            int temID = TC.Add(Model);

            Page.ClientScript.RegisterClientScriptBlock(GetType(), "script", "<script type='text/javascript'>alert('����ɹ���');if(window.confirm('�Ƿ񷵻��б�ҳ�棿')){window.location.href='TeachingMissionList.aspx'}else{window.location.href='TeachingMissionPreview.aspx?ID=" + temID + "'};</script>");
        }
 protected void Gv_DataBinds()
 {
     LabMS.BLL.Class Class = new LabMS.BLL.Class();
     List<LabMS.Model.Class> ls = new List<LabMS.Model.Class>();
     string strWhere = CombineStr();
     if (!string.IsNullOrEmpty(strWhere))
     {
         ls = Class.GetModelList(strWhere);
         Gv_Class.DataSource = ls;
         Gv_Class.DataBind();
     }
     else
     {
         Gv_Class.DataSource = ls;
         Gv_Class.DataBind();
     }
 }
Exemple #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            strPagePrivilege.Add("BJKB");
            strPageUserType.Add("mana");

            if (!Page.IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request.QueryString["ID"]) && !string.IsNullOrEmpty(Request.QueryString["Year"]) && !string.IsNullOrEmpty(Request.QueryString["Term"]))
                {
                    int ClassID = 0;
                    int Year = 0;
                    int Term = 0;
                    if (int.TryParse(Request.QueryString["ID"], out ClassID) && int.TryParse(Request.QueryString["Year"], out Year) && int.TryParse(Request.QueryString["Term"], out Term))
                    {
                        DataBinds();
                        if (ClassID != 0)
                        {
                            LabMS.BLL.Class Class = new LabMS.BLL.Class();
                            LabMS.Model.Class model = new LabMS.Model.Class();
                            model = Class.GetModel(ClassID);
                            if (model != null)
                            {
                                lb_Class.Text = model.Class_Name;

                            }
                            if (Year != 0)
                            {
                                lb_Year.Text = Year.ToString();
                            }
                            if (Term != 0)
                            {
                                if (Term == 1)
                                {
                                    lb_Term.Text = "��ѧ��";
                                }
                                else
                                {
                                    lb_Term.Text = "��ѧ��";
                                }
                            }
                        }
                    }
                }

            }
        }
        protected void Save_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(tb_CourseCode.Text.Trim()))
            {
                LabMS.Common.JShelper.JSAlert(this, "error", "�γ̱�Ų���Ϊ��");
                return;
            }
            if (string.IsNullOrEmpty(tb_CourseName.Text.Trim()))
            {
                LabMS.Common.JShelper.JSAlert(this, "error", "���������");
                return;
            }
            if (ddl_Lab.SelectedValue == "0")
            {
                LabMS.Common.JShelper.JSAlert(this, "error", "��ѡ��е��γ̵�ʵ����");
                return;
            }
            if (string.IsNullOrEmpty(tb_ExpHouse.Text))
            {
                LabMS.Common.JShelper.JSAlert(this, "error", " ʵ��ѧʱ����Ϊ��");
                return;
            }
            if (string.IsNullOrEmpty(tb_StartWeek.Text))
            {
                LabMS.Common.JShelper.JSAlert(this, "error", "��ʼ�ܴβ���Ϊ����ӦΪ����");
                return;
            }
            if (!IsNumber(tb_StartWeek.Text.Trim()))
            {
                LabMS.Common.JShelper.JSAlert(this, "error", "��ʼ�ܴβ���Ϊ����ӦΪ����");
                return;
            }
            if (!IsNumber(tb_EndWeek.Text.Trim()))
            {
                LabMS.Common.JShelper.JSAlert(this, "error", "�����ܴβ���Ϊ����ӦΪ����");
                return;
            }
            int Num1 = 0;
            int Num2 = 0;
            if (int.TryParse(tb_StartWeek.Text, out Num1) && int.TryParse(tb_EndWeek.Text, out Num2))
            {
                if (Num2 < Num1)
                {
                    LabMS.Common.JShelper.JSAlert(this, "error", "��ʼ�ܴδ��ڽ����ܴ�");
                }
            }
            else
            {
                LabMS.Common.JShelper.JSAlert(this, "error", "�ܴβ���Ϊ�գ���Ӧ��Ϊ����");
                return;
            }

            if (!IsNumber(tb_ComputerTime.Text.Trim()))
            {
                LabMS.Common.JShelper.JSAlert(this, "error", "�ϻ�����Ϊ����ӦΪ����");
                return;
            }
            if (string.IsNullOrEmpty(tb_Teacher.Text))
            {
                LabMS.Common.JShelper.JSAlert(this, "error", "��ʦ����Ϊ����ӦΪ����");
                return;
            }
            if (!(Gv_Class.Rows.Count > 0))
            {
                LabMS.Common.JShelper.JSAlert(this, "error", "��ѡ��γ̶�Ӧ�İ༶");
                return;
            }

            try
            {
                LabMS.BLL.TeachMission TeachMission = new LabMS.BLL.TeachMission();
                LabMS.Model.TeachMission model = new LabMS.Model.TeachMission();

                model = TeachMission.GetModel(QueryString);
                if (model != null)
                {
                    model.LabID = Convert.ToInt32(ddl_Lab.SelectedValue.Trim());
                    model.Ms_CourseCode = (tb_CourseCode.Text);
                    model.Ms_CourseName = tb_CourseName.Text;
                    model.Ms_SubmitTime = DateTime.Now;
                    model.Ms_Teacher = Convert.ToInt32(tb_TeacherID.Text);
                    model.Ms_Conflict = rbl_Conflict.SelectedValue.Trim();
                    model.Ms_StartWeek = Convert.ToInt32(tb_StartWeek.Text.Trim().ToString());
                    model.Ms_EndWeek = Convert.ToInt32(tb_EndWeek.Text.Trim().ToString());
                    model.Ms_CourseHourse = Convert.ToInt32(tb_ExpHouse.Text.Trim());
                    model.Ms_ComputerHourse = Convert.ToInt32(tb_ComputerTime.Text.Trim());
                    model.Ms_Term = ddl_Season.SelectedValue;
                    model.Ms_Year = ddl_Year.SelectedValue;
                    TeachMission.Update(model);
                }
            }
            catch (Exception ex)
            {
                lb_Error.Text = ex.Message;
            }

            string[] array = tb_ClassIDs.Text.Split(',');
            if (array.Length == 1 && array[0] == "")
            {
                return;
            }
            List<string> lsIDs = new List<string>();

            lsIDs.Add(array[0]);

            foreach (string item in array)
            {
                int Count = 0;
                foreach (string Pr in lsIDs)
                {
                    if (item != Pr)
                    {
                        Count++;
                    }
                }
                if (Count == lsIDs.Count)
                {
                    lsIDs.Add(item);
                }
            }

            //��ȡ�б�
            try
            {
                ExtendBLL.ClassItemDelete ClassItemDelete = new ExtendBLL.ClassItemDelete();
                int result = ClassItemDelete.Delete(QueryString.ToString());
                if (result == 0)
                {
                    //LabMS.Common.JShelper.JSAlert(this, "error", "��ѯ�ַ�������");
                    Page.ClientScript.RegisterClientScriptBlock(GetType(), "script", "<script type='text/javascript'>window.location.href='~/err.aspx?Message=��ѯ�ַ�������';<script>");
                    return;
                }
                if (result == 2)
                {
                    LabMS.Common.JShelper.JSAlert(this, "error", "���´���");
                }
            }
            catch (Exception ex)
            {
                lb_Error.Text = ex.Message;
            }

            int CourseID = int.Parse(tb_CourseID.Text.Trim());
            LabMS.BLL.ClassItem ClassItem = new LabMS.BLL.ClassItem();
            LabMS.BLL.Class Class = new LabMS.BLL.Class();
            LabMS.Model.Class classModel;
            LabMS.Model.ClassItem classItemModel;
            for (int n = 0; n < lsIDs.Count; n++)
            {
                classModel = Class.GetModel(Convert.ToInt32(lsIDs[n]));
                classItemModel = new LabMS.Model.ClassItem();
                classItemModel.CourseID = CourseID;
                classItemModel.ClassItem_Code = classModel.Class_Code;
                classItemModel.ClassItem_Name = classModel.Class_Name;
                classItemModel.ClassItem_Num = classModel.Class_StudentNum;
                classItemModel.ClassItem_Degree = classModel.Class_Year;
                classItemModel.ClassID = Convert.ToInt32(lsIDs[n]);
                classItemModel.Time = DateTime.Now;
                classItemModel.TeachMissionID = QueryString;
                int classItemModelID = ClassItem.Add(classItemModel);
            }

            LabMS.BLL.TeacherCourse TC = new LabMS.BLL.TeacherCourse();
            LabMS.Model.TeacherCourse Model = new LabMS.Model.TeacherCourse();

            Model.CourseID = CourseID;
            Model.TeacherID = Convert.ToInt32(tb_TeacherID.Text.Trim());

            TC.Add(Model);

            Page.ClientScript.RegisterClientScriptBlock(GetType(), "script", "<script type='text/javascript'>alert('�޸ijɹ�');window.location.href='TeachingMissionList.aspx';</script>");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            strPagePrivilege.Add("JXRWS");
            strPageUserType.Add("mana");

            if (!Page.IsPostBack)
            {
                bool right = false;
                if (!string.IsNullOrEmpty(Request.QueryString["ID"]))
                {
                    int TempID = 0;
                    if (int.TryParse(Request.QueryString["ID"], out TempID))
                    {
                        if (TempID > 0)
                        {
                            DataBinds();
                            LabMS.BLL.Class Class = new LabMS.BLL.Class();
                            LabMS.BLL.ClassItem ClassItem = new LabMS.BLL.ClassItem();
                            List<LabMS.Model.ClassItem> ls = new List<LabMS.Model.ClassItem>();
                            ls = ClassItem.GetModelList("TeachMissionID=" + Request.QueryString["ID"].Trim());
                            if (ls.Count != 0)
                            {
                                tb_ClassIDs.Text = "";
                                for (int n = 0; n < ls.Count; n++)
                                {
                                    if (tb_ClassIDs.Text == "")
                                    {
                                        tb_ClassIDs.Text += ls[n].ClassID;
                                    }
                                    else
                                    {
                                        tb_ClassIDs.Text += ",";
                                        tb_ClassIDs.Text += ls[n].ClassID;
                                    }
                                }
                            }
                            tb_CourseID.Text = ls[0].CourseID.ToString();

                            Gv_DataBinds();

                            right = true;
                        }
                    }
                }

                if (!right)
                {
                    Page.ClientScript.RegisterClientScriptBlock(GetType(), "script", "<script type='text/javascript'>window.location.href='~/err.aspx?Message=��ѯ�ַ�������';<script>");
                    return;
                }
            }
            if (tb_Tag.Text == "0")
            {
                Gv_DataBinds();
            }
        }
Exemple #12
0
        void searchbind()
        {
            string strwhere = " 1=1 ";
            string strclass = ddlClass.SelectedValue;

            string strYear = ddlYear.SelectedValue;
            string strPro = ddlPro.SelectedValue;
            string strSName = tbSName.Text.Trim();
            string strSCode = tbSNub.Text.Trim();
            if (strclass != "0")
            {
                strwhere += " and ClassID = " + strclass;
            }
            if (strYear != "0")
            {
                List<LabMS.Model.Class> listClass = new List<LabMS.Model.Class>();
                LabMS.BLL.Class bclass = new LabMS.BLL.Class();
                bclass.GetModelList("Class_Year = '"+ strYear +"'");

                strwhere += " and ( 1<>1  ";

                foreach (LabMS.Model.Class c in listClass)
                {
                    strwhere += " and ( or ClassID = " + c.ID.ToString();
                }
                strwhere += ")";
            }
            if (strPro != "0")
            {
                strwhere += " and Student_Pro = " + strPro;
            }
            if (strSCode != "")
            {
                strwhere += " and Student_Code like '%" + strSCode + "%'";
            }
            if (strSName != "")
            {
                strwhere += " and Student_Name like '%" + strSName + "%'";
            }
            bind(strwhere);
        }