Exemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<Maticsoft.Model.t_FansMarks> DataTableToList(DataTable dt)
        {
            List<Maticsoft.Model.t_FansMarks> modelList = new List<Maticsoft.Model.t_FansMarks>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                Maticsoft.Model.t_FansMarks model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Maticsoft.Model.t_FansMarks();
                                                    if(dt.Rows[n]["markId"].ToString()!="")
                {
                    model.markId=int.Parse(dt.Rows[n]["markId"].ToString());
                }
                                                                                                                                                model.onselfName= dt.Rows[n]["onselfName"].ToString();
                                                                                                                                model.otherName= dt.Rows[n]["otherName"].ToString();
                                                                                                                if(dt.Rows[n]["createTime"].ToString()!="")
                {
                    model.createTime=DateTime.Parse(dt.Rows[n]["createTime"].ToString());
                }

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

            if (rowsCount > 0)
            {
                Maticsoft.Model.t_FansMarks model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Maticsoft.Model.t_FansMarks();
                    if (dt.Rows[n]["markId"].ToString() != "")
                    {
                        model.markId = int.Parse(dt.Rows[n]["markId"].ToString());
                    }
                    model.onselfName = dt.Rows[n]["onselfName"].ToString();
                    model.otherName  = dt.Rows[n]["otherName"].ToString();
                    if (dt.Rows[n]["createTime"].ToString() != "")
                    {
                        model.createTime = DateTime.Parse(dt.Rows[n]["createTime"].ToString());
                    }


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Maticsoft.Model.t_FansMarks model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void  Add(Maticsoft.Model.t_FansMarks model)
 {
     dal.Add(model);
 }