Beispiel #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <WSS.Model.Department> DataTableToList(DataTable dt)
        {
            List <WSS.Model.Department> modelList = new List <WSS.Model.Department>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                WSS.Model.Department model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new WSS.Model.Department();
                    if (dt.Rows[n]["F_DepartID"].ToString() != "")
                    {
                        model.F_DepartID = int.Parse(dt.Rows[n]["F_DepartID"].ToString());
                    }
                    if (dt.Rows[n]["F_ParentID"].ToString() != "")
                    {
                        model.F_ParentID = int.Parse(dt.Rows[n]["F_ParentID"].ToString());
                    }
                    model.F_DepartName = dt.Rows[n]["F_DepartName"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Beispiel #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(WSS.Model.Department model)
 {
     return(dal.Update(model));
 }
Beispiel #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(WSS.Model.Department model)
 {
     return(dal.Add(model));
 }