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

            if (rowsCount > 0)
            {
                lgk.Model.tb_systemBank model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new lgk.Model.tb_systemBank();
                    if (dt.Rows[n]["ID"] != null && dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["BankName"] != null && dt.Rows[n]["BankName"].ToString() != "")
                    {
                        model.BankName = dt.Rows[n]["BankName"].ToString();
                    }
                    if (dt.Rows[n]["BankAddress"] != null && dt.Rows[n]["BankAddress"].ToString() != "")
                    {
                        model.BankAddress = dt.Rows[n]["BankAddress"].ToString();
                    }
                    if (dt.Rows[n]["BankAccount"] != null && dt.Rows[n]["BankAccount"].ToString() != "")
                    {
                        model.BankAccount = dt.Rows[n]["BankAccount"].ToString();
                    }
                    if (dt.Rows[n]["BankAccountUser"] != null && dt.Rows[n]["BankAccountUser"].ToString() != "")
                    {
                        model.BankAccountUser = dt.Rows[n]["BankAccountUser"].ToString();
                    }
                    if (dt.Rows[n]["BankType"] != null && dt.Rows[n]["BankType"].ToString() != "")
                    {
                        model.BankType = int.Parse(dt.Rows[n]["BankType"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(lgk.Model.tb_systemBank model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(lgk.Model.tb_systemBank model)
 {
     return(dal.Add(model));
 }