Beispiel #1
0
        /// <summary>
        /// 将导入学案生成新导航
        /// </summary>
        public void importmenu(int Cid)
        {
            // 类型:活动1,调查2,讨论3,表单4,编程5,阅读6
            string    sql    = "select * from Mission where Mdelete=0 and Mcid=" + Cid;
            DataTable cdt    = DbHelperSQL.Query(sql).Tables[0];
            int       ccount = cdt.Rows.Count;

            Model.ListMenu lmode = new Model.ListMenu();
            BLL.ListMenu   lbll  = new BLL.ListMenu();
            if (ccount > 0)
            {
                for (int i = 0; i < ccount; i++)
                {
                    int    mid       = Int32.Parse(cdt.Rows[i]["Mid"].ToString());
                    string mtitle    = cdt.Rows[i]["Mtitle"].ToString();
                    int    mcid      = Int32.Parse(cdt.Rows[i]["Mcid"].ToString());
                    int    msort     = Int32.Parse(cdt.Rows[i]["Msort"].ToString());
                    bool   mpublish  = bool.Parse(cdt.Rows[i]["Mpublish"].ToString());
                    int    mcategory = Int32.Parse(cdt.Rows[i]["Mcategory"].ToString());
                    lmode.Lcid  = mcid;
                    lmode.Lsort = msort;
                    lmode.Ltype = 1;
                    if (mcategory == 1)
                    {
                        lmode.Ltype = 6;
                    }
                    if (mcategory == 2)
                    {
                        lmode.Ltype = 5;
                    }
                    lmode.Lxid   = mid;
                    lmode.Lshow  = mpublish;
                    lmode.Ltitle = mtitle;
                    lbll.Add(lmode);//将所有活动都添加到导航中
                }
            }

            string    sqltwo = "select * from Survey where Vcid=" + Cid;
            DataTable sdt    = DbHelperSQL.Query(sqltwo).Tables[0];
            int       scount = sdt.Rows.Count;

            if (scount > 0)
            {
                for (int i = 0; i < scount; i++)
                {
                    int    vid    = Int32.Parse(sdt.Rows[i]["Vid"].ToString());
                    string vtitle = sdt.Rows[i]["Vtitle"].ToString();
                    int    vcid   = Int32.Parse(sdt.Rows[i]["Vcid"].ToString());
                    bool   vclose = bool.Parse(sdt.Rows[i]["Vclose"].ToString());
                    lmode.Lcid   = vcid;
                    lmode.Lsort  = 6;
                    lmode.Ltype  = 2;
                    lmode.Lxid   = vid;
                    lmode.Lshow  = !vclose;
                    lmode.Ltitle = vtitle;
                    lbll.Add(lmode);//将所有调查都添加到导航中
                }
            }

            string    sqlthree = "select * from TopicDiscuss where Tcid=" + Cid;
            DataTable tdt      = DbHelperSQL.Query(sqlthree).Tables[0];
            int       tcount   = tdt.Rows.Count;

            if (tcount > 0)
            {
                for (int i = 0; i < tcount; i++)
                {
                    int    tid    = Int32.Parse(tdt.Rows[i]["Tid"].ToString());
                    string ttitle = tdt.Rows[i]["Ttitle"].ToString();
                    int    tcid   = Int32.Parse(tdt.Rows[i]["Tcid"].ToString());
                    bool   tclose = bool.Parse(tdt.Rows[i]["Tclose"].ToString());
                    lmode.Lcid   = tcid;
                    lmode.Lsort  = 8;
                    lmode.Ltype  = 3;
                    lmode.Lxid   = tid;
                    lmode.Lshow  = !tclose;
                    lmode.Ltitle = ttitle;
                    lbll.Add(lmode);//将所有讨论都添加到导航中
                }
            }

            string    sqlfour = "select  * from TxtForm where Mcid=" + Cid;
            DataTable fdt     = DbHelperSQL.Query(sqlfour).Tables[0];
            int       fcount  = fdt.Rows.Count;

            if (fcount > 0)
            {
                for (int i = 0; i < fcount; i++)
                {
                    int    mid      = Int32.Parse(fdt.Rows[i]["Mid"].ToString());
                    string mtitle   = fdt.Rows[i]["Mtitle"].ToString();
                    int    mcid     = Int32.Parse(fdt.Rows[i]["Mcid"].ToString());
                    bool   mpublish = bool.Parse(fdt.Rows[i]["Mpublish"].ToString());
                    lmode.Lcid   = mcid;
                    lmode.Lsort  = 9;
                    lmode.Ltype  = 4;
                    lmode.Lxid   = mid;
                    lmode.Lshow  = mpublish;
                    lmode.Ltitle = mtitle;
                    lbll.Add(lmode);//将所有讨论都添加到导航中
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// 将旧学案生成新导航
        /// </summary>
        public void initbuildmenu()
        {
            // 类型:活动1,调查2,讨论3
            string    sql    = "select Mid,Mtitle,Mcid,Msort,Mpublish from Mission where Mdelete=0";
            DataTable cdt    = DbHelperSQL.Query(sql).Tables[0];
            int       ccount = cdt.Rows.Count;

            Model.ListMenu lmode = new Model.ListMenu();
            BLL.ListMenu   lbll  = new BLL.ListMenu();
            if (ccount > 0)
            {
                for (int i = 0; i < ccount; i++)
                {
                    int    mid      = Int32.Parse(cdt.Rows[i]["Mid"].ToString());
                    string mtitle   = cdt.Rows[i]["Mtitle"].ToString();
                    int    mcid     = Int32.Parse(cdt.Rows[i]["Mcid"].ToString());
                    int    msort    = Int32.Parse(cdt.Rows[i]["Msort"].ToString());
                    bool   mpublish = bool.Parse(cdt.Rows[i]["Mpublish"].ToString());
                    lmode.Lcid   = mcid;
                    lmode.Lsort  = msort;
                    lmode.Ltype  = 1;
                    lmode.Lxid   = mid;
                    lmode.Lshow  = mpublish;
                    lmode.Ltitle = mtitle;
                    lbll.Add(lmode);//将所有活动都添加到导航中
                }
            }

            string    sqltwo = "select Vid,Vtitle,Vcid,Vclose from Survey ";
            DataTable sdt    = DbHelperSQL.Query(sqltwo).Tables[0];
            int       scount = sdt.Rows.Count;

            if (scount > 0)
            {
                for (int i = 0; i < scount; i++)
                {
                    int    vid    = Int32.Parse(sdt.Rows[i]["Vid"].ToString());
                    string vtitle = sdt.Rows[i]["Vtitle"].ToString();
                    int    vcid   = Int32.Parse(sdt.Rows[i]["Vcid"].ToString());
                    bool   vclose = bool.Parse(sdt.Rows[i]["Vclose"].ToString());
                    lmode.Lcid   = vcid;
                    lmode.Lsort  = 6;
                    lmode.Ltype  = 2;
                    lmode.Lxid   = vid;
                    lmode.Lshow  = !vclose;
                    lmode.Ltitle = vtitle;
                    lbll.Add(lmode);//将所有调查都添加到导航中
                }
            }

            string    sqlthree = "select Tid,Ttitle,Tcid,Tclose from TopicDiscuss";
            DataTable tdt      = DbHelperSQL.Query(sqlthree).Tables[0];
            int       tcount   = tdt.Rows.Count;

            if (tcount > 0)
            {
                for (int i = 0; i < tcount; i++)
                {
                    int    tid    = Int32.Parse(tdt.Rows[i]["Tid"].ToString());
                    string ttitle = tdt.Rows[i]["Ttitle"].ToString();
                    int    tcid   = Int32.Parse(tdt.Rows[i]["Tcid"].ToString());
                    bool   tclose = bool.Parse(tdt.Rows[i]["Tclose"].ToString());
                    lmode.Lcid   = tcid;
                    lmode.Lsort  = 8;
                    lmode.Ltype  = 3;
                    lmode.Lxid   = tid;
                    lmode.Lshow  = !tclose;
                    lmode.Ltitle = ttitle;
                    lbll.Add(lmode);//将所有讨论都添加到导航中
                }
            }
        }