Esempio n. 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Hownet.Model.Remark> DataTableToList(DataTable dt)
        {
            List <Hownet.Model.Remark> modelList = new List <Hownet.Model.Remark>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Hownet.Model.Remark model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Hownet.Model.Remark();
                    if (dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    else
                    {
                        model.ID = 0;
                    }
                    if (dt.Rows[n]["TableTypeID"].ToString() != "")
                    {
                        model.TableTypeID = int.Parse(dt.Rows[n]["TableTypeID"].ToString());
                    }
                    else
                    {
                        model.TableTypeID = 0;
                    }
                    model.Remarks = dt.Rows[n]["Remarks"].ToString();
                    model.A       = int.Parse(dt.Rows[n]["A"].ToString());
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Esempio n. 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Hownet.Model.Remark model)
 {
     dal.Update(model);
 }
Esempio n. 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Hownet.Model.Remark model)
 {
     return(dal.Add(model));
 }