Ejemplo n.º 1
0
    private void InitData()
    {
        leftTree.Nodes.Clear();
        Hashtable htYx = new Hashtable();

        htYx.Add("yxbz", 1);
        DataTable dtYx = YX.QueryYX(htYx);

        foreach (DataRow drYx in dtYx.Rows)
        {
            TreeNode RootNode = new TreeNode();
            RootNode.Text  = drYx["Yxmc"].ToString();
            RootNode.Value = drYx["Yxbh"].ToString();
            leftTree.Nodes.Add(RootNode);
            Hashtable ht = new Hashtable();
            ht.Add("Zybh", drYx["Yxbh"].ToString());
            ht.Add("yxbz", 1);
            DataTable dtZy = ZY.QueryZY(ht);
            foreach (DataRow drZy in dtZy.Rows)
            {
                TreeNode ParentNode = new TreeNode();
                AddNodes(RootNode, ParentNode, drZy["Zymc"].ToString(), drZy["Zybh"].ToString());
                Hashtable ht1 = new Hashtable();
                ht1.Add("bjbh", drZy["Zybh"].ToString());
                ht1.Add("yxbz", 1);
                DataTable dtBj = BJ.QueryBJ(ht1);
                foreach (DataRow drBj in dtBj.Rows)
                {
                    TreeNode LeafNode = new TreeNode();
                    AddNodes(ParentNode, LeafNode, drBj["Bjmc"].ToString(), drBj["Bjbh"].ToString());
                    LeafNode.ShowCheckBox = true;
                }
            }
        }
    }
    /// <summary>
    /// “修改”按钮单击事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnChag_ServerClick(object sender, EventArgs e)
    {
        ArrayList selectedZY = GetSelected();
        ZY        zy         = new ZY();

        if (selectedZY.Count != 1)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('请选择一个专业!');</script>");
            return;
        }
        string zybh = selectedZY[0].ToString();

        zy.LoadData(zybh);
        txtZymc.Value = zy.Zymc;
        foreach (ListItem item in selZylx.Items)
        {
            if (item.Selected == true)
            {
                item.Selected = false;
            }
            if (item.Text == zy.Zylx)
            {
                item.Selected = true;
            }
        }
        foreach (ListItem item in selYxbz.Items)
        {
            if (item.Selected == true)
            {
                item.Selected = false;
            }

            if (item.Value == Convert.ToString(Convert.ToInt32(zy.Yxbz)))
            {
                item.Selected = true;
            }
        }
        foreach (ListItem item in selSsyx.Items)
        {
            if (item.Selected == true)
            {
                item.Selected = false;
            }

            if (item.Value == zy.Zybh.Substring(0, 2))
            {
                item.Selected = true;
            }
        }
        txtZymc.Disabled   = false;
        selYxbz.Disabled   = false;
        btnChag.Disabled   = true;
        btnSave.Disabled   = false;
        btnCancel.Disabled = false;
        btnAdd.Disabled    = false;
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 初始化页面数据
    /// </summary>
    private void InitData()
    {
        string loginName = Session["login_name"].ToString();         //读取Session中的登录名

        userMessage01.InnerText = "你好!" + loginName;                 //欢迎信息
        labelXnd.Text           = Session["xnd"].ToString() + "学年度"; //读取Session中的学年度
        //根据当前学年,设置年级下拉框数据
        int i = Convert.ToInt32(labelXnd.Text.Substring(5, 4));
        int n = i - 5;

        for (; n < i;)
        {
            selNj.Items.Add(Convert.ToString(i));
            i--;
        }
        TreeView1.Nodes.Clear();            //清空所有树节点
        TreeNode RootNode = new TreeNode(); //根节点实例化

        RootNode.Text  = "全部";
        RootNode.Value = "__";          //设置根节点数据
        TreeView1.Nodes.Add(RootNode);  //把根节点插入到树中
        Hashtable htYx = new Hashtable();

        htYx.Add("yxbz", 1);
        DataTable dtYx = YX.QueryYX(htYx);   //查找所有有效标志为True的院系

        foreach (DataRow drYx in dtYx.Rows)
        {
            TreeNode ParentNode = new TreeNode();                                             //父节点实例化
            AddNodes(RootNode, ParentNode, drYx["Yxmc"].ToString(), drYx["Yxbh"].ToString()); //以RootNode为父节点把ParentNode插入到树中
            ListItem listYx = new ListItem();                                                 //建立下拉框列表数据项对象
            listYx.Text  = drYx["Yxmc"].ToString();                                           //数据项文本为院系名称域中的值
            listYx.Value = drYx["Yxbh"].ToString();                                           //数据项值为院系编号域中的值
            selSsyx.Items.Add(listYx);                                                        //把数据项添加到院系下拉框
            Hashtable ht = new Hashtable();
            ht.Add("Zybh", drYx["Yxbh"].ToString());
            ht.Add("yxbz", 1);
            DataTable dtZy = ZY.QueryZY(ht);       //查找所有有效标志为True的专业
            foreach (DataRow drZy in dtZy.Rows)
            {
                TreeNode LeafNode = new TreeNode();
                AddNodes(ParentNode, LeafNode, drZy["Zymc"].ToString(), drZy["Zybh"].ToString());//以ParentNode为父节点把LeafNode插入到树中
            }
        }

        Hashtable htZy = new Hashtable();

        htZy.Add("Zybh", selSsyx.Items[0].Value);
        htZy.Add("yxbz", 1);
        DataTable dtZy1 = ZY.QueryZY(htZy);        //查找所有有效标志为True的专业

        foreach (DataRow drZy in dtZy1.Rows)
        {
            selSszy.Items.Add(new ListItem(drZy["zymc"].ToString(), drZy["zybh"].ToString()));           //把数据项添加到院系下拉框
        }
    }
Ejemplo n.º 4
0
    protected void selSsyx_SelectedIndexChanged(object sender, EventArgs e)
    {
        Hashtable ht = new Hashtable();

        ht.Add("zybh", selSsyx.SelectedValue);
        DataTable dt = ZY.QueryZY(ht);

        selSszy.Items.Clear();
        foreach (DataRow dr in dt.Rows)
        {
            selSszy.Items.Add(new ListItem(dr["zymc"].ToString(), dr["zybh"].ToString()));
        }
    }
    protected void selSsyx_SelectedIndexChanged(object sender, EventArgs e)
    {
        selSszy.Items.Clear();
        selSszy.Items.Add(new ListItem("全部", selSsyx.SelectedValue));
        Hashtable hash = new Hashtable();

        hash.Add("yxbz", 1);
        hash.Add("zybh", selSsyx.SelectedValue);
        DataTable dtZy = ZY.QueryZY(hash);

        foreach (DataRow drZy in dtZy.Rows)
        {
            selSszy.Items.Add(new ListItem(drZy["Zymc"].ToString(), drZy["Zybh"].ToString()));
        }
        QueryBJ();
    }
Ejemplo n.º 6
0
        public override int GetHashCode()
        {
            int result = 17;

            result = 31 * result + XX.GetHashCode();
            result = 31 * result + XY.GetHashCode();
            result = 31 * result + XZ.GetHashCode();

            result = 31 * result + YX.GetHashCode();
            result = 31 * result + YY.GetHashCode();
            result = 31 * result + YZ.GetHashCode();

            result = 31 * result + ZX.GetHashCode();
            result = 31 * result + ZY.GetHashCode();
            result = 31 * result + ZZ.GetHashCode();
            return(result);
        }
Ejemplo n.º 7
0
        public override int GetHashCode()
        {
            int h = 17;

            unchecked
            {
                h = h * 23 + XX.GetHashCode();
                h = h * 23 + XY.GetHashCode();
                h = h * 23 + XZ.GetHashCode();
                h = h * 23 + YX.GetHashCode();
                h = h * 23 + YY.GetHashCode();
                h = h * 23 + YZ.GetHashCode();
                h = h * 23 + ZX.GetHashCode();
                h = h * 23 + ZY.GetHashCode();
                h = h * 23 + ZZ.GetHashCode();
            }
            return(h);
        }
Ejemplo n.º 8
0
    /// <summary>
    /// 初始化页面数据
    /// </summary>
    private void InitData()
    {
        string loginName = Session["login_name"].ToString();
        userMessage01.InnerText = "你好!" + loginName;
        labelXnd.Text = Session["xnd"].ToString() + "学年度";

        leftTree.Nodes.Clear();
        Hashtable htYx = new Hashtable();
        htYx.Add("yxbz", 1);
        DataTable dtYx = YX.QueryYX(htYx);
        foreach (DataRow drYx in dtYx.Rows)
        {
            TreeNode RootNode = new TreeNode();
            RootNode.Text = drYx["Yxmc"].ToString();
            RootNode.Value = drYx["Yxbh"].ToString();
            leftTree.Nodes.Add(RootNode);
            Hashtable ht = new Hashtable();
            ht.Add("Zybh", drYx["Yxbh"].ToString());
            ht.Add("yxbz", 1);
            DataTable dtZy = ZY.QueryZY(ht);
            foreach (DataRow drZy in dtZy.Rows)
            {
                TreeNode ParentNode = new TreeNode();
                AddNodes(RootNode, ParentNode, drZy["Zymc"].ToString(), drZy["Zybh"].ToString());
                Hashtable ht1 = new Hashtable();
                ht1.Add("bjbh", drZy["Zybh"].ToString());
                ht1.Add("yxbz", 1);
                DataTable dtBj = BJ.QueryBJ(ht1);
                foreach (DataRow drBj in dtBj.Rows)
                {
                    TreeNode LeafNode = new TreeNode();
                    AddNodes(ParentNode,LeafNode,drBj["Bjmc"].ToString(),drBj["Bjbh"].ToString());
                    LeafNode.ShowCheckBox = true;
                }
            }
        }
    }
    private void InitData()
    {
        Hashtable ht = new Hashtable();

        ht.Add("yxbz", 1);
        DataTable dt = YX.QueryYX(ht);

        foreach (DataRow dr in dt.Rows)
        {
            selSsyx.Items.Add(new ListItem(dr["Yxmc"].ToString(), dr["Yxbh"].ToString()));
        }

        selSszy.Items.Add(new ListItem("全部", selSsyx.Items[0].Value));
        Hashtable hash = new Hashtable();

        hash.Add("yxbz", 1);
        hash.Add("zybh", selSsyx.Items[0].Value);
        DataTable dtZy = ZY.QueryZY(hash);

        foreach (DataRow drZy in dtZy.Rows)
        {
            selSszy.Items.Add(new ListItem(drZy["Zymc"].ToString(), drZy["Zybh"].ToString()));
        }
    }
Ejemplo n.º 10
0
 public int Delete(ZY zy)
 {
     return(Dao.Delete(zy));
 }
Ejemplo n.º 11
0
 public int Update(ZY zy)
 {
     return(Dao.Update(zy));
 }
Ejemplo n.º 12
0
 public int Insert(ZY zy)
 {
     return((int)Dao.Insert(zy));
 }
Ejemplo n.º 13
0
        public static string getSelectInfo(string id)
        {
            int    code    = 1;
            string message = "返回数据成功";
            string str3    = string.Empty;

            if (HttpContext.Current.Session["user_"] == null)
            {
                code    = 0;
                message = "您还没有登录,请您登录!";
                str3    = JsonConvert.SerializeObject(new
                {
                    code    = code,
                    message = message
                });
            }
            else
            {
                StudentsUser user = new StudentsUser();
                if (HttpContext.Current.Session["user_"] == null && id != "0")
                {
                    using (StudentsUserBLL bll = new StudentsUserBLL())
                    {
                        user = bll.GetEntity(int.Parse(id));
                    }
                }
                else if (HttpContext.Current.Session["user_"] != null)
                {
                    user = HttpContext.Current.Session["user_"] as StudentsUser;
                }
                List <Nation>    listNation      = new List <Nation>();    //民族列表
                List <ZZMM>      listZZMM        = new List <ZZMM>();      //政治面貌
                List <AreaCode_> listShiAreaCode = new List <AreaCode_>(); //城市列表
                List <KSLB>      listKslb        = new List <KSLB>();      //考生类别
                List <BYLB>      listBylb        = new List <BYLB>();      //毕业类别
                List <ZY>        listZy          = new List <ZY>();        //专业名称
                StudentInfo      stuInfo         = new StudentInfo();
                Wish             wish            = new Wish();             //考生志愿信息
                ZY Zy_ = new ZY();
                if (user != null)
                {
                    using (NationBLL bll = new NationBLL())
                    {
                        listNation = bll.getListNation();
                    }
                    using (ZZMMBLL bll = new ZZMMBLL())
                    {
                        listZZMM = bll.getZZMMList();
                    }
                    using (AreaCodeBLL bll = new AreaCodeBLL())
                    {
                        listShiAreaCode = bll.getShiAreaCode();
                    }
                    using (KSLBBLL bll = new KSLBBLL())
                    {
                        listKslb = bll.getListKslb();
                    }
                    using (BYLBBLL bll = new BYLBBLL())
                    {
                        listBylb = bll.getListBylb();
                    }
                    using (ZYBLL bll = new ZYBLL())
                    {
                        listZy = bll.getListZy();
                    }
                    using (StudentInfoBLL bll = new StudentInfoBLL())
                    {
                        stuInfo = bll.getEntity(user.Sfzh);
                        if (stuInfo != null)
                        {
                            HttpContext.Current.Session["PicPath_"] = stuInfo.PicPath;
                        }
                    }
                    using (WishBLL bll = new WishBLL())
                    {
                        wish = bll.getEntity(user.Sfzh);
                    }
                }
                else
                {
                    code    = 0;
                    message = "请您登陆后再填写详细信息!";
                }

                str3 = JsonConvert.SerializeObject(new
                {
                    code            = code,
                    message         = message,
                    listNation      = listNation,
                    ListZZMM        = listZZMM,
                    listShiAreaCode = listShiAreaCode,
                    listKslb        = listKslb,
                    listBylb        = listBylb,
                    listZy          = listZy,
                    user            = user,
                    stuInfo         = stuInfo,
                    wish            = wish,
                }
                                                   );
            }
            return(str3);
        }
    /// <summary>
    /// “保存”按钮单击事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_ServerClick(object sender, EventArgs e)
    {
        if (btnAdd.Disabled == true)
        {
            if (ZY.HasZY(txtZymc.Value))
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('已存在相同专业名称');</script>");
                txtZymc.Value = "";
            }
            else
            {
                string    zybh       = selSsyx.Value;
                Hashtable queryItems = new Hashtable();
                queryItems.Add("zybh", zybh);
                DataTable table = Gzl.BusinessLogicLayer.ZY.QueryZY(queryItems);
                string    max;
                int       count = table.Rows.Count;
                if (count < 9)
                {
                    count += 1;
                    max    = "0" + Convert.ToString(count);
                }
                else
                {
                    count += 1;
                    max    = Convert.ToString(count);
                }
                zybh = zybh + selZylx.Value + max;
                string zylx = "";
                foreach (ListItem item in selZylx.Items)
                {
                    if (item.Selected == true)
                    {
                        zylx = item.Text;
                    }
                }
                //构造user信息哈希表
                Hashtable hash = new Hashtable();
                hash.Add("zybh", SqlStringConstructor.GetQuotedString(zybh));
                hash.Add("zymc", SqlStringConstructor.GetQuotedString(txtZymc.Value.Trim()));
                hash.Add("zylx", SqlStringConstructor.GetQuotedString(zylx));
                string zymc = txtZymc.Value;
                hash.Add("yxbz", Convert.ToInt32(selYxbz.Value));

                Gzl.BusinessLogicLayer.ZY.Add(hash);

                txtZymc.Value      = "";
                txtZymc.Disabled   = true;
                selSsyx.Disabled   = true;
                selYxbz.Disabled   = true;
                selZylx.Disabled   = true;
                btnAdd.Disabled    = false;
                btnSave.Disabled   = true;
                btnCancel.Disabled = true;
                ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + zybh + zymc + "添加成功');</script>");
                Query();
            }
        }

        if (btnChag.Disabled == true)
        {
            string zylx = "";
            foreach (ListItem item in selZylx.Items)
            {
                if (item.Selected == true)
                {
                    zylx = item.Text;
                }
            }
            Hashtable ht         = new Hashtable();
            ArrayList selectedZY = GetSelected();
            string    zybh       = selectedZY[0].ToString();
            ht.Add("zymc", SqlStringConstructor.GetQuotedString(txtZymc.Value.Trim()));
            ht.Add("zylx", SqlStringConstructor.GetQuotedString(zylx));
            ht.Add("yxbz", Convert.ToInt32(selYxbz.Value));

            string where = "Where zybh = " + SqlStringConstructor.GetQuotedString(zybh);
            Gzl.BusinessLogicLayer.ZY.Update(ht, where);


            txtZymc.Value      = "";
            txtZymc.Disabled   = true;
            selSsyx.Disabled   = true;
            selYxbz.Disabled   = true;
            selZylx.Disabled   = true;
            btnChag.Disabled   = false;
            btnSave.Disabled   = true;
            btnCancel.Disabled = true;
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('修改成功');</script>");
            Query();
        }
    }
Ejemplo n.º 15
0
    protected void btnChag_ServerClick(object sender, EventArgs e)
    {
        ArrayList selectedBJ = GetSelected();
        BJ        bj         = new BJ();

        if (selectedBJ.Count != 1)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('请选择一个班级!');</script>");
            return;
        }
        string bjbh = selectedBJ[0].ToString();

        bj.LoadData(bjbh);
        txtBjbh.Text  = bj.Bjbh;
        txtBjmc.Value = bj.Bjmc;
        txtBjrs.Value = bj.Bjrs.ToString();
        foreach (ListItem item in selSsyx.Items)
        {
            if (item.Selected == true)
            {
                item.Selected = false;
            }
            if (item.Value == bj.Bjbh.Substring(4, 2))
            {
                item.Selected = true;
            }
        }

        Hashtable ht = new Hashtable();

        ht.Add("zybh", selSsyx.SelectedValue);
        DataTable dt = ZY.QueryZY(ht);

        selSszy.Items.Clear();
        foreach (DataRow dr in dt.Rows)
        {
            selSszy.Items.Add(new ListItem(dr["zymc"].ToString(), dr["zybh"].ToString()));
        }
        foreach (ListItem item in selSszy.Items)
        {
            if (item.Selected == true)
            {
                item.Selected = false;
            }
            if (item.Value == bj.Bjbh.Substring(4, 6))
            {
                item.Selected = true;
            }
        }
        foreach (ListItem item in selNj.Items)
        {
            if (item.Selected == true)
            {
                item.Selected = false;
            }
            if (item.Value == bj.Bjbh.Substring(0, 4))
            {
                item.Selected = true;
            }
        }
        foreach (ListItem item in selBh.Items)
        {
            if (item.Selected == true)
            {
                item.Selected = false;
            }
            if (item.Value == bj.Bjbh.Substring(11, 1))
            {
                item.Selected = true;
            }
        }
        foreach (ListItem item in selYxbz.Items)
        {
            if (item.Selected == true)
            {
                item.Selected = false;
            }
            Boolean text = Convert.ToBoolean(item.Text);
            if (text == bj.Yxbz)
            {
                item.Selected = true;
            }
        }

        txtBjrs.Disabled   = false;
        selBh.Disabled     = false;
        selNj.Disabled     = false;
        selYxbz.Disabled   = false;
        selSsyx.Enabled    = true;
        selSszy.Enabled    = true;
        btnAdd.Disabled    = false;
        btnChag.Disabled   = true;
        btnSave.Disabled   = false;
        btnCancel.Disabled = false;
    }