Esempio n. 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <BWS.ERP.Model.hrDepartmentEntity> DataTableToList(DataTable dt)
        {
            List <BWS.ERP.Model.hrDepartmentEntity> modelList = new List <BWS.ERP.Model.hrDepartmentEntity>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                BWS.ERP.Model.hrDepartmentEntity model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new BWS.ERP.Model.hrDepartmentEntity();
                    if (dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["iCompanyID"].ToString() != "")
                    {
                        model.iCompanyID = int.Parse(dt.Rows[n]["iCompanyID"].ToString());
                    }
                    model.sDeptNo    = dt.Rows[n]["sDeptNo"].ToString();
                    model.sDeptName  = dt.Rows[n]["sDeptName"].ToString();
                    model.sDeptEName = dt.Rows[n]["sDeptEName"].ToString();
                    model.sRemark    = dt.Rows[n]["sRemark"].ToString();
                    model.sUserID    = dt.Rows[n]["sUserID"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
 /// <summary>
 /// 获得数据列表
 /// </summary>
 public List<BWS.ERP.Model.hrDepartmentEntity> DataTableToList(DataTable dt)
 {
     List<BWS.ERP.Model.hrDepartmentEntity> modelList = new List<BWS.ERP.Model.hrDepartmentEntity>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         BWS.ERP.Model.hrDepartmentEntity model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new BWS.ERP.Model.hrDepartmentEntity();
             if (dt.Rows[n]["ID"].ToString() != "")
             {
                 model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
             }
             if (dt.Rows[n]["iCompanyID"].ToString() != "")
             {
                 model.iCompanyID = int.Parse(dt.Rows[n]["iCompanyID"].ToString());
             }
             model.sDeptNo = dt.Rows[n]["sDeptNo"].ToString();
             model.sDeptName = dt.Rows[n]["sDeptName"].ToString();
             model.sDeptEName = dt.Rows[n]["sDeptEName"].ToString();
             model.sRemark = dt.Rows[n]["sRemark"].ToString();
             model.sUserID = dt.Rows[n]["sUserID"].ToString();
             modelList.Add(model);
         }
     }
     return modelList;
 }
Esempio n. 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(BWS.ERP.Model.hrDepartmentEntity model, SqlTransaction trans)
 {
     dal.Update(model, trans);
 }
Esempio n. 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(BWS.ERP.Model.hrDepartmentEntity model, SqlTransaction trans)
 {
     return(dal.Add(model, trans));
 }