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

            if (rowsCount > 0)
            {
                MobileSoft.Model.System.Tb_System_Borough model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new MobileSoft.Model.System.Tb_System_Borough();
                    if (dt.Rows[n]["BoroughID"].ToString() != "")
                    {
                        model.BoroughID = int.Parse(dt.Rows[n]["BoroughID"].ToString());
                    }
                    if (dt.Rows[n]["CityID"].ToString() != "")
                    {
                        model.CityID = int.Parse(dt.Rows[n]["CityID"].ToString());
                    }
                    model.BoroughName = dt.Rows[n]["BoroughName"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemple #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(MobileSoft.Model.System.Tb_System_Borough model)
 {
     dal.Update(model);
 }
Exemple #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(MobileSoft.Model.System.Tb_System_Borough model)
 {
     dal.Add(model);
 }