Exemplo n.º 1
0
        /// <summary>
        /// 获取UUID列表
        /// </summary>
        /// <param name="type">类型:class,dept,major</param>
        /// <param name="filename">文件名</param>
        public static bool GetUUID(string type, string filename)
        {
            var dt = new DataTable();

            dt.Columns.Add("名称");
            dt.Columns.Add("UUID");
            switch (type)
            {
            case "class":    //班级UUID
                var bll_class = new BLL.t_class();
                var c_dt      = bll_class.GetAllList().Tables[0];
                if (c_dt == null)
                {
                    break;
                }
                foreach (DataRow item in c_dt.Rows)
                {
                    var dr = dt.NewRow();
                    dr["名称"]   = item["class_name"];
                    dr["UUID"] = item["class_id"];
                    dt.Rows.Add(dr);
                }
                break;

            case "dept":    //系别UUID
                var bll_dept = new BLL.t_dept();
                var d_dt     = bll_dept.GetAllList().Tables[0];
                if (d_dt == null)
                {
                    break;
                }
                foreach (DataRow item in d_dt.Rows)
                {
                    var dr = dt.NewRow();
                    dr["名称"]   = item["dept_name"];
                    dr["UUID"] = item["dept_id"];
                    dt.Rows.Add(dr);
                }
                break;

            case "major":    //专业UUID
                var bll_major = new BLL.t_major();
                var m_dt      = bll_major.GetAllList().Tables[0];
                if (m_dt == null)
                {
                    break;
                }
                foreach (DataRow item in m_dt.Rows)
                {
                    var dr = dt.NewRow();
                    dr["名称"]   = item["major_name"];
                    dr["UUID"] = item["major_id"];
                    dt.Rows.Add(dr);
                }
                break;
            }
            //new Thread(() => { CsvHelper.dt2csv(filename, dt); }).Start();
            return(CsvHelper.dt2csv(filename, dt));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 系别DDL
        /// </summary>
        /// <param name="dropDownList"></param>
        public static void DeptDLL(DropDownList dropDownList)
        {
            dropDownList.Items.Clear();
            var bll   = new BLL.t_dept();
            var model = bll.GetModelList("dept_stat=0");

            foreach (var item in model)
            {
                dropDownList.Items.Add(new ListItem(item.dept_name, item.dept_id));
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 系别DDL
        /// </summary>
        /// <param name="ListBox"></param>
        public static void DeptLB(ListBox ListBox)
        {
            ListBox.Items.Clear();
            var bll   = new BLL.t_dept();
            var model = bll.GetModelList("dept_stat=0");

            foreach (var item in model)
            {
                ListBox.Items.Add(new ListItem(item.dept_name, item.dept_id));
            }
        }
Exemplo n.º 4
0
        private void ShowInfo(int id)
        {
            Topicsys.BLL.t_major   bll   = new Topicsys.BLL.t_major();
            Topicsys.Model.t_major model = bll.GetModel(id);
            this.lblid.Text = model.id.ToString();
            var bll_dept = new BLL.t_dept();

            this.lblmajor_dept_id.Text = bll_dept.GetModel(model.major_dept_id).dept_name;
            this.lblmajor_name.Text    = model.major_name;
            this.lblmajor_dept_id.Text = model.major_dept_id;
            this.lblmajor_stat.Text    = model.major_stat.ToString();
            this.lblmajor_note.Text    = model.major_note;
        }