public ProcesadorInformacionPedidoPaquete(IMensajePedidoPaquete _mensajePedidoPaquete, ITiempoEntrega _tiempoEntrega, IFechaEntrega _fechaEntrega, ICostoEnvio _costoEnvio)
 {
     mensajePedidoPaquete = _mensajePedidoPaquete ?? throw new System.ArgumentNullException(nameof(_mensajePedidoPaquete));
     tiempoEntrega        = _tiempoEntrega ?? throw new ArgumentNullException(nameof(_tiempoEntrega));
     fechaEntrega         = _fechaEntrega ?? throw new ArgumentNullException(nameof(_fechaEntrega));
     costoEnvio           = _costoEnvio ?? throw new ArgumentNullException(nameof(_costoEnvio));
 }
Exemple #2
0
        private void CargarPrioridades()
        {
            ITiempoEntrega oTiempoEntrega = TiempoEntregaFactory.GetTiempoEntrega();

            this.lstTiempoEntrega.DataSource = oTiempoEntrega.GetTiemposEntregaConsultaDataSet();
            this.lstTiempoEntrega.DataBind();

            this.butArriba.ImageUrl = "images/bot_arribaon.gif";
            this.butAbajo.ImageUrl  = "images/bot_abajoon.gif";
        }
Exemple #3
0
        private void Editar()
        {
            ITiempoEntrega tiempoEntrega = TiempoEntregaFactory.GetTiempoEntrega();

            tiempoEntrega.TiempoEntregaID = Convert.ToInt32(this.txtTiempoEntregaID.Text);
            tiempoEntrega.Consultar();

            this.txtTiempoEntregaDescrip.Text = tiempoEntrega.TiempoEntregaDescrip;
            this.txtTiempoMaximoEntrega.Text  = Convert.ToString(tiempoEntrega.TiempoMaximoEntrega);
        }
Exemple #4
0
        private void BindGrid()
        {
            SisPackController.AdministrarGrillas.Configurar(dtgTiempoEntrega, "TiempoEntregaID", this.CantidadOpciones);
            ITiempoEntrega oTiempoEntrega = TiempoEntregaFactory.GetTiempoEntrega();

            oTiempoEntrega.Prioridad            = this.txtPrioridad.Text != "" ? Convert.ToInt32(this.txtPrioridad.Text) : 0;
            oTiempoEntrega.TiempoEntregaDescrip = this.txtTiempoEntregaDescrip.Text;
            oTiempoEntrega.UnidadNegocioID      = this.UnidadNegocioID;
            dtgTiempoEntrega.DataSource         = oTiempoEntrega.GetTiemposEntregaConsultaDataSet();
            dtgTiempoEntrega.DataBind();
        }
Exemple #5
0
        private void BindTiempoEntrega()
        {
            // lleno el combo de tiempo de entrega
            ITiempoEntrega   tiempoEntrega = TiempoEntregaFactory.GetTiempoEntrega();
            DsTiemposEntrega dsTE          = tiempoEntrega.GetTiemposEntregaByProductoDataSet(Utiles.Validaciones.obtieneEntero(this.ddlProducto.SelectedValue), this.txtServicioIDSel.Text);

            this.ddlTiempoEntrega.Items.Clear();
            this.ddlTiempoEntrega.DataSource     = dsTE;
            this.ddlTiempoEntrega.DataTextField  = "TiempoEntregaDescrip";
            this.ddlTiempoEntrega.DataValueField = "TiempoEntregaID";
            this.ddlTiempoEntrega.DataBind();
        }
Exemple #6
0
        private void butGuardarPrioridades_Click(object sender, System.EventArgs e)
        {
            for (int i = 0; i < lstTiempoEntrega.Items.Count; i++)
            {
                ITiempoEntrega oTiempoEntrega = TiempoEntregaFactory.GetTiempoEntrega();
                oTiempoEntrega.TiempoEntregaID      = Convert.ToInt32(lstTiempoEntrega.Items[i].Value);
                oTiempoEntrega.TiempoEntregaDescrip = lstTiempoEntrega.Items[i].Text.Trim();
                oTiempoEntrega.UnidadNegocioID      = this.UnidadNegocioID;
                oTiempoEntrega.TiempoMaximoEntrega  = Utiles.Validaciones.obtieneEntero(this.txtTiempoMaximoEntrega.Text);
                oTiempoEntrega.ActualizaPrioridad   = true;
                oTiempoEntrega.Prioridad            = i + 1;


                try
                {
                    if (oTiempoEntrega.Guardar())
                    {
                        string script = "<script language='javascript'>\n";
                        //script += "alert('Los datos se guardaron correctamente.');";
                        script += "window.location.href = 'TiempoEntregaConsul.aspx';\n";
                        script += "</script>";

                        Page.RegisterStartupScript("scriptOk", script);
                    }
                    else
                    {
                        string script = "<script language='javascript'>\n";
                        script += "alert('Los datos no se guardaron debido a errores.');\n";
                        script += "</script>";

                        Page.RegisterStartupScript("scriptError", script);
                    }
                }
                catch (Exception ex)
                {
                    string mensaje = ex.Message;
                    try
                    {
                        mensaje = this.TraducirTexto(ex.Message);
                        if (mensaje == "" || mensaje == null)
                        {
                            mensaje = ex.Message;
                        }
                    }
                    catch (Exception)
                    {
                        mensaje = ex.Message;
                    }
                    ((ErrorWeb)this.phErrores.Controls[0]).setMensaje(mensaje);
                }
            }
        }
Exemple #7
0
        private void BindTiempoEntregaUV(int unidadVentaID)
        {
            // lleno el combo de tiempo de entrega cuando se elijio solo una UV
            ITiempoEntrega   tiempoEntrega = TiempoEntregaFactory.GetTiempoEntrega();
            DsTiemposEntrega dsTE          = tiempoEntrega.GetTiemposEntregaByUnidadVenta(unidadVentaID);

            this.ddlTiempoEntrega.Items.Clear();
            this.ddlTiempoEntrega.DataSource     = dsTE;
            this.ddlTiempoEntrega.DataTextField  = "TiempoEntregaDescrip";
            this.ddlTiempoEntrega.DataValueField = "TiempoEntregaID";
            this.ddlTiempoEntrega.DataBind();
            //if (primerItem)
            //	this.ddlTiempoEntrega.Items.Insert(0, new ListItem("Elija Tiempo de entrega", string.Empty));
        }
Exemple #8
0
        protected void dtgTiempoEntrega_Delete(Object sender, DataGridCommandEventArgs e)
        {
            ITiempoEntrega oTiempoEntrega = TiempoEntregaFactory.GetTiempoEntrega();
            ITiempoEntrega tiempoEntrega  = TiempoEntregaFactory.GetTiempoEntrega();

            oTiempoEntrega.TiempoEntregaID = Convert.ToInt32(dtgTiempoEntrega.DataKeys[(int)e.Item.ItemIndex]);
            //oTiempoEntrega.Consultar();
            if ((int)e.Item.ItemIndex == -1)
            {
                return;
            }

            int index           = e.Item.DataSetIndex;
            DsTiemposEntrega ds = (DsTiemposEntrega)dtgTiempoEntrega.DataSource;

            DsTiemposEntrega.DatosRow dr = (DsTiemposEntrega.DatosRow)ds.Datos.Rows[index];
            tiempoEntrega.Prioridad = dr.Prioridad;

            //int prioridad=oTiempoEntrega.Prioridad;
            try
            {
                if (oTiempoEntrega.Eliminar())
                {
                    dtgTiempoEntrega.CurrentPageIndex = 0;
                    tiempoEntrega.ReasignarPrioridades();
                    this.BindGrid();
                }
            }

            catch (Exception ex)
            {
                string mensaje = ex.Message;
                try
                {
                    mensaje = this.TraducirTexto(ex.Message);
                    if (mensaje == "" || mensaje == null)
                    {
                        mensaje = ex.Message;
                    }
                }
                catch (Exception)
                {
                    mensaje = ex.Message;
                }
                ((ErrorWeb)this.phErrores.Controls[0]).setMensaje(mensaje);
            }
        }
Exemple #9
0
        private void butGuardarTiempoEntrega_Click(object sender, System.EventArgs e)
        {
            if (!Page.IsValid)
            {
                return;
            }

            ITiempoEntrega tiempoEntrega = TiempoEntregaFactory.GetTiempoEntrega();

            tiempoEntrega.TiempoEntregaID      = Convert.ToInt32(this.txtTiempoEntregaID.Text);
            tiempoEntrega.TiempoEntregaDescrip = this.txtTiempoEntregaDescrip.Text;
            tiempoEntrega.TiempoMaximoEntrega  = Convert.ToInt32(this.txtTiempoMaximoEntrega.Text);
            tiempoEntrega.UnidadNegocioID      = this.UnidadNegocioID;
            if (this.txtTiempoEntregaID.Text != "0")
            {
                for (int i = 0; i < lstTiempoEntrega.Items.Count; i++)
                {
                    if (this.txtTiempoEntregaID.Text == lstTiempoEntrega.Items[i].Value)
                    {
                        tiempoEntrega.Prioridad = i + 1;
                    }
                }
            }

            try
            {
                if (tiempoEntrega.Guardar())
                {
                    string script = "<script language='javascript'>\n";
                    script += "alert('Los datos se guardaron correctamente.');";
                    //script += "window.location.href = 'TiempoEntregaConsul.aspx';\n";
                    script += "</script>";

                    this.txtTiempoEntregaID.Text = tiempoEntrega.TiempoEntregaID.ToString();
                    Page.RegisterStartupScript("scriptOk", script);
                    tiempoEntrega.Consultar();
                    int priori = tiempoEntrega.Prioridad;
                    this.CargarPrioridades();
                }
                else
                {
                    string script = "<script language='javascript'>\n";
                    script += "alert('Los datos no se guardaron debido a errores.');\n";
                    script += "</script>";

                    Page.RegisterStartupScript("scriptError", script);
                }
            }
            catch (Exception ex)
            {
                string mensaje = ex.Message;
                try
                {
                    mensaje = this.TraducirTexto(ex.Message);
                    if (mensaje == "" || mensaje == null)
                    {
                        mensaje = ex.Message;
                    }
                }
                catch (Exception)
                {
                    mensaje = ex.Message;
                }
                ((ErrorWeb)this.phErrores.Controls[0]).setMensaje(mensaje);
            }
        }