public UOMVO GetByID(int id) { UOMVO vo = new UOMVO(); DataTable dt = Select("ID=" + id + ""); if (dt.Rows.Count > 0) { vo = b.ConvertObj(dt.Rows[0], new UOMVO()) as UOMVO; } return(vo); }
public int Create(UOMVO vo) { int id = 0; if (!dao.isExist(vo.Id.ToString())) { id = dao.Insert(vo); } else { id = dao.Update(vo); } return(id); }
public int Insert(UOMVO vo) { int lastInsertId = 0; try { lastInsertId = b.Insert("UOM", b.ConvertColName(vo), b.ConvertValueList(vo)); } catch (Exception ex) { throw ex; } return(lastInsertId); }
public int Update(UOMVO vo) { int ID = 0; try { b.Update("UOM", vo.Id.ToString(), b.ConvertColName(vo), b.ConvertValueList(vo)); ID = vo.Id; } catch (Exception ex) { throw ex; } return(ID); }