コード例 #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <BWS.ERP.Model.basDataDictMasterEntity> DataTableToList(DataTable dt)
        {
            List <BWS.ERP.Model.basDataDictMasterEntity> modelList = new List <BWS.ERP.Model.basDataDictMasterEntity>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                BWS.ERP.Model.basDataDictMasterEntity model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new BWS.ERP.Model.basDataDictMasterEntity();
                    if (dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    model.sDictCategoryNo    = dt.Rows[n]["sDictCategoryNo"].ToString();
                    model.sDictCategoryCName = dt.Rows[n]["sDictCategoryCName"].ToString();
                    model.sDictCategoryEName = dt.Rows[n]["sDictCategoryEName"].ToString();
                    model.sRemark            = dt.Rows[n]["sRemark"].ToString();
                    if (dt.Rows[n]["iFlag"].ToString() != "")
                    {
                        model.iFlag = int.Parse(dt.Rows[n]["iFlag"].ToString());
                    }
                    model.sUserID = dt.Rows[n]["sUserID"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
コード例 #2
0
 /// <summary>
 /// 获得数据列表
 /// </summary>
 public List<BWS.ERP.Model.basDataDictMasterEntity> DataTableToList(DataTable dt)
 {
     List<BWS.ERP.Model.basDataDictMasterEntity> modelList = new List<BWS.ERP.Model.basDataDictMasterEntity>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         BWS.ERP.Model.basDataDictMasterEntity model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new BWS.ERP.Model.basDataDictMasterEntity();
             if (dt.Rows[n]["ID"].ToString() != "")
             {
                 model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
             }
             model.sDictCategoryNo = dt.Rows[n]["sDictCategoryNo"].ToString();
             model.sDictCategoryCName = dt.Rows[n]["sDictCategoryCName"].ToString();
             model.sDictCategoryEName = dt.Rows[n]["sDictCategoryEName"].ToString();
             model.sRemark = dt.Rows[n]["sRemark"].ToString();
             if (dt.Rows[n]["iFlag"].ToString() != "")
             {
                 model.iFlag = int.Parse(dt.Rows[n]["iFlag"].ToString());
             }
             model.sUserID = dt.Rows[n]["sUserID"].ToString();
             modelList.Add(model);
         }
     }
     return modelList;
 }
コード例 #3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(BWS.ERP.Model.basDataDictMasterEntity model, SqlTransaction trans)
 {
     dal.Update(model, trans);
 }
コード例 #4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(BWS.ERP.Model.basDataDictMasterEntity model, SqlTransaction trans)
 {
     return(dal.Add(model, trans));
 }