コード例 #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <GTMIS.Model.T_SysDictType> DataTableToList(DataTable dt)
        {
            List <GTMIS.Model.T_SysDictType> modelList = new List <GTMIS.Model.T_SysDictType>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                GTMIS.Model.T_SysDictType model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new GTMIS.Model.T_SysDictType();
                    if (dt.Rows[n]["FDictTypeId"].ToString() != "")
                    {
                        model.FDictTypeId = int.Parse(dt.Rows[n]["FDictTypeId"].ToString());
                    }
                    model.FTypeName = dt.Rows[n]["FTypeName"].ToString();
                    if (dt.Rows[n]["FParentId"].ToString() != "")
                    {
                        model.FParentId = int.Parse(dt.Rows[n]["FParentId"].ToString());
                    }
                    model.FCreateBy = dt.Rows[n]["FCreateBy"].ToString();
                    if (dt.Rows[n]["FCreateDate"].ToString() != "")
                    {
                        model.FCreateDate = DateTime.Parse(dt.Rows[n]["FCreateDate"].ToString());
                    }


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
コード例 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(GTMIS.Model.T_SysDictType model)
 {
     return(dal.Update(model));
 }
コード例 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(GTMIS.Model.T_SysDictType model)
 {
     return(dal.Add(model));
 }