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

            if (rowsCount > 0)
            {
                ZhangWei.Model.HasChecked model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new ZhangWei.Model.HasChecked();
                    if (dt.Rows[n]["ID"] != null && dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["Month"] != null && dt.Rows[n]["Month"].ToString() != "")
                    {
                        model.Month = DateTime.Parse(dt.Rows[n]["Month"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Example #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(ZhangWei.Model.HasChecked model)
 {
     return(dal.Update(model));
 }
Example #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(ZhangWei.Model.HasChecked model)
 {
     return(dal.Add(model));
 }