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

            if (rowsCount > 0)
            {
                university.Model.CCOM.Father_function model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new university.Model.CCOM.Father_function();
                    if (dt.Rows[n]["Ff_id"].ToString() != "")
                    {
                        model.Ff_id = int.Parse(dt.Rows[n]["Ff_id"].ToString());
                    }
                    model.Ff_name = dt.Rows[n]["Ff_name"].ToString();
                    if (dt.Rows[n]["Ff_fatherID"].ToString() != "")
                    {
                        model.Ff_fatherID = int.Parse(dt.Rows[n]["Ff_fatherID"].ToString());
                    }
                    if (dt.Rows[n]["Ff_sort"].ToString() != "")
                    {
                        model.Ff_sort = int.Parse(dt.Rows[n]["Ff_sort"].ToString());
                    }
                    if (dt.Rows[n]["Ff_disable"].ToString() != "")
                    {
                        if ((dt.Rows[n]["Ff_disable"].ToString() == "1") || (dt.Rows[n]["Ff_disable"].ToString().ToLower() == "true"))
                        {
                            model.Ff_disable = true;
                        }
                        else
                        {
                            model.Ff_disable = false;
                        }
                    }


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