Exemplo n.º 1
0
 /// <summary>
 /// 获得数据列表
 /// </summary>
 public List<BWS.ERP.Model.sysUserEntity> DataTableToList(DataTable dt)
 {
     List<BWS.ERP.Model.sysUserEntity> modelList = new List<BWS.ERP.Model.sysUserEntity>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         BWS.ERP.Model.sysUserEntity model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new BWS.ERP.Model.sysUserEntity();
             if (dt.Rows[n]["ID"].ToString() != "")
             {
                 model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
             }
             model.sUserID = dt.Rows[n]["sUserID"].ToString();
             model.sUserCName = dt.Rows[n]["sUserCName"].ToString();
             model.sUserEName = dt.Rows[n]["sUserEName"].ToString();
             string s = BWS.ERP.BaseControl.SysEncrypt.DecryptStr(dt.Rows[n]["sPassword"].ToString());
             if (s != "KeyError")
             {
                 model.sPassword = s;
             }
             else
             {
                 model.sPassword = dt.Rows[n]["sPassword"].ToString();
             }
             if (dt.Rows[n]["ParentID"].ToString() != "")
             {
                 model.ParentID = int.Parse(dt.Rows[n]["ParentID"].ToString());
             }
             if (dt.Rows[n]["EmpID"].ToString() != "")
             {
                 model.EmpID = int.Parse(dt.Rows[n]["EmpID"].ToString());
             }
             if (dt.Rows[n]["iUserType"].ToString() != "")
             {
                 model.iUserType = int.Parse(dt.Rows[n]["iUserType"].ToString());
             }
             if (dt.Rows[n]["bIsLock"].ToString() != "")
             {
                 if ((dt.Rows[n]["bIsLock"].ToString() == "1") || (dt.Rows[n]["bIsLock"].ToString().ToLower() == "true"))
                 {
                     model.bIsLock = true;
                 }
                 else
                 {
                     model.bIsLock = false;
                 }
             }
             model.sRemark = dt.Rows[n]["sRemark"].ToString();
             if (dt.Rows[n]["iFlag"].ToString() != "")
             {
                 model.iFlag = int.Parse(dt.Rows[n]["iFlag"].ToString());
             }
             model.sUserTypeName = dt.Rows[n]["sUserTypeName"].ToString();
             model.sDeptNo = dt.Rows[n]["sDeptNo"].ToString();
             model.sDeptName = dt.Rows[n]["sDeptName"].ToString();
             model.sDeptEName = dt.Rows[n]["sDeptEName"].ToString();
             model.sParentUserID = dt.Rows[n]["sParentUserID"].ToString();
             model.sParentCName = dt.Rows[n]["sParentCName"].ToString();
             modelList.Add(model);
         }
     }
     return modelList;
 }
Exemplo n.º 2
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(BWS.ERP.Model.sysUserEntity model, SqlTransaction trans)
 {
     return(dal.Add(model, trans));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(BWS.ERP.Model.sysUserEntity model, SqlTransaction trans)
 {
     dal.Update(model, trans);
 }
Exemplo n.º 4
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <BWS.ERP.Model.sysUserEntity> DataTableToList(DataTable dt)
        {
            List <BWS.ERP.Model.sysUserEntity> modelList = new List <BWS.ERP.Model.sysUserEntity>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                BWS.ERP.Model.sysUserEntity model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new BWS.ERP.Model.sysUserEntity();
                    if (dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    model.sUserID    = dt.Rows[n]["sUserID"].ToString();
                    model.sUserCName = dt.Rows[n]["sUserCName"].ToString();
                    model.sUserEName = dt.Rows[n]["sUserEName"].ToString();
                    string s = BWS.ERP.BaseControl.SysEncrypt.DecryptStr(dt.Rows[n]["sPassword"].ToString());
                    if (s != "KeyError")
                    {
                        model.sPassword = s;
                    }
                    else
                    {
                        model.sPassword = dt.Rows[n]["sPassword"].ToString();
                    }
                    if (dt.Rows[n]["ParentID"].ToString() != "")
                    {
                        model.ParentID = int.Parse(dt.Rows[n]["ParentID"].ToString());
                    }
                    if (dt.Rows[n]["EmpID"].ToString() != "")
                    {
                        model.EmpID = int.Parse(dt.Rows[n]["EmpID"].ToString());
                    }
                    if (dt.Rows[n]["iUserType"].ToString() != "")
                    {
                        model.iUserType = int.Parse(dt.Rows[n]["iUserType"].ToString());
                    }
                    if (dt.Rows[n]["bIsLock"].ToString() != "")
                    {
                        if ((dt.Rows[n]["bIsLock"].ToString() == "1") || (dt.Rows[n]["bIsLock"].ToString().ToLower() == "true"))
                        {
                            model.bIsLock = true;
                        }
                        else
                        {
                            model.bIsLock = false;
                        }
                    }
                    model.sRemark = dt.Rows[n]["sRemark"].ToString();
                    if (dt.Rows[n]["iFlag"].ToString() != "")
                    {
                        model.iFlag = int.Parse(dt.Rows[n]["iFlag"].ToString());
                    }
                    model.sUserTypeName = dt.Rows[n]["sUserTypeName"].ToString();
                    model.sDeptNo       = dt.Rows[n]["sDeptNo"].ToString();
                    model.sDeptName     = dt.Rows[n]["sDeptName"].ToString();
                    model.sDeptEName    = dt.Rows[n]["sDeptEName"].ToString();
                    model.sParentUserID = dt.Rows[n]["sParentUserID"].ToString();
                    model.sParentCName  = dt.Rows[n]["sParentCName"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }