Ejemplo n.º 1
0
 private async void MethodLoadSubCategoria(ESGR_ProductoCategoria ESGR_ProductoCategoria)
 {
     await Task.Factory.StartNew(() =>
     {
         try
         {
             PropertyMetroProgressBarSubCategoria       = true;
             CollectionESGR_ProductoSubCategoria.Source = new BSGR_ProductoSubCategoria().GetCollectionProductoSubCategoriaCartaDia(ESGR_ProductoCategoria);
             SelectedESGR_ProductoSubCategoria          = CollectionESGR_ProductoSubCategoria.FirstOrDefault();
             if (SelectedESGR_ProductoSubCategoria.SubCategoria == "NINGUNA")
             {
                 PropertyVisibilitySubCategoria = Visibility.Collapsed;
             }
             else
             {
                 PropertyVisibilitySubCategoria = Visibility.Visible;
             }
             PropertyMetroProgressBarSubCategoria = false;
         }
         catch (Exception ex)
         {
             CmpMessageBox.Show(SGRMessage.TitlePedido, ex.Message, CmpButton.Aceptar);
         }
     });
 }
Ejemplo n.º 2
0
 public async void MethodLoadSubCategoria(ESGR_ProductoCategoria ESGR_ProductoCategoria)
 {
     await Task.Factory.StartNew(() =>
     {
         try
         {
             CollectionESGR_ProductoSubCategoria.Source = new BSGR_ProductoSubCategoria().GetCollectionProductoSubCategoria(ESGR_ProductoCategoria);
             Application.Current.Dispatcher.Invoke(() =>
             {
                 if (ESGR_Producto.Opcion == "I")
                 {
                     SelectESGR_ProductoSubCategoria = CollectionESGR_ProductoSubCategoria.FirstOrDefault();
                 }
                 else
                 {
                     SelectESGR_ProductoSubCategoria = CollectionESGR_ProductoSubCategoria.FirstOrDefault(x => x.IdSubCategoria == ESGR_Producto.ESGR_ProductoSubCategoria.IdSubCategoria);
                 }
             });
         }
         catch (Exception ex)
         {
             CmpMessageBox.Show(SGRMessage.AdministratorProducto, ex.Message, CmpButton.Aceptar);
         }
     });
 }
 private async void MethodLoadSubCategoría(ESGR_ProductoCategoria ESGR_ProductoCategoria)
 {
     await Task.Factory.StartNew(() =>
     {
         CollectionESGR_ProductoSubCategoria.Source = new BSGR_ProductoSubCategoria().GetCollectionProductoSubCategoriaCartaDia(ESGR_ProductoCategoria);
         SelectedESGR_ProductoSubCategoria          = CollectionESGR_ProductoSubCategoria.FirstOrDefault();
     });
 }
 private async void MethodLoadSubCategoria(ESGR_ProductoCategoria ESGR_ProductoCategoria)
 {
     await Task.Factory.StartNew(() =>
     {
         try
         {
             PropertyMetroProgressBarSubCategoria       = true;
             CollectionESGR_ProductoSubCategoria.Source = new BSGR_ProductoSubCategoria().GetCollectionProductoSubCategoria(ESGR_ProductoCategoria);
             PropertyMetroProgressBarSubCategoria       = false;
         }
         catch (Exception ex)
         {
             CmpMessageBox.Show(SGRMessage.AdministratorCartaDia, ex.Message, CmpButton.Aceptar);
         }
     });
 }
 /// <summary>
 /// Insertar, Editar y Eliminar Producto Categoria
 /// </summary>
 /// <param name="ESGR_ProductoCategoria">Objecto de la Entidad Producto Categoria</param>
 public void TransProductoCategoria(ESGR_ProductoCategoria ESGR_ProductoCategoria)
 {
     try
     {
         var objCmpSql = new CmpSql(SGRVariables.ConectionString);
         objCmpSql.CommandProcedure("spSGR_SET_ProductoCategoria");
         objCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, ESGR_ProductoCategoria.Opcion);
         objCmpSql.AddParameter("@IdCategoria", SqlDbType.SmallInt, ESGR_ProductoCategoria.IdCategoria);
         objCmpSql.AddParameter("@Categoria", SqlDbType.VarChar, ESGR_ProductoCategoria.Categoria);
         objCmpSql.AddParameter("@Impresora", SqlDbType.VarChar, ESGR_ProductoCategoria.Impresora);
         objCmpSql.AddParameter("@ValidaStock", SqlDbType.Bit, ESGR_ProductoCategoria.ValidaStock);
         objCmpSql.ExecuteNonQuery();
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 6
0
 public void MethodLoadSubCategoria(ESGR_ProductoCategoria ESGR_ProductoCategoria)
 {
     try
     {
         Collection_SubCategoria.Source = new BSGR_ProductoSubCategoria().GetCollectionProductoSubCategoria(ESGR_ProductoCategoria);
         Collection_SubCategoria.Add(new ESGR_ProductoSubCategoria
         {
             IdSubCategoria         = 0,
             SubCategoria           = "TODOS",
             ESGR_ProductoCategoria = ESGR_ProductoCategoria,
         });
         SelectESGR_ProductoSubCategoria = Collection_SubCategoria.FirstOrDefault(x => x.IdSubCategoria == 0);
     }
     catch (Exception ex)
     {
         CmpMessageBox.Show(SGRMessage.AdministratorProducto, ex.Message, CmpButton.Aceptar);
     }
 }
 private async void MethodLoadDetails()
 {
     try
     {
         await Task.Factory.StartNew(() =>
         {
             if (SelectedESGR_ProductoCategoria == null)
             {
                 SelectedESGR_ProductoCategoria = new ESGR_ProductoCategoria();
             }
             if (SelectedESGR_ProductoSubCategoria == null)
             {
                 SelectedESGR_ProductoSubCategoria = new ESGR_ProductoSubCategoria();
             }
             CollectionESGR_ListadoPedidoAnulado.Source = new BSGR_ListadoPedidoAnulado().CollectionESGR_ListadoPedidoAnulado(SelectedESGR_ProductoCategoria.IdCategoria, SelectedESGR_ProductoSubCategoria.IdSubCategoria, ESGR_Producto.IdProducto, SelectedFechaInicio, SelectedFechaFin, ESGR_Usuario.IdUsuario);
         });
     }
     catch (Exception ex)
     {
         CmpMessageBox.Show(SGRMessage.ListadoPedidoAnulado, ex.Message, CmpButton.Aceptar);
     }
 }
 private async void MethodLoadSubCategoria(ESGR_ProductoCategoria ESGR_ProductoCategoria)
 {
     await Task.Factory.StartNew(() =>
     {
         try
         {
             CollectionESGR_ProductoSubCategoria.Source = new BSGR_ProductoSubCategoria().GetCollectionProductoSubCategoria(ESGR_ProductoCategoria);
             Application.Current.Dispatcher.Invoke(() =>
             {
                 CollectionESGR_ProductoSubCategoria.Add(new ESGR_ProductoSubCategoria()
                 {
                     IdSubCategoria = 0, SubCategoria = "TODOS"
                 });
             });
             SelectedESGR_ProductoSubCategoria = CollectionESGR_ProductoSubCategoria.FirstOrDefault(x => x.IdSubCategoria == 0);
         }
         catch (Exception ex)
         {
             CmpMessageBox.Show(SGRMessage.ListadoVentaDia, ex.Message, CmpButton.Aceptar);
         }
     });
 }
Ejemplo n.º 9
0
 private async void MethodLoadProductoSubCategoria(ESGR_ProductoCategoria ESGR_ProductoCategoria)
 {
     await Task.Factory.StartNew(() =>
     {
         try
         {
             CollectionESGR_ProductoSubCategoria.Source = new BSGR_ProductoSubCategoria().GetCollectionProductoSubCategoriaCartaDia(ESGR_ProductoCategoria);
             SelectedESGR_ProductoSubCategoria          = CollectionESGR_ProductoSubCategoria.FirstOrDefault();
             if (CollectionESGR_ProductoSubCategoria.Count == 1 && SelectedESGR_ProductoSubCategoria.SubCategoria == "NINGUNA")
             {
                 PropertyVisibilitySubCategoria = Visibility.Collapsed;
             }
             else
             {
                 PropertyVisibilitySubCategoria = Visibility.Visible;
             }
         }
         catch (Exception ex)
         {
             CmpMessageBox.Show(SGRMessage.AdministratorVenta, ex.Message, CmpButton.Aceptar);
         }
     });
 }
Ejemplo n.º 10
0
        public CmpObservableCollection <ESGR_ProductoSubCategoria> GetCollectionProductoSubCategoriaCartaDia(ESGR_ProductoCategoria ESGR_ProductoCategoria)
        {
            try
            {
                var objCmpSql = new CmpSql(SGRVariables.ConectionString);
                var CollectionProductoSubCategoriaCartaDia = new CmpObservableCollection <ESGR_ProductoSubCategoria>();

                objCmpSql.CommandProcedure("spSGR_GET_BusquedaGeneral");
                objCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, "GetCartaDiaSubCatProducto");
                objCmpSql.AddParameter("@Filtro", SqlDbType.VarChar, "%");
                objCmpSql.AddParameter("@ParameterId", SqlDbType.Int, ESGR_ProductoCategoria.IdCategoria);
                DataTable dt = objCmpSql.ExecuteDataTable();

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    CollectionProductoSubCategoriaCartaDia.Add(new ESGR_ProductoSubCategoria
                    {
                        IdSubCategoria         = (dt.Rows[x]["IdSubCategoria"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdSubCategoria"]) : Convert.ToInt16(0),
                        SubCategoria           = (dt.Rows[x]["SubCategoria"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["SubCategoria"]) : string.Empty,
                        ESGR_ProductoCategoria = new ESGR_ProductoCategoria()
                        {
                            IdCategoria = (dt.Rows[x]["IdCategoria"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdCategoria"]) : Convert.ToInt16(0),
                        },
                    });
                }

                return(CollectionProductoSubCategoriaCartaDia);
            }

            catch (Exception)
            {
                throw;
            }
        }