예제 #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <university.Model.CCOM.Son_function> DataTableToList(DataTable dt)
        {
            List <university.Model.CCOM.Son_function> modelList = new List <university.Model.CCOM.Son_function>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                university.Model.CCOM.Son_function model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new university.Model.CCOM.Son_function();
                    if (dt.Rows[n]["Sf_id"].ToString() != "")
                    {
                        model.Sf_id = int.Parse(dt.Rows[n]["Sf_id"].ToString());
                    }
                    model.Sf_name = dt.Rows[n]["Sf_name"].ToString();
                    model.Sf_url  = dt.Rows[n]["Sf_url"].ToString();
                    if (dt.Rows[n]["Sf_sort"].ToString() != "")
                    {
                        model.Sf_sort = int.Parse(dt.Rows[n]["Sf_sort"].ToString());
                    }
                    if (dt.Rows[n]["Sf_status"].ToString() != "")
                    {
                        if ((dt.Rows[n]["Sf_status"].ToString() == "1") || (dt.Rows[n]["Sf_status"].ToString().ToLower() == "true"))
                        {
                            model.Sf_status = true;
                        }
                        else
                        {
                            model.Sf_status = false;
                        }
                    }
                    if (dt.Rows[n]["Ff_ID"].ToString() != "")
                    {
                        model.Ff_ID = int.Parse(dt.Rows[n]["Ff_ID"].ToString());
                    }


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(university.Model.CCOM.Son_function model)
 {
     return(dal.Update(model));
 }
예제 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(university.Model.CCOM.Son_function model)
 {
     return(dal.Add(model));
 }