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

            if (rowsCount > 0)
            {
                Maticsoft.Model.File_Dowm_Detail model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Maticsoft.Model.File_Dowm_Detail();
                    if (dt.Rows[n]["ID"] != null && dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["file_id"] != null && dt.Rows[n]["file_id"].ToString() != "")
                    {
                        model.file_id = int.Parse(dt.Rows[n]["file_id"].ToString());
                    }
                    if (dt.Rows[n]["dowm_person"] != null && dt.Rows[n]["dowm_person"].ToString() != "")
                    {
                        model.dowm_person = int.Parse(dt.Rows[n]["dowm_person"].ToString());
                    }
                    if (dt.Rows[n]["dowm_date"] != null && dt.Rows[n]["dowm_date"].ToString() != "")
                    {
                        model.dowm_date = DateTime.Parse(dt.Rows[n]["dowm_date"].ToString());
                    }
                    if (dt.Rows[n]["value1"] != null && dt.Rows[n]["value1"].ToString() != "")
                    {
                        model.value1 = dt.Rows[n]["value1"].ToString();
                    }
                    if (dt.Rows[n]["value2"] != null && dt.Rows[n]["value2"].ToString() != "")
                    {
                        model.value2 = dt.Rows[n]["value2"].ToString();
                    }
                    if (dt.Rows[n]["value3"] != null && dt.Rows[n]["value3"].ToString() != "")
                    {
                        model.value3 = dt.Rows[n]["value3"].ToString();
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Maticsoft.Model.File_Dowm_Detail model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Maticsoft.Model.File_Dowm_Detail model)
 {
     return(dal.Add(model));
 }