コード例 #1
0
ファイル: DAOUnit.cs プロジェクト: OOAD-2015/Hotel-Manager
        /// <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;
            }
        }
コード例 #2
0
ファイル: BUSUnit.cs プロジェクト: OOAD-2015/Hotel-Manager
        /// <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;
            }
        }
コード例 #3
0
ファイル: BUSUnit.cs プロジェクト: OOAD-2015/Hotel-Manager
        /// <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;
            }
        }