Ejemplo n.º 1
0
        public override global::System.Data.DataSet Clone()
        {
            DsDestinosFlete cln = ((DsDestinosFlete)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
Ejemplo n.º 2
0
        public DsDestinosFlete GetDestinosFletesDistribucionDataSetByUVentaTipoOrigen()
        {
            DsDestinosFlete ds = new DsDestinosFlete();

            SqlParameter pUnidadVentaID = new SqlParameter("@UnidadVentaID", this.unidadVentaID);

            Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "DestinoFleteDistribucionbyUnidadVentaTipoOrigen", pUnidadVentaID);

            return(ds);
        }
Ejemplo n.º 3
0
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            DsDestinosFlete ds = new DsDestinosFlete();

            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 DsDestinosFlete GetDestinos()
 {
     try
     {
         SqlParameter    pTipoDestinoID = new SqlParameter("@TipoOrigen", Utiles.BaseDatos.IntToSql(TipoDestinoID));
         SqlParameter    pUnidaVentaID  = new SqlParameter("@UnidadVentaID", Utiles.BaseDatos.IntToSql(0));
         DsDestinosFlete ds             = new DsDestinosFlete();
         Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "DestinoFletebyUnidadVentaTipoOrigen", pUnidaVentaID, pTipoDestinoID);
         return(ds);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 5
0
        private DsDestinosFlete GetDestinosFletesDataSet()
        {
            DsDestinosFlete ds = new DsDestinosFlete();

            if (CacheDataManager.GetCacheValue(SisPack.CacheObjetos.DestinoFlete.ToString()) == null)
            {
                Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "DestinosFleteALL");
                CacheDataManager.SetCacheValue(SisPack.CacheObjetos.DestinoFlete.ToString(), ds);
            }
            else
            {
                ds = (DsDestinosFlete)CacheDataManager.GetCacheValue(SisPack.CacheObjetos.DestinoFlete.ToString());
            }
            return(ds);
        }
Ejemplo n.º 6
0
        private DsDestinosFlete.DatosRow GetDestinosFleteDataRow()
        {
            DsDestinosFlete ds = new DsDestinosFlete();

            DsDestinosFlete.DatosRow dr = null;

            SqlParameter pDestinoFleteID = new SqlParameter("@DestinoFleteID", this.DestinoFleteID);

            Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "DestinoFleteONE", pDestinoFleteID);

            if (ds != null)
            {
                dr = (DsDestinosFlete.DatosRow)ds.Datos.Rows[0];
            }

            return(dr);
        }
Ejemplo n.º 7
0
        public DsDestinosFlete GetDestinosFletesDataSetByUVentaTipoOrigen()
        {
            DsDestinosFlete ds = new DsDestinosFlete();

            SqlParameter pUnidadVentaID     = new SqlParameter("@UnidadVentaID", this.unidadVentaID);
            SqlParameter pTipoOrigenDestino = new SqlParameter("@TipoOrigen", this.tipoOrigenDestino);

            // Codigos Postales: si el tipo de destino es una agrupacion de localidades llamo a un store que hace lo siguiente:
            // Levanta todas las localidades que pueden ser destino, borra las localidades que no son cabeceras de una agrupacion
            // Esto es para evitar guardar datos en la tabla: OrigenFleteUnidadVentaTEMP.
            if (this.tipoOrigenDestino != SisPack.TipoOrigenDestino.AgrupacionLocalidad)
            {
                Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "DestinoFletebyUnidadVentaTipoOrigen", pUnidadVentaID, pTipoOrigenDestino);
            }
            else
            {
                Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "DestinoFletebyUnidadVentaTipoOrigenAgrupacionLocalidad", pUnidadVentaID, pTipoOrigenDestino);
            }

            return(ds);
        }
 protected void ConsultarDestino()
 {
     if (ddlTipoDestino.SelectedValue != "")
     {
         if (txtTipoDestinoID.Text != ddlTipoDestino.SelectedValue)
         {
             IReporteHistoricoTarifario reporte = ReporteHistoricoTarifarioFactory.GerReporteHistoricoTarifarioFactory();
             reporte.TipoDestinoID = Utiles.Validaciones.obtieneEntero(ddlTipoDestino.SelectedValue);
             DsDestinosFlete ds = reporte.GetDestinos();
             lstDestinoFlete.Items.Clear();
             lstDestinoFlete.DataSource     = ds.Datos.Select("", "DestinoFleteDescrip");
             lstDestinoFlete.DataTextField  = "DestinoFleteDescrip";
             lstDestinoFlete.DataValueField = "DestinoID";
             lstDestinoFlete.DataBind();
         }
         txtTipoDestinoID.Text = ddlTipoDestino.SelectedValue;
     }
     else
     {
         LlenarCombos.TiposOrigenesDestinos(this.ddlTipoDestino);
     }
 }
Ejemplo n.º 9
0
        public DsDestinosFlete.DatosRow[] GetDestinosFletes()
        {
            DsDestinosFlete ds = GetDestinosFletesDataSet();

            DsDestinosFlete.DatosRow[] drLista = null;
            if (this.TipoOrigenDestino != SisPack.TipoOrigenDestino.Ninguno && this.DestinoFleteDescrip == "")
            {
                drLista = (DsDestinosFlete.DatosRow[])ds.Datos.Select("UnidadNegocioID = " + this.UnidadNegocioID + "and TipoOrigenDestinoID = " + (int)this.TipoOrigenDestino);
            }
            else if ((this.TipoOrigenDestino == SisPack.TipoOrigenDestino.Ninguno) && (this.DestinoFleteDescrip != ""))
            {
                drLista = (DsDestinosFlete.DatosRow[])ds.Datos.Select("UnidadNegocioID = " + this.UnidadNegocioID + "and DestinoFleteDescrip = '" + this.DestinoFleteDescrip + "'");
            }
            else if ((this.TipoOrigenDestino != SisPack.TipoOrigenDestino.Ninguno) && (this.DestinoFleteDescrip != ""))
            {
                drLista = (DsDestinosFlete.DatosRow[])ds.Datos.Select("UnidadNegocioID = " + this.UnidadNegocioID + "and TipoOrigenDestinoID = " + (int)this.TipoOrigenDestino + "and DestinoFleteDescrip = '" + this.DestinoFleteDescrip + "'");
            }
            else
            {
                drLista = (DsDestinosFlete.DatosRow[])ds.Datos.Select("UnidadNegocioID = " + this.UnidadNegocioID);
            }

            return(drLista);
        }
Ejemplo n.º 10
0
            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();
                DsDestinosFlete ds = new DsDestinosFlete();

                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);
            }
Ejemplo n.º 11
0
        public datosZonaAgDestino[] GetZonaAgDestino(string ZonaAgChecked, string usuarioUnidadNegocioID)
        {
            List <datosZonaAgDestino> list = new List <datosZonaAgDestino>();

            if (ZonaAgChecked == "true")
            {
                var devolucion = new List <datosZonaAgDestino>();

                DsAgrupacionesAgencias ds = new DsAgrupacionesAgencias();
                IAgencia agencia          = AgenciaFactory.GetAgencia();
                ds = agencia.GetZonasByUsuarioALL(Convert.ToInt32(usuarioUnidadNegocioID));

                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    datosZonaAgDestino devolu = new datosZonaAgDestino
                    {
                        Value = ds.Tables[0].Rows[i]["AgrupacionID"].ToString(),
                        Text  = ds.Tables[0].Rows[i]["AgrupacionNombre"].ToString()
                    };
                    devolucion.Add(devolu);
                }

                JavaScriptSerializer ser = new JavaScriptSerializer();
                ser.MaxJsonLength = Int32.MaxValue;
                string json = ser.Serialize(devolucion);

                datosZonaAgDestino[] dtos = ser.Deserialize <datosZonaAgDestino[]>(json);

                return(dtos);
            }
            else
            {
                var devolucion = new List <datosZonaAgDestino>();

                IDestinosFleteCol destinosFletes = DestinosFleteColFactory.GetDestinoFleteCol();
                destinosFletes.TipoOrigenDestino = NegociosSisPackInterface.SisPack.TipoOrigenDestino.Agencia;
                DsDestinosFlete ds = destinosFletes.GetDestinosFletesDataSetByUVentaTipoOrigen();

                DsDestinosFlete dsTemp = new DsDestinosFlete();

                DataRow[] rowArray = ds.Datos.Select("UnidadNegocioID = " + usuarioUnidadNegocioID, "DestinoFleteDescrip");

                foreach (DataRow row in rowArray)
                {
                    dsTemp.Tables[0].ImportRow(row);
                }

                for (int i = 0; i < dsTemp.Tables[0].Rows.Count; i++)
                {
                    datosZonaAgDestino devolu = new datosZonaAgDestino
                    {
                        Value = dsTemp.Tables[0].Rows[i]["DestinoFleteID"].ToString(),
                        Text  = dsTemp.Tables[0].Rows[i]["DestinoFleteDescrip"].ToString()
                    };
                    devolucion.Add(devolu);
                }

                JavaScriptSerializer ser = new JavaScriptSerializer();
                ser.MaxJsonLength = Int32.MaxValue;
                string json = ser.Serialize(devolucion);

                datosZonaAgDestino[] dtos = ser.Deserialize <datosZonaAgDestino[]>(json);

                return(dtos);
            }
        }