InsertColonia_FastCatalog() public method

Crea una nueva colonia desde el wucFastCatalog
BPCiudad.InsertColonia_FastCatalog 17-Julio-2014 Ruben.Cobos
public InsertColonia_FastCatalog ( ENTColonia oENTColonia ) : ENTResponse
oENTColonia SIAQ.Entity.Object.ENTColonia Entidad de Colonia con los parámetros necesarios para crear el registro
return SIAQ.Entity.Object.ENTResponse
Esempio n. 1
0
        private void InsertColonia()
        {
            BPColonia oBPColonia = new BPColonia();
            ENTColonia oENTColonia = new ENTColonia();
            ENTResponse oENTResponse = new ENTResponse();

            try
            {

                // Formulario
                oENTColonia.CiudadId = Int32.Parse(this.hddMunicipioId.Value);
                oENTColonia.Nombre = this.txtNombre.Text.Trim();
                oENTColonia.Descripcion = this.txtNombre.Text.Trim();
                oENTColonia.Activo = 1;

                // Transacción
                oENTResponse = oBPColonia.InsertColonia_FastCatalog(oENTColonia);

                // Validaciones
                if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); }
                if (oENTResponse.sMessage != "") { throw (new Exception(oENTResponse.sMessage)); }

                // Id Generado
                this.hddItemCreatedID.Value = oENTResponse.dsResponse.Tables[1].Rows[0]["NewIdentity"].ToString();

            }catch (Exception ex) {
                throw (ex);
            }
        }