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

            if (rowsCount > 0)
            {
                dbamet.Model.Password model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new dbamet.Model.Password();
                    if (dt.Rows[n]["customId"] != null && dt.Rows[n]["customId"].ToString() != "")
                    {
                        model.customId = dt.Rows[n]["customId"].ToString();
                    }
                    if (dt.Rows[n]["password"] != null && dt.Rows[n]["password"].ToString() != "")
                    {
                        model.password = dt.Rows[n]["password"].ToString();
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(dbamet.Model.Password model)
 {
     return(dal.Update(model));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(dbamet.Model.Password model)
 {
     return(dal.Add(model));
 }