/// <summary> /// Phương thức thêm mới một Unit vào csdl /// </summary> /// <returns>true: thêm mới thành công, false: thêm mới thất bại</returns> public bool InsertUnit(DTOUnit Unit) { try { DataExecute.Instance.createSqlCmd("sp_AddNewUnitInsert"/*Truyen vao storeprocedure*/, new object[2] { Unit.UnitID, Unit.UnitName }); return DataExecute.Instance.updateData(DataConnection.Instance.m_cmd) > 0; } catch (SqlException) { throw; } }
/// <summary> /// Phương thức thêm mới một Unit vào csdl /// </summary> /// <returns>true: thêm mới thành công, false: thêm mới thất bại</returns> public bool InsertUnit(DTOUnit Unit) { try { return unitDAO.InsertUnit(Unit); } catch (SqlException) { throw; } }
/// <summary> /// Phương thức cập nhật một Unit xuống csdl theo id /// </summary> /// <returns>true: thêm mới thành công, false: thêm mới thất bại</returns> public bool UpdateUnit(DTOUnit Unit) { try { return unitDAO.UpdateUnit(Unit); } catch (SqlException) { throw; } }