/// <summary> /// 获得数据列表 /// </summary> public List <BWS.ERP.Model.hrCompanyDetailEntity> DataTableToList(DataTable dt) { List <BWS.ERP.Model.hrCompanyDetailEntity> modelList = new List <BWS.ERP.Model.hrCompanyDetailEntity>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { BWS.ERP.Model.hrCompanyDetailEntity model; for (int n = 0; n < rowsCount; n++) { model = new BWS.ERP.Model.hrCompanyDetailEntity(); if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } if (dt.Rows[n]["MainID"].ToString() != "") { model.MainID = int.Parse(dt.Rows[n]["MainID"].ToString()); } model.sCurrency = dt.Rows[n]["sCurrency"].ToString(); model.sBankName = dt.Rows[n]["sBankName"].ToString(); model.sBankAccount = dt.Rows[n]["sBankAccount"].ToString(); model.sBankAddr = dt.Rows[n]["sBankAddr"].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(); model.sCurrencyCName = dt.Rows[n]["sCurrencyCName"].ToString(); model.sCurrencyEName = dt.Rows[n]["sCurrencyEName"].ToString(); modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(BWS.ERP.Model.hrCompanyDetailEntity model, SqlTransaction trans) { dal.Update(model, trans); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(BWS.ERP.Model.hrCompanyDetailEntity model, SqlTransaction trans) { return(dal.Add(model, trans)); }