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

            if (rowsCount > 0)
            {
                Maticsoft.Model.sysUser model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model             = new Maticsoft.Model.sysUser();
                    model.UserID      = dt.Rows[n]["UserID"].ToString();
                    model.UserName    = dt.Rows[n]["UserName"].ToString();
                    model.Password    = dt.Rows[n]["Password"].ToString();
                    model.Workstation = dt.Rows[n]["Workstation"].ToString();
                    model.Privilege   = dt.Rows[n]["Privilege"].ToString();
                    if (dt.Rows[n]["ID_Key"].ToString() != "")
                    {
                        model.ID_Key = decimal.Parse(dt.Rows[n]["ID_Key"].ToString());
                    }


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemple #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Maticsoft.Model.sysUser model)
 {
     return(dal.Update(model));
 }
Exemple #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(Maticsoft.Model.sysUser model)
 {
     return(dal.Add(model));
 }
Exemple #4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void  Add(Maticsoft.Model.sysUser model)
 {
     dal.Add(model);
 }