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

            if (rowsCount > 0)
            {
                MobileSoft.Model.Resources.Tb_Resources_Attr model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new MobileSoft.Model.Resources.Tb_Resources_Attr();
                    //model.AttrID=dt.Rows[n]["AttrID"].ToString();
                    model.AttrName = dt.Rows[n]["AttrName"].ToString();
                    if (dt.Rows[n]["AttrIndex"].ToString() != "")
                    {
                        model.AttrIndex = int.Parse(dt.Rows[n]["AttrIndex"].ToString());
                    }
                    model.AttrType  = dt.Rows[n]["AttrType"].ToString();
                    model.AttrColor = dt.Rows[n]["AttrColor"].ToString();
                    //model.BussId=dt.Rows[n]["BussId"].ToString();
                    if (dt.Rows[n]["IsDelete"].ToString() != "")
                    {
                        model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Example #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(MobileSoft.Model.Resources.Tb_Resources_Attr model)
 {
     dal.Update(model);
 }
Example #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(MobileSoft.Model.Resources.Tb_Resources_Attr model)
 {
     dal.Add(model);
 }