示例#1
0
 public IList <Bodega> ObtenerBodegasAsignadasACentroDeDistribucion(CentroDeDistribucion centroDeDistribucion)
 {
     if (centroDeDistribucion.DISTRIBUTION_CENTER_ID == null)
     {
         DbParameter[] parameters =
         {
             new OAParameter
             {
                 ParameterName = "@DISTRIBUTION_CENTER_ID",
                 Value         = 0
             }
         };
         return
             (BaseDeDatosServicio.ExecuteQuery <Bodega>("SWIFT_SP_GET_WAREHOUSE_ASSOCIATE_BY_DISTRIBUTION_CENTER", CommandType.StoredProcedure,
                                                        parameters).ToList());
     }
     else
     {
         DbParameter[] parameters =
         {
             new OAParameter
             {
                 ParameterName = "@DISTRIBUTION_CENTER_ID",
                 Value         = centroDeDistribucion.DISTRIBUTION_CENTER_ID
             }
         };
         return
             (BaseDeDatosServicio.ExecuteQuery <Bodega>("SWIFT_SP_GET_WAREHOUSE_ASSOCIATE_BY_DISTRIBUTION_CENTER", CommandType.StoredProcedure,
                                                        parameters).ToList());
     }
 }
示例#2
0
        private void GrabarCentroDeDistribucion(object sender, int filaSeleccionada)
        {
            try
            {
                var actualizacion = true;
                var logoAntiguo   = "";
                if (UiTxtNumeroCentroDeDistribucion.Value == null)
                {
                    actualizacion = false;
                }

                if (actualizacion)
                {
                    logoAntiguo = UiVistaCentrosDeDistribucion.GetRowValues(filaSeleccionada, "LOGO_IMG").ToString();
                }
                var centroDeDistribucion = new CentroDeDistribucion();
                centroDeDistribucion.DISTRIBUTION_CENTER_ID          = UiTxtNumeroCentroDeDistribucion.Value == null ? 0 : int.Parse(UiTxtNumeroCentroDeDistribucion.Value.ToString());
                centroDeDistribucion.NAME_DISTRIBUTION_CENTER        = UiTxtNombreCentroDeDistribucion.Value.ToString();
                centroDeDistribucion.DESCRIPTION_DISTRIBUTION_CENTER = UiTxtDescripcionCentroDeDistribucion.Value.ToString();
                centroDeDistribucion.ADRESS_DISTRIBUTION_CENTER      = UiTxtDireccionCentroDeDistribucion.Value.ToString();
                centroDeDistribucion.LATITUDE  = UiSpinLatitudCentroDeDistribucion.Value.ToString();
                centroDeDistribucion.LONGITUDE = UiSpinLongitudCentroDeDistribucion.Value.ToString();

                if (Session["UiLogoCentroDeDistribucion"] == null)
                {
                    centroDeDistribucion.LOGO_IMG = logoAntiguo;
                }
                else
                {
                    centroDeDistribucion.LOGO_IMG = Session["UiLogoCentroDeDistribucion"].ToString();
                }

                var centroDeDistribucionArg = new CentroDeDistribucionArgumento();
                centroDeDistribucionArg.CentroDeDistribucion = centroDeDistribucion;
                centroDeDistribucionArg.LOGIN = Session["USER"].ToString();

                if (actualizacion)
                {
                    UsuarioDeseaActualizarCentroDeDistribucion?.Invoke(sender, centroDeDistribucionArg);
                    LimpiarCampos();
                }
                else
                {
                    UsuarioDeseaAgregarCentroDeDistribucion?.Invoke(sender, centroDeDistribucionArg);
                    LimpiarCampos();
                }
            }
            catch (Exception ex)
            {
                EstablecerError(ex.Message, UiVistaCentrosDeDistribucion);
            }
        }
示例#3
0
        public IList <CentroDeDistribucion> ObtenerCentroDeDistribucion(CentroDeDistribucion centroDeDistribucion)
        {
            DbParameter[] parameters =
            {
                new OAParameter
                {
                    ParameterName = "@DISTRIBUTION_CENTER_ID",
                    Value         = centroDeDistribucion.DISTRIBUTION_CENTER_ID
                }
            };

            return(BaseDeDatosServicio.ExecuteQuery <CentroDeDistribucion>("SWIFT_SP_GET_DISTRIBUTION_CENTER", CommandType.StoredProcedure, parameters));
        }
示例#4
0
 void _vista_VistaTerminoDeCargar(object sender, EventArgs e)
 {
     try
     {
         var centroDeDistribucion = new CentroDeDistribucion();
         centroDeDistribucion.DISTRIBUTION_CENTER_ID = null;
         _vista.CentroDeDistribucion = CentroDeDistribucionServicio.ObtenerCentroDeDistribucion(centroDeDistribucion);
     }
     catch (Exception ex)
     {
         _vista.EstablecerError(ex.Message, sender);
     }
 }
示例#5
0
        private void EliminarCentroDeDistribucion(object sender)
        {
            try
            {
                var centroDeDistribucion = new CentroDeDistribucion();
                centroDeDistribucion.DISTRIBUTION_CENTER_ID = int.Parse(UiTxtNumeroCentroDeDistribucion.Value.ToString());

                var centroDeDistribucionArg = new CentroDeDistribucionArgumento();
                centroDeDistribucionArg.CentroDeDistribucion = centroDeDistribucion;

                UsuarioDeseaEliminarCentroDeDistribucion?.Invoke(sender, centroDeDistribucionArg);
                LimpiarCampos();
            }
            catch (Exception ex)
            {
                EstablecerError(ex.Message, UiVistaCentrosDeDistribucion);
            }
        }
示例#6
0
        public Operacion EliminarBodegaACentroDeDistribucion(Bodega bodega, CentroDeDistribucion centroDeDistribucion)
        {
            DbParameter[] parameters =
            {
                new OAParameter
                {
                    ParameterName = "@DISTRIBUTION_CENTER_ID",
                    Value         = centroDeDistribucion.DISTRIBUTION_CENTER_ID
                }
                ,
                new OAParameter
                {
                    ParameterName = "@CODE_WAREHOUSE",
                    Value         = bodega.CODE_WAREHOUSE
                }
            };
            var op = BaseDeDatosServicio.ExecuteQuery <Operacion>("SWIFT_SP_DELETE_WAREHOUSE_X_DISTRIBUTION_CENTER", CommandType.StoredProcedure, false, parameters)[0];

            return(op);
        }