Exemplo n.º 1
0
        /// <summary>
        /// Actualiza el registro en la base de datos
        /// </summary>
        /// <param name="parent">Lista padre</param>
        /// <remarks>La utiliza la BusinessListBaseEx correspondiente para actualizar elementos<remarks/>
        internal void Update(Familias parent)
        {
            // if we're not dirty then don't update the database
            if (!this.IsDirty)
            {
                return;
            }

            try
            {
                ValidationRules.CheckRules();

                if (!IsValid)
                {
                    throw new iQValidationException(moleQule.Resources.Messages.GENERIC_VALIDATION_ERROR);
                }

                SessionCode = parent.SessionCode;
                FamilyRecord obj = Session().Get <FamilyRecord>(Oid);
                obj.CopyValues(this._base.Record);
                Session().Update(obj);
            }
            catch (Exception ex)
            {
                iQExceptionHandler.TreatException(ex);
            }

            MarkOld();
        }
Exemplo n.º 2
0
        public void AddFamilyRecordDoc_ReturnsRequestWithCorrectCount()
        {
            //Arrange
            var          req = CreateRequestInstance();
            FamilyRecord doc = new FamilyRecord();

            //Act
            req.AddFamilyRecordDoc(doc);

            //Assert
            Assert.Equal(1, req.FamilyRecords.Count);
        }
Exemplo n.º 3
0
 protected override void DataPortal_Update()
 {
     if (IsDirty)
     {
         try
         {
             FamilyRecord obj = Session().Get <FamilyRecord>(Oid);
             obj.CopyValues(this._base.Record);
             Session().Update(obj);
             MarkOld();
         }
         catch (Exception ex)
         {
             iQExceptionHandler.TreatException(ex);
         }
     }
 }