예제 #1
0
        /// <summary>
        /// Update existing CHITIETMUONVATTU
        /// </summary>
        /// <param name="businessObject">CHITIETMUONVATTU object</param>
        /// <returns>true for successfully saved</returns>
        public bool Update(CHITIETMUONVATTU businessObject)
        {
            if (!businessObject.IsValid)
            {
                businessObject.ShowErrorMessage();//throw new InvalidBusinessObjectException(businessObject.BrokenRulesList.ToString());
            }


            return(_dataObject.Update(businessObject));
        }
예제 #2
0
        /// <summary>
        /// Insert new CHITIETMUONVATTU
        /// </summary>
        /// <param name="businessObject">CHITIETMUONVATTU object</param>
        /// <returns>true for successfully saved</returns>
        public bool Insert(CHITIETMUONVATTU businessObject)
        {
            if (!businessObject.IsValid)
            {
                businessObject.ShowErrorMessage();//throw new InvalidBusinessObjectException(businessObject.BrokenRulesList.ToString());
            }

            VATTUFactory VATTUService = new VATTUFactory();
            VATTU        vattu        = VATTUService.GetAllEntities().Where(p => p.ID == businessObject.VATTUID).FirstOrDefault();

            vattu.SOLUONG -= businessObject.SOLUONG;
            VATTUService.Update(vattu);

            return(_dataObject.Insert(businessObject));
        }