public override global::System.Data.DataSet Clone() { DsDestinosGuiaServicios cln = ((DsDestinosGuiaServicios)(base.Clone())); cln.InitVars(); cln.SchemaSerializationMode = this.SchemaSerializationMode; return(cln); }
public bool Guardar() { if (this.ProductoID == 0) { this.ProductoID = Convert.ToInt32(Config.Conexion.EjecutarResultadoUnico("ProductoINS", Utiles.BaseDatos.StrToSql(ProductoDescrip), DefineMovimientoMensual, Utiles.BaseDatos.IntToSql(DiasPermanenciaAgencia), Utiles.BaseDatos.IntToSql(UnidadNegocioID))); } else { Config.Conexion.EjecutarSinResultados("ProductoUPD", Utiles.BaseDatos.IntToSql(ProductoID), Utiles.BaseDatos.StrToSql(ProductoDescrip), DefineMovimientoMensual, Utiles.BaseDatos.IntToSql(DiasPermanenciaAgencia), Utiles.BaseDatos.IntToSql(UnidadNegocioID)); } //CacheDataManager.RemoveCacheValue(SisPack.CacheObjetos.UnidadVentaProductos.ToString()); //CacheDataManager.RemoveCacheValue(SisPack.CacheObjetos.UnidadVentaTEntregaProducto.ToString()); CacheDataManager.RemoveCacheValue(SisPack.CacheObjetos.UnidadVentaServicioTEntregaProducto.ToString()); CacheDataManager.RemoveCacheValue(SisPack.CacheObjetos.UnidadVentaServicioTEntregaProductoConvenio.ToString()); //CacheDataManager.RemoveCacheValue(SisPack.CacheObjetos.UnidadVentaModalidadesEntrega.ToString()); /*SFE: Se comenta porque para codigos postales ya no se necesitaria. se utiliza el store que esta despues*/ // Obtengo los datos actualizados, remuevo el cache viejo, y creo el nuevo caché con los nuevos datos // con esto logro que el tiempo se disminuya //DsDestinosGuias ds = new DsDestinosGuias(); //Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "UVentaModEntregaAgenciaDestinoSEL"); //CacheDataManager.RemoveCacheValue(SisPack.CacheObjetos.UnidadVentaMEntregaDestino.ToString()); //CacheDataManager.SetCacheValue(SisPack.CacheObjetos.UnidadVentaMEntregaDestino.ToString(), ds); // Limpio de cache los datos para la emisión de la guía (new AdministrarGuias()).LimpiarCacheUVAgLocParaEmisionGuia(); //CacheDataManager.RemoveCacheValue(SisPack.CacheObjetos.UnidadVentaMEntregaDestino.ToString()); DsUnidadVentaTEntregaProductoServicio dsuVenta = new DsUnidadVentaTEntregaProductoServicio(); Config.Conexion.LlenarTypeDataSet(dsuVenta.Datos, System.Data.CommandType.StoredProcedure, "UVentaServTEntregaModEntregaProductoAgenciaOrigenSEL"); CacheDataManager.RemoveCacheValue(SisPack.CacheObjetos.UVentaProductoServicioTEntregaMEntregaAgenciaOrigen.ToString()); CacheDataManager.SetCacheValue(SisPack.CacheObjetos.UVentaProductoServicioTEntregaMEntregaAgenciaOrigen.ToString(), dsuVenta); List <Dominio.Entidades.ProductosParaGuia> lst; lst = IoC.GetObjectDominio <Dominio.Interfaces.Dominio.Guia.IDestinoGuiaDominio>().GetProductosParaGuia(); CacheDataManager.RemoveCacheValue(SisPack.CacheObjetos.UVentaProductoServicioTEntregaMEntregaAgenciaOrigenList.ToString()); CacheDataManager.SetCacheValue(SisPack.CacheObjetos.UVentaProductoServicioTEntregaMEntregaAgenciaOrigenList.ToString(), lst); /*SFE: Modificacion para consultar los servicios que puede recibir la agencia*/ // Obtengo los datos actualizados, remuevo el cache viejo, y creo el nuevo caché con los nuevos datos // con esto logro que el tiempo se disminuya DsDestinosGuiaServicios dsServicios = new DsDestinosGuiaServicios(); Config.Conexion.LlenarTypeDataSet(dsServicios.Datos, System.Data.CommandType.StoredProcedure, "UVentaModalidadEntregaServicioAgenciaDestinoSEL"); CacheDataManager.RemoveCacheValue(SisPack.CacheObjetos.ServiciosGuiaDestino.ToString()); CacheDataManager.SetCacheValue(SisPack.CacheObjetos.ServiciosGuiaDestino.ToString(), dsServicios); return(true); }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { DsDestinosGuiaServicios ds = new DsDestinosGuiaServicios(); global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny(); any.Namespace = ds.Namespace; sequence.Items.Add(any); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte()));) { ; } if ((s1.Position == s1.Length)) { return(type); } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return(type); }
public bool Guardar() { using (SqlConnection conexion = new SqlConnection()) { SqlTransaction transaccion = null; conexion.ConnectionString = Config.ConnectionString; try { conexion.Open(); transaccion = conexion.BeginTransaction(); if (!this.oDomicilio.Guardar(transaccion)) { transaccion.Rollback(); return(false); } if (this.PuntoRecepcionID == 0) { /*if (this.Codigo == "" || this.Codigo == null) * { * this.Codigo = Config.Conexion.EjecutarResultadoUnico(transaccion, "GetCodigoPuntoRecepcion", this.Empresa.EmpresaID).ToString(); * if (this.SucursalDGI == "") * { * transaccion.Rollback(); * return false; * } * }*/ this.PuntoRecepcionID = Convert.ToInt32(Config.Conexion.EjecutarResultadoUnico(transaccion, "PuntoRecepcionINS", Utiles.BaseDatos.IntToSql(this.EmpresaTercerosID), this.RazonSocial, Utiles.BaseDatos.StrToSql(this.Nombre), Utiles.BaseDatos.StrToSql(this.Email), Utiles.BaseDatos.IntToSql(this.AgenciaReferenciaRedespacho), this.EsReceptora, this.Domicilio.DomicilioID, this.Responsable.ResponsableID, this.EntregaDomicilio, Utiles.BaseDatos.IntToSql(this.EmpresaTercerosEntregaID), Utiles.BaseDatos.IntToSql(this.TarifarioRetiroEntregaID), (int)this.EstadoAgencia)); } else { Config.Conexion.EjecutarSinResultados(transaccion, "PuntoRecepcionUPD", this.PuntoRecepcionID, this.Codigo, Utiles.BaseDatos.IntToSql(this.EmpresaTercerosID), this.RazonSocial, Utiles.BaseDatos.StrToSql(this.Nombre), Utiles.BaseDatos.StrToSql(this.Email), Utiles.BaseDatos.IntToSql(this.AgenciaReferenciaRedespacho), this.EsReceptora, this.Domicilio.DomicilioID, this.Responsable.ResponsableID, this.EntregaDomicilio, Utiles.BaseDatos.IntToSql(this.EmpresaTercerosEntregaID), Utiles.BaseDatos.IntToSql(this.TarifarioRetiroEntregaID), (int)this.EstadoAgencia); } /*if (this.EsEmisora) * { * OrigenFlete origen=new OrigenFlete(); * this.Empresa.Consultar(); * origen.GuardarAgencia(transaccion,this.AgenciaID,this.Empresa.UnidadNegocio.UnidadNegocioID); * }*/ if (this.EsReceptora) { DestinoFlete destino = new DestinoFlete(); destino.GuardarPuntoRecepcion(transaccion, this.PuntoRecepcionID, this.UnidadNegocioID); } if (!this.LimpiarServicios(transaccion)) { transaccion.Rollback(); return(false); } if (this.ServiciosPuntoRecepcionCol.getCount() > 0) { this.ServiciosPuntoRecepcionCol.PuntoRecepcionID = this.PuntoRecepcionID; if (!this.ServiciosPuntoRecepcionCol.Guardar(transaccion)) { transaccion.Rollback(); return(false); } } //(si this.Emisora = true){Instancia de origenflete //orgienflete.guardarorigenAgencia(...)} //Instancia de destinoflete (si this.receptora = true) //destinoflete.guardaragencia( /*if(!this.GuardarHistorico(transaccion, usuario)) * { * transaccion.Rollback(); * return false; * }*/ //Hacer UPD a la tablas: OrigenFleteUnidadVentaTEMP, DestinoFleteUnidadVentaTEMP OrigenDestinoFleteUVta oFleteUvta = new OrigenDestinoFleteUVta(); oFleteUvta.UnidadNegocio = this.UnidadNegocioID; oFleteUvta.PuntoRecepcionID = this.PuntoRecepcionID; oFleteUvta.ActualizarOrigenDestinoUVta(transaccion); transaccion.Commit(); /*SFE: Se comenta porque para codigos postales ya no se necesitaria. se utiliza el store que esta despues*/ // Obtengo los datos actualizados, remuevo el cache viejo, y creo el nuevo caché con los nuevos datos // con esto logro que el tiempo se disminuya //DsDestinosGuias ds = new DsDestinosGuias(); //Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "UVentaModEntregaAgenciaDestinoSEL"); //CacheDataManager.RemoveCacheValue(SisPack.CacheObjetos.UnidadVentaMEntregaDestino.ToString()); //CacheDataManager.SetCacheValue(SisPack.CacheObjetos.UnidadVentaMEntregaDestino.ToString(), ds); //// Limpio de cache los datos para la emisión de la guía (new AdministrarGuias()).LimpiarCacheUVAgLocParaEmisionGuia(); /*SFE: Modificacion para consultar los servicios que puede recibir el punto de recepcion*/ // Obtengo los datos actualizados, remuevo el cache viejo, y creo el nuevo caché con los nuevos datos // con esto logro que el tiempo se disminuya DsDestinosGuiaServicios dsServicios = new DsDestinosGuiaServicios(); Config.Conexion.LlenarTypeDataSet(dsServicios.Datos, System.Data.CommandType.StoredProcedure, "UVentaModalidadEntregaServicioAgenciaDestinoSEL"); CacheDataManager.RemoveCacheValue(SisPack.CacheObjetos.ServiciosGuiaDestino.ToString()); CacheDataManager.SetCacheValue(SisPack.CacheObjetos.ServiciosGuiaDestino.ToString(), dsServicios); //Hay que sacar del cache los objetos relacionados con agencia: UVentaAgenciaOrigen, UVentaAgenciaDestino //CacheDataManager.RemoveCacheValue(SisPack.CacheObjetos.UVentaProductoServicioTEntregaMEntregaAgenciaOrigen.ToString()); //CacheDataManager.RemoveCacheValue(SisPack.CacheObjetos.UnidadVentaMEntregaDestino.ToString()); //Remover del cache las agencias //CacheDataManager.RemoveCacheValue(SisPack.CacheObjetos.Agencia.ToString()); return(true); } catch (Exception ex) { transaccion.Rollback(); throw ex; } } }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); DsDestinosGuiaServicios ds = new DsDestinosGuiaServicios(); global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); any1.Namespace = "http://www.w3.org/2001/XMLSchema"; any1.MinOccurs = new decimal(0); any1.MaxOccurs = decimal.MaxValue; any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any1); global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; any2.MinOccurs = new decimal(1); any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any2); global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute1.Name = "namespace"; attribute1.FixedValue = ds.Namespace; type.Attributes.Add(attribute1); global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute2.Name = "tableTypeName"; attribute2.FixedValue = "DatosDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte()));) { ; } if ((s1.Position == s1.Length)) { return(type); } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return(type); }