예제 #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Hownet.Model.AccessList> DataTableToList(DataTable dt)
        {
            List <Hownet.Model.AccessList> modelList = new List <Hownet.Model.AccessList>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Hownet.Model.AccessList model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Hownet.Model.AccessList();
                    if (dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    else
                    {
                        model.ID = 0;
                    }
                    if (dt.Rows[n]["AccessID"].ToString() != "")
                    {
                        model.AccessID = int.Parse(dt.Rows[n]["AccessID"].ToString());
                    }
                    else
                    {
                        model.AccessID = 0;
                    }
                    if (dt.Rows[n]["EmployeeID"].ToString() != "")
                    {
                        model.EmployeeID = int.Parse(dt.Rows[n]["EmployeeID"].ToString());
                    }
                    else
                    {
                        model.EmployeeID = 0;
                    }
                    model.PassWord = dt.Rows[n]["PassWord"].ToString();
                    model.Remark   = dt.Rows[n]["Remark"].ToString();
                    model.A        = int.Parse(dt.Rows[n]["A"].ToString());
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Hownet.Model.AccessList model)
 {
     dal.Update(model);
 }
예제 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(Hownet.Model.AccessList model)
 {
     return(dal.Add(model));
 }