/// <summary> /// 获得数据列表 /// </summary> public List <BWS.ERP.Model.sysMenuEntity> DataTableToList(DataTable dt) { List <BWS.ERP.Model.sysMenuEntity> modelList = new List <BWS.ERP.Model.sysMenuEntity>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { BWS.ERP.Model.sysMenuEntity model; for (int n = 0; n < rowsCount; n++) { model = new BWS.ERP.Model.sysMenuEntity(); if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } if (dt.Rows[n]["iFormID"].ToString() != "") { model.iFormID = int.Parse(dt.Rows[n]["iFormID"].ToString()); } model.sMenuName = dt.Rows[n]["sMenuName"].ToString(); model.sMenuEngName = dt.Rows[n]["sMenuEngName"].ToString(); if (dt.Rows[n]["iParentID"].ToString() != "") { model.iParentID = int.Parse(dt.Rows[n]["iParentID"].ToString()); } model.sModuleName = dt.Rows[n]["sModuleName"].ToString(); model.sFormClassName = dt.Rows[n]["sFormClassName"].ToString(); if (dt.Rows[n]["iSort"].ToString() != "") { model.iSort = int.Parse(dt.Rows[n]["iSort"].ToString()); } model.sUserID = dt.Rows[n]["sUserID"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(BWS.ERP.Model.sysMenuEntity model, SqlTransaction trans) { dal.Update(model, trans); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(BWS.ERP.Model.sysMenuEntity model, SqlTransaction trans) { return(dal.Add(model, trans)); }
/// <summary> /// 获得数据列表 /// </summary> public List<BWS.ERP.Model.sysMenuEntity> DataTableToList(DataTable dt) { List<BWS.ERP.Model.sysMenuEntity> modelList = new List<BWS.ERP.Model.sysMenuEntity>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { BWS.ERP.Model.sysMenuEntity model; for (int n = 0; n < rowsCount; n++) { model = new BWS.ERP.Model.sysMenuEntity(); if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } if (dt.Rows[n]["iFormID"].ToString() != "") { model.iFormID = int.Parse(dt.Rows[n]["iFormID"].ToString()); } model.sMenuName = dt.Rows[n]["sMenuName"].ToString(); model.sMenuEngName = dt.Rows[n]["sMenuEngName"].ToString(); if (dt.Rows[n]["iParentID"].ToString() != "") { model.iParentID = int.Parse(dt.Rows[n]["iParentID"].ToString()); } model.sModuleName = dt.Rows[n]["sModuleName"].ToString(); model.sFormClassName = dt.Rows[n]["sFormClassName"].ToString(); if (dt.Rows[n]["iSort"].ToString() != "") { model.iSort = int.Parse(dt.Rows[n]["iSort"].ToString()); } model.sUserID = dt.Rows[n]["sUserID"].ToString(); modelList.Add(model); } } return modelList; }