/// <summary>
        /// Lista de Perfil
        /// </summary>
        /// <returns>Colección de los Perfiles</returns>
        public CmpObservableCollection <ESGR_Perfil> GetCollectionPerfil()
        {
            try
            {
                var objCmpSql        = new CmpSql(SGRVariables.ConectionString);
                var CollectionPerfil = new CmpObservableCollection <ESGR_Perfil>();

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

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    CollectionPerfil.Add(new ESGR_Perfil
                    {
                        IdPerfil     = (dt.Rows[x]["IdPerfil"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdPerfil"]) : Convert.ToInt16(0),
                        Descripcion  = (dt.Rows[x]["Descripcion"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Descripcion"]) : string.Empty,
                        NombrePerfil = (dt.Rows[x]["NombrePerfil"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["NombrePerfil"]) : string.Empty,
                        ESGR_Modulo  = new ESGR_Modulo()
                        {
                            IdModulo = (dt.Rows[x]["IdModulo"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdModulo"]) : Convert.ToInt16(0),
                        },
                    });
                }

                return(CollectionPerfil);
            }

            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Lista de Tipo Cambio
        /// </summary>
        /// <returns>Colección de los Tipo Cambio</returns>
        public CmpObservableCollection <ESGR_TipoCambio> GetCollectionTipoCambio()
        {
            try
            {
                var objCmpSql            = new CmpSql(SGRVariables.ConectionString);
                var CollectionTipoCambio = new CmpObservableCollection <ESGR_TipoCambio>();

                objCmpSql.CommandProcedure("spSGR_GET_BusquedaGeneral");
                objCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, "GetTipoCambio");
                objCmpSql.AddParameter("@Filtro", SqlDbType.VarChar, "");
                objCmpSql.AddParameter("@ParameterId", SqlDbType.VarChar, "");
                DataTable dt = objCmpSql.ExecuteDataTable();

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    CollectionTipoCambio.Add(new ESGR_TipoCambio
                    {
                        ESGR_Moneda = new ESGR_Moneda()
                        {
                            CodMoneda = (dt.Rows[x]["CodMoneda"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["CodMoneda"]) : string.Empty,
                        },
                        SelRate  = (dt.Rows[x]["SelRate"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["SelRate"]) : Convert.ToDecimal(0),
                        BuyRate  = (dt.Rows[x]["BuyRate"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["BuyRate"]) : Convert.ToDecimal(0),
                        FechaTcb = (dt.Rows[x]["FechaTcb"] != DBNull.Value) ? Convert.ToDateTime(dt.Rows[x]["FechaTcb"]) : DateTime.Now,
                    });
                }

                return(CollectionTipoCambio);
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 3
0
 public CmpObservableCollection <ESGR_Documento> CollectionESGR_DocumentoSerieNumero()
 {
     try
     {
         var ObjCmpSql = new CmpSql(SGRVariables.ConectionString);
         var CollectionESGR_DocumentoSerie = new CmpObservableCollection <ESGR_Documento>();
         ObjCmpSql.CommandProcedure("spSGR_GET_BusquedaGeneral");
         ObjCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, "GetEmpSucursalDocumentoSerie");
         ObjCmpSql.AddParameter("@Filtro", SqlDbType.VarChar, "");
         ObjCmpSql.AddParameter("@ParameterId", SqlDbType.Int, 1);
         DataTable dt = ObjCmpSql.ExecuteDataTable();
         for (int x = 0; x < dt.Rows.Count; x++)
         {
             CollectionESGR_DocumentoSerie.Add(new ESGR_Documento
             {
                 ESGR_EmpresaSucursal = new ESGR_EmpresaSucursal
                 {
                     IdEmpSucursal = (dt.Rows[x]["IdEmpSucursal"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdEmpSucursal"]) : Convert.ToInt16(0),
                 },
                 CodDocumento = (dt.Rows[x]["CodDocumento"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["CodDocumento"]) : string.Empty,
                 Correlativo  = (dt.Rows[x]["Correlativo"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Correlativo"]) : string.Empty,
                 Descripcion  = (dt.Rows[x]["Descripcion"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Descripcion"]) : string.Empty,
                 Longitud     = (dt.Rows[x]["Longitud"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["Longitud"]) : Convert.ToInt16(0),
                 Serie        = (dt.Rows[x]["Serie"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Serie"]) : string.Empty,
                 Sunat        = (dt.Rows[x]["Sunat"] != DBNull.Value) ? Convert.ToBoolean(dt.Rows[x]["Sunat"]) : false,
             });
         }
         return(CollectionESGR_DocumentoSerie);
     }
     catch (Exception)
     {
         throw;
     }
 }
        /// <summary>
        /// Lista de Estado
        /// </summary>
        /// <returns>Colección de Estado</returns>
        public CmpObservableCollection <ESGR_Estado> GetCollectionEstado(string Filtro = "%")
        {
            try
            {
                var objCmpSql        = new CmpSql(SGRVariables.ConectionString);
                var CollectionEstado = new CmpObservableCollection <ESGR_Estado>();

                objCmpSql.CommandProcedure("spSGR_GET_BusquedaGeneral");
                objCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, "FiltrarEstado");
                objCmpSql.AddParameter("@Filtro", SqlDbType.VarChar, (Filtro == null || Filtro.Trim().Length == 0) ? "%" : Filtro);
                objCmpSql.AddParameter("@ParameterId", SqlDbType.Int, 0);
                DataTable dt = objCmpSql.ExecuteDataTable();

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    CollectionEstado.Add(new ESGR_Estado
                    {
                        CodEstado = (dt.Rows[x]["CodEstado"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["CodEstado"]) : string.Empty,
                        Campo     = (dt.Rows[x]["Campo"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Campo"]) : string.Empty,
                        Estado    = (dt.Rows[x]["Estado"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Estado"]) : string.Empty,
                        Tabla     = (dt.Rows[x]["Tabla"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Tabla"]) : string.Empty,
                    });
                }

                return(CollectionEstado);
            }

            catch (Exception)
            {
                throw;
            }
        }
        public CmpObservableCollection <ESGR_Venta> GetTotalPorPedido(int ParameterId)
        {
            try
            {
                var objCmpSql       = new CmpSql(SGRVariables.ConectionString);
                var CollectionVenta = new CmpObservableCollection <ESGR_Venta>();

                objCmpSql.CommandProcedure("spSGR_GET_BusquedaGeneral");
                objCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, "GetTotalPedido");
                objCmpSql.AddParameter("@Filtro", SqlDbType.VarChar, "%");
                objCmpSql.AddParameter("@ParameterId", SqlDbType.VarChar, ParameterId);
                DataTable dt = objCmpSql.ExecuteDataTable();
                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    CollectionVenta.Add(new ESGR_Venta()
                    {
                        ESGR_Pedido = new ESGR_Pedido()
                        {
                            IdPedido = (dt.Rows[x]["IdPedido"] != DBNull.Value) ? Convert.ToInt32(dt.Rows[x]["IdPedido"]) : 0,
                            Cubierto = (dt.Rows[x]["Cubierto"] != DBNull.Value) ? (short)Convert.ToInt32(dt.Rows[x]["Cubierto"]) : (short)0
                        }
                    });
                }

                return(CollectionVenta);
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 6
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;
            }
        }
Esempio n. 7
0
        /// <summary>
        /// Lista de Empresa Sucursal
        /// </summary>
        /// <returns>Colección de Empresa Sucursal</returns>
        public CmpObservableCollection <ESGR_EmpresaSucursal> GetCollectionEmpresaSucursal(ESGR_Empresa ESGR_Empresa)
        {
            try
            {
                var objCmpSql = new CmpSql(SGRVariables.ConectionString);
                var CollectionEmpresaSucursal = new CmpObservableCollection <ESGR_EmpresaSucursal>();

                objCmpSql.CommandProcedure("spSGR_GET_BusquedaGeneral");
                objCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, "GetEmpSucursal");
                objCmpSql.AddParameter("@Filtro", SqlDbType.VarChar, "");
                objCmpSql.AddParameter("@ParameterId", SqlDbType.Int, ESGR_Empresa.IdEmpresa);
                DataTable dt = objCmpSql.ExecuteDataTable();

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    CollectionEmpresaSucursal.Add(new ESGR_EmpresaSucursal
                    {
                        IdEmpSucursal = (dt.Rows[x]["IdEmpSucursal"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdEmpSucursal"]) : Convert.ToInt16(0),
                        Principal     = (dt.Rows[x]["Principal"] != DBNull.Value) ? Convert.ToBoolean(dt.Rows[x]["Principal"]) : false,
                        Sucursal      = (dt.Rows[x]["Sucursal"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Sucursal"]) : string.Empty,
                        ESGR_Empresa  = new ESGR_Empresa()
                        {
                            IdEmpresa = (dt.Rows[x]["IdEmpresa"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdEmpresa"]) : Convert.ToInt16(0),
                        },
                    });
                }

                return(CollectionEmpresaSucursal);
            }

            catch (Exception)
            {
                throw;
            }
        }
        /// <summary>
        /// Lista de Reporte por Estado
        /// </summary>
        /// <returns>Colección de Reporte por Estado</returns>
        public CmpObservableCollection <ESGR_Estado> GetReportCollectionEstado(int ParameterId)
        {
            try
            {
                var objCmpSql        = new CmpSql(SGRVariables.ConectionString);
                var CollectionEstado = new CmpObservableCollection <ESGR_Estado>();

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

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    CollectionEstado.Add(new ESGR_Estado
                    {
                        CodEstado = (dt.Rows[x]["CodEstado"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["CodEstado"]) : string.Empty,
                        Estado    = (dt.Rows[x]["Estado"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Estado"]) : string.Empty,
                        Total     = (dt.Rows[x]["Total"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["Total"]) : 0
                    });
                }

                return(CollectionEstado);
            }

            catch (Exception)
            {
                throw;
            }
        }
        /// <summary>
        /// Lista de Carta Dia
        /// </summary>
        /// <returns>Colección de las Cartas Dia</returns>
        public CmpObservableCollection <ESGR_CartaDia> CollectionCartaDia()
        {
            try
            {
                var objCmpSql          = new CmpSql(SGRVariables.ConectionString);
                var CollectionCartaDia = new CmpObservableCollection <ESGR_CartaDia>();

                objCmpSql.CommandProcedure("spSGR_GET_BusquedaGeneral");
                objCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, "FiltrarCartaDiaSucursal");
                objCmpSql.AddParameter("@Filtro", SqlDbType.VarChar, "");
                objCmpSql.AddParameter("@ParameterId", SqlDbType.Int, 0);
                DataTable dt = objCmpSql.ExecuteDataTable();

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    CollectionCartaDia.Add(new ESGR_CartaDia
                    {
                        IdCartaDia           = (dt.Rows[x]["IdCartaDia"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdCartaDia"]) : Convert.ToInt16(0),
                        Fecha                = (dt.Rows[x]["Fecha"] != DBNull.Value) ? Convert.ToDateTime(dt.Rows[x]["Fecha"]) : DateTime.Now,
                        ESGR_EmpresaSucursal = new ESGR_EmpresaSucursal()
                        {
                            IdEmpSucursal = (dt.Rows[x]["IdEmpSucursal"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdEmpSucursal"]) : Convert.ToInt16(0),
                            Sucursal      = (dt.Rows[x]["Sucursal"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Sucursal"]) : string.Empty
                        },
                    });
                }
                return(CollectionCartaDia);
            }

            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 10
0
        public List <ECMP_Compra> ListAdministrarCompraAnticipo(ECMP_Compra ObjECMP_Compra)
        {
            try
            {
                objCmpSql       = new CmpSql(SGCVariables.ConectionString);
                ListECMP_Compra = new List <ECMP_Compra>();
                objCmpSql.CommandProcedure("spCMP_GET_BusquedaGeneral");
                objCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, "FiltrarCompraAnticipo");
                objCmpSql.AddParameter("@Filtro", SqlDbType.VarChar, ObjECMP_Compra.IdCompra);

                DataTable dt = objCmpSql.ExecuteDataTable();

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    ListECMP_Compra.Add(new ECMP_Compra()
                    {
                        IdCompra       = (dt.Rows[x]["IdCompraAnticipo"] != DBNull.Value) ? Convert.ToInt32(dt.Rows[x]["IdCompraAnticipo"]) : 0,
                        Fecha          = (dt.Rows[x]["Fecha"] != DBNull.Value) ? Convert.ToDateTime(dt.Rows[x]["Fecha"]) : DateTime.Now,
                        Descripcion    = (dt.Rows[x]["Descripcion"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Descripcion"]) : string.Empty,
                        SerieNumero    = (dt.Rows[x]["SerieNumero"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["SerieNumero"]) : string.Empty,
                        ObjESGC_Estado = new ESGC_Estado()
                        {
                            Estado = (dt.Rows[x]["Estado"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Estado"]) : string.Empty,
                        }
                    });
                }

                return(ListECMP_Compra);
            }

            catch (Exception)
            {
                throw;
            }
        }
        /// <summary>
        /// Lista de Mesa Area
        /// </summary>
        /// <returns>Colección de Mesa Area</returns>
        public CmpObservableCollection <ESGR_MesaArea> GetCollectionMesaArea()
        {
            try
            {
                var objCmpSql          = new CmpSql(SGRVariables.ConectionString);
                var CollectionMesaArea = new CmpObservableCollection <ESGR_MesaArea>();

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

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    CollectionMesaArea.Add(new ESGR_MesaArea
                    {
                        IdMesaArea = (dt.Rows[x]["IdMesaArea"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdMesaArea"]) : Convert.ToInt16(0),
                        MesaArea   = (dt.Rows[x]["MesaArea"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["MesaArea"]) : string.Empty,
                    });
                }

                return(CollectionMesaArea);
            }

            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 12
0
        /// <summary>
        /// Lista de Moneda
        /// </summary>
        /// <returns>Colección de Moneda</returns>
        public CmpObservableCollection <ESGR_Moneda> GetCollectionMoneda()
        {
            try
            {
                var objCmpSql        = new CmpSql(SGRVariables.ConectionString);
                var CollectionMoneda = new CmpObservableCollection <ESGR_Moneda>();

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

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    CollectionMoneda.Add(new ESGR_Moneda
                    {
                        Abreviacion = (dt.Rows[x]["Abreviacion"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Abreviacion"]) : string.Empty,
                        CodMoneda   = (dt.Rows[x]["CodMoneda"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["CodMoneda"]) : string.Empty,
                        Defecto     = (dt.Rows[x]["Defecto"] != DBNull.Value) ? Convert.ToBoolean(dt.Rows[x]["Defecto"]) : false,
                        Descripcion = (dt.Rows[x]["Descripcion"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Descripcion"]) : string.Empty,
                        Simbolo     = (dt.Rows[x]["Simbolo"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Simbolo"]) : string.Empty,
                    });
                }

                return(CollectionMoneda);
            }

            catch (Exception)
            {
                throw;
            }
        }
        /// <summary>
        /// Lista de Forma Pago
        /// </summary>
        /// <returns>Colección de Forma Pago</returns>
        public CmpObservableCollection <ESGR_FormaPago> GetCollectionFormaPago()
        {
            try
            {
                var objCmpSql           = new CmpSql(SGRVariables.ConectionString);
                var CollectionFormaPago = new CmpObservableCollection <ESGR_FormaPago>();

                objCmpSql.CommandProcedure("spSGR_GET_BusquedaGeneral");
                objCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, "GetFormaPago");
                objCmpSql.AddParameter("@Filtro", SqlDbType.VarChar, "");
                objCmpSql.AddParameter("@ParameterId", SqlDbType.Int, SGRVariables.ESGR_Usuario.ESGR_Empresa.IdEmpresa);
                DataTable dt = objCmpSql.ExecuteDataTable();

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    CollectionFormaPago.Add(new ESGR_FormaPago
                    {
                        IdFormaPago  = (dt.Rows[x]["IdFormaPago"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdFormaPago"]) : Convert.ToInt16(0),
                        FormaPago    = (dt.Rows[x]["FormaPago"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["FormaPago"]) : string.Empty,
                        ESGR_Empresa = new ESGR_Empresa()
                        {
                            IdEmpresa = (dt.Rows[x]["IdEmpresa"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdEmpresa"]) : Convert.ToInt16(0),
                        },
                    });
                }

                return(CollectionFormaPago);
            }

            catch (Exception)
            {
                throw;
            }
        }
        /// <summary>
        /// Lista de Producto Categoria
        /// </summary>
        /// <returns>Colección de los Producto Categoria</returns>
        public CmpObservableCollection <ESGR_ProductoCategoria> GetCollectionProductoCategoria(string Filtro = "%")
        {
            try
            {
                var objCmpSql = new CmpSql(SGRVariables.ConectionString);
                var CollectionProductoCategoria = new CmpObservableCollection <ESGR_ProductoCategoria>();

                objCmpSql.CommandProcedure("spSGR_GET_BusquedaGeneral");
                objCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, "GetCategoria");
                objCmpSql.AddParameter("@Filtro", SqlDbType.VarChar, (Filtro == string.Empty || Filtro == null) ? "%" : Filtro);
                objCmpSql.AddParameter("@ParameterId", SqlDbType.Int, 0);
                DataTable dt = objCmpSql.ExecuteDataTable();

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    CollectionProductoCategoria.Add(new ESGR_ProductoCategoria
                    {
                        IdCategoria = (dt.Rows[x]["IdCategoria"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdCategoria"]) : Convert.ToInt16(0),
                        Categoria   = (dt.Rows[x]["Categoria"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Categoria"]) : string.Empty,
                        Impresora   = (dt.Rows[x]["Impresora"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Impresora"]) : string.Empty,
                        ValidaStock = (dt.Rows[x]["ValidaStock"] != DBNull.Value) ? Convert.ToBoolean(dt.Rows[x]["ValidaStock"]) : false,
                    });
                }

                return(CollectionProductoCategoria);
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 15
0
        /// <summary>
        /// Lista de Venta Detalle
        /// </summary>-
        /// <returns>Colección de las Venta Detalle</returns>
        public CmpObservableCollection <ESGR_VentaDetalle> GetCollectionVentaDetalle(int ParameterId, string Filtro = "%")
        {
            try
            {
                var objCmpSql = new CmpSql(SGRVariables.ConectionString);
                var CollectionVentaDetalle = new CmpObservableCollection <ESGR_VentaDetalle>();

                objCmpSql.CommandProcedure("spSGR_GET_BusquedaGeneral");
                objCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, "GetVentaDetalle");
                objCmpSql.AddParameter("@Filtro", SqlDbType.VarChar, (Filtro != null || Filtro.Trim().Length == 0) ? Filtro : "%");
                objCmpSql.AddParameter("@ParameterId", SqlDbType.Int, ParameterId);
                DataTable dt = objCmpSql.ExecuteDataTable();

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    CollectionVentaDetalle.Add(new ESGR_VentaDetalle
                    {
                        Item             = (dt.Rows[x]["Item"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["Item"]) : Convert.ToInt16(0),
                        ESGR_VentaCuenta = new ESGR_VentaCuenta()
                        {
                            IdCuenta   = (dt.Rows[x]["IdCuenta"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdCuenta"]) : Convert.ToInt16(0),
                            Adicional  = (dt.Rows[x]["Adicional"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["Adicional"]) : 0m,
                            Descuento  = (dt.Rows[x]["Descuento"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["Descuento"]) : 0m,
                            ESGR_Venta = new ESGR_Venta()
                            {
                                IdVenta = (dt.Rows[x]["IdVenta"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdVenta"]) : Convert.ToInt16(0),
                                Fecha   = (dt.Rows[x]["Fecha"] != DBNull.Value) ? Convert.ToDateTime(dt.Rows[x]["Fecha"]) : DateTime.Now
                            },
                            ESGR_MedioPago = new ESGR_MedioPago()
                            {
                                IdMedioPago = (dt.Rows[x]["IdMedioPago"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdMedioPago"]) : Convert.ToInt16(0),
                            },
                            ESGR_Moneda = new ESGR_Moneda()
                            {
                                CodMoneda = (dt.Rows[x]["CodMoneda"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["CodMoneda"]) : string.Empty,
                            }
                        },
                        CantidadPagar = (dt.Rows[x]["Cantidad"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["Cantidad"]) : Convert.ToInt16(0),
                        Descuento     = (dt.Rows[x]["Descuento"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["Descuento"]) : Convert.ToDecimal(0),
                        Importe       = (dt.Rows[x]["Importe"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["Importe"]) : Convert.ToDecimal(0),
                        Precio        = (dt.Rows[x]["Precio"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["Precio"]) : Convert.ToDecimal(0),
                        ESGR_Producto = new ESGR_Producto()
                        {
                            IdProducto = (dt.Rows[x]["IdProducto"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdProducto"]) : Convert.ToInt16(0),
                            Producto   = (dt.Rows[x]["Producto"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Producto"]) : string.Empty,
                            Precio     = (dt.Rows[x]["Precio"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["Precio"]) : Convert.ToDecimal(0)
                        },
                    });
                }

                return(CollectionVentaDetalle);
            }

            catch (Exception)
            {
                throw;
            }
        }
        /// <summary>
        /// Lista de Pedido
        /// </summary>
        /// <returns>Colección de las Pedido</returns>
        public CmpObservableCollection <ESGR_Pedido> GetCollectionPedido()
        {
            try
            {
                var objCmpSql        = new CmpSql(SGRVariables.ConectionString);
                var CollectionPedido = new CmpObservableCollection <ESGR_Pedido>();

                objCmpSql.CommandProcedure("spSGR_GET_BusquedaGeneral");
                objCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, "FiltrarPedidoUsuario");
                objCmpSql.AddParameter("@Filtro", SqlDbType.VarChar, "%");
                objCmpSql.AddParameter("@ParameterId", SqlDbType.Int, SGRVariables.ESGR_Usuario.IdUsuario);
                DataTable dt = objCmpSql.ExecuteDataTable();

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    CollectionPedido.Add(new ESGR_Pedido
                    {
                        IdPedido        = (dt.Rows[x]["IdPedido"] != DBNull.Value) ? Convert.ToInt32(dt.Rows[x]["IdPedido"]) : Convert.ToInt32(0),
                        ESGR_PedidoTipo = new ESGR_PedidoTipo()
                        {
                            IdPedidoTipo = (dt.Rows[x]["IdPedidoTipo"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdPedidoTipo"]) : Convert.ToInt16(0),
                            PedidoTipo   = (dt.Rows[x]["PedidoTipo"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["PedidoTipo"]) : string.Empty,
                        },
                        ESGR_EmpresaSucursal = new ESGR_EmpresaSucursal()
                        {
                            IdEmpSucursal = (dt.Rows[x]["IdEmpSucursal"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdEmpSucursal"]) : Convert.ToInt16(0),
                        },
                        ESGR_Usuario = new ESGR_Usuario()
                        {
                            IdUsuario   = (dt.Rows[x]["IdUsuarioPedido"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdUsuarioPedido"]) : Convert.ToInt16(0),
                            Nombres     = (dt.Rows[x]["Nombres"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Nombres"]) : string.Empty,
                            Apellidos   = (dt.Rows[x]["Apellidos"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Apellidos"]) : string.Empty,
                            ESGR_Perfil = new ESGR_Perfil()
                            {
                                IdPerfil     = (dt.Rows[x]["IdPerfil"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdPerfil"]) : Convert.ToInt16(0),
                                NombrePerfil = (dt.Rows[x]["NombrePerfil"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["NombrePerfil"]) : string.Empty
                            }
                        },
                        ESGR_Estado = new ESGR_Estado()
                        {
                            CodEstado = (dt.Rows[x]["CodEstado"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["CodEstado"]) : string.Empty,
                            Estado    = (dt.Rows[x]["Estado"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Estado"]) : string.Empty,
                        },
                        Identificador = (dt.Rows[x]["Identificador"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Identificador"]).Trim() : string.Empty,
                        CadenaMesa    = (dt.Rows[x]["CadenaMesa"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["CadenaMesa"]).Trim() : string.Empty,
                        Cubierto      = (dt.Rows[x]["Cubierto"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["Cubierto"]) : Convert.ToInt16(0),
                    });
                }

                return(CollectionPedido);
            }

            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 17
0
        /// <summary>
        /// Lista de Usuario
        /// </summary>
        /// <returns>Colección de los Usuarios</returns>
        public CmpObservableCollection <ESGR_Usuario> GetCollectionUsuario(string Filtro = "%")
        {
            try
            {
                var objCmpSql         = new CmpSql(SGRVariables.ConectionString);
                var CollectionUsuario = new CmpObservableCollection <ESGR_Usuario>();

                objCmpSql.CommandProcedure("spSGR_GET_BusquedaGeneral");
                objCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, "GetUsuario");
                objCmpSql.AddParameter("@Filtro", SqlDbType.VarChar, (Filtro == string.Empty) ? "%" : Filtro);
                objCmpSql.AddParameter("@ParameterId", SqlDbType.Int, 0);
                DataTable dt = objCmpSql.ExecuteDataTable();

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    CollectionUsuario.Add(new ESGR_Usuario
                    {
                        IdUsuario    = (dt.Rows[x]["IdUsuario"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdUsuario"]) : Convert.ToInt16(0),
                        Apellidos    = (dt.Rows[x]["Apellidos"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Apellidos"]) : string.Empty,
                        Contrasenia  = (dt.Rows[x]["Contrasenia"] != DBNull.Value) ? CmpCifrarObjecto.Desencriptar(Convert.ToString(dt.Rows[x]["Contrasenia"])) : "ysr260915",
                        Correo       = (dt.Rows[x]["Correo"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Correo"]) : string.Empty,
                        Nick         = (dt.Rows[x]["Nick"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Nick"]) : string.Empty,
                        Estado       = (dt.Rows[x]["Estado"] != DBNull.Value) ? Convert.ToByte(dt.Rows[x]["Estado"]) : Convert.ToByte(0),
                        Nombres      = (dt.Rows[x]["Nombres"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Nombres"]) : string.Empty,
                        Usuario      = (dt.Rows[x]["Usuario"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Usuario"]) : string.Empty,
                        Fallido      = (dt.Rows[x]["Fallido"] != DBNull.Value) ? Convert.ToByte(dt.Rows[x]["Fallido"]) : Convert.ToByte(0),
                        FlgConectado = (dt.Rows[x]["FlgConectado"] != DBNull.Value) ? Convert.ToBoolean(dt.Rows[x]["FlgConectado"]) : false,
                        FlgEliminado = (dt.Rows[x]["FlgEliminado"] != DBNull.Value) ? Convert.ToBoolean(dt.Rows[x]["FlgEliminado"]) : false,
                        ESGR_Empresa = new ESGR_Empresa()
                        {
                            IdEmpresa       = (dt.Rows[x]["IdEmpresa"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdEmpresa"]) : Convert.ToInt16(0),
                            RazonSocial     = (dt.Rows[x]["RazonSocial"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["RazonSocial"]) : string.Empty,
                            Telefono        = (dt.Rows[x]["Telefono"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Telefono"]) : string.Empty,
                            Ruc             = (dt.Rows[x]["Ruc"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Ruc"]) : string.Empty,
                            DireccionFiscal = (dt.Rows[x]["DireccionFiscal"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["DireccionFiscal"]) : string.Empty
                        },
                        ESGR_EmpresaSucursal = new ESGR_EmpresaSucursal()
                        {
                            IdEmpSucursal = (dt.Rows[x]["IdEmpSucursal"] != DBNull.Value) ? (short)Convert.ToInt32(dt.Rows[x]["IdEmpSucursal"]) : (short)0
                        },
                        ESGR_Perfil = new ESGR_Perfil()
                        {
                            IdPerfil     = (dt.Rows[x]["IdPerfil"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdPerfil"]) : Convert.ToInt16(0),
                            NombrePerfil = (dt.Rows[x]["NombrePerfil"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["NombrePerfil"]) : string.Empty,
                        },
                    });
                }

                return(CollectionUsuario);
            }

            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 18
0
        /// <summary>
        /// Listado de Detalle de Orden de Compra
        /// </summary>
        /// <param name="ObjECMP_OrdenCompraDetalle">Objeto de la entidad ECMP_OrdenCompraDetalle</param>
        /// <returns>Lista deECMP_OrdenCompraDetalle </returns>
        public List <ECMP_OrdenCompraDetalle> ListAdministrarOrdenCompraDetalle(ECMP_OrdenCompra ObjECMP_OrdenCompra)
        {
            try
            {
                objCmpSql = new CmpSql(SGCVariables.ConectionString);
                ListECMP_OrdenCompraDetalle = new List <ECMP_OrdenCompraDetalle>();
                decimal dmlIGV = SGCVariables.ObjESGC_Retencion.IGV / 100;
                objCmpSql.CommandProcedure("spCMP_GET_BusquedaGeneral");
                objCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, "AdministrarOrdenCompraDetalle");
                objCmpSql.AddParameter("@Filtro", SqlDbType.VarChar, ObjECMP_OrdenCompra.IdOrdenCompra);

                DataTable dt = objCmpSql.ExecuteDataTable();

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    ListECMP_OrdenCompraDetalle.Add(new ECMP_OrdenCompraDetalle
                    {
                        ObjECMP_OrdenCompra = ObjECMP_OrdenCompra,
                        Item             = (dt.Rows[x][1] != DBNull.Value) ? Convert.ToInt32(dt.Rows[x][1]) : 0,
                        ObjEMNF_Articulo = new EMNF_Articulo
                        {
                            IdArticulo           = (dt.Rows[x][2] != DBNull.Value) ? Convert.ToInt32(dt.Rows[x][2]) : 0,
                            Articulo             = (dt.Rows[x][3] != DBNull.Value) ? Convert.ToString(dt.Rows[x][3]) : string.Empty,
                            Codigo               = (dt.Rows[x][4] != DBNull.Value) ? Convert.ToString(dt.Rows[x][4]) : string.Empty,
                            ObjEMNF_UnidadMedida = new EMNF_UnidadMedida
                            {
                                CodUndMedida = (dt.Rows[x][5] != DBNull.Value) ? Convert.ToString(dt.Rows[x][5]) : string.Empty,
                            },
                            ObjEMNF_OperacionIGV = new EMNF_OperacionIGV()
                            {
                                CodOperacionIGV = (dt.Rows[x][6] != DBNull.Value) ? Convert.ToString(dt.Rows[x][6]) : string.Empty,
                            }
                        },
                        PrecioUnitario     = (dt.Rows[x][7] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x][7]) : 0,
                        PrecioUnitarioTemp = (ObjECMP_OrdenCompra.IncluyeIGV) ? (((dt.Rows[x][7] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x][7]) : 0) * ((decimal.Round(dmlIGV * 100, 2) + 100) / 100)) : ((dt.Rows[x][7] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x][7]) : 0),
                        Cantidad           = (dt.Rows[x][8] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x][8]) : 0,
                        CantidadRecep      = (dt.Rows[x][9] != DBNull.Value) ? Convert.ToInt32(dt.Rows[x][9]) : 0,
                        ImporteIGV         = (dt.Rows[x][10] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x][10]) : 0,

                        ObjESGC_Estado = new ESGC_Estado
                        {
                            CodEstado = (dt.Rows[x][11] != DBNull.Value) ? Convert.ToString(dt.Rows[x][11]) : string.Empty,
                            Estado    = (dt.Rows[x][12] != DBNull.Value) ? Convert.ToString(dt.Rows[x][12]) : string.Empty
                        },
                        Provisionado = (dt.Rows[x]["Provisionado"] != DBNull.Value) ? Convert.ToUInt16(dt.Rows[x]["Provisionado"]) : uint.Parse("0")
                    });
                }

                return(ListECMP_OrdenCompraDetalle);
            }

            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 19
0
        public List <ECMP_DataMartixReport> ListArticuloListaPrecio_Preview(string IdCategoria, string IdSubCategoria, string IdMarca, string IdArticulo, string IdProveedor, string PeridoIni, string PeriodoFin)
        {
            ObjCmpSql = new CmpSql(SGCVariables.ConectionString);
            ObjCmpSql.CommandProcedure("spCMP_GET_ArticuloListaPrecio");
            ObjCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, "REPORTE");
            ObjCmpSql.AddParameter("@IdCategoria", SqlDbType.VarChar, (IdCategoria != "") ? IdCategoria : "0");
            ObjCmpSql.AddParameter("@IdUsuario", SqlDbType.VarChar, "0");
            ObjCmpSql.AddParameter("@IdSubCategoria", SqlDbType.VarChar, (IdSubCategoria != "") ? IdSubCategoria : "0");
            ObjCmpSql.AddParameter("@IdMarca", SqlDbType.VarChar, (IdMarca != "") ? IdMarca : "0");
            ObjCmpSql.AddParameter("@IdArticulo", SqlDbType.VarChar, (IdArticulo != "") ? IdArticulo : "0");
            ObjCmpSql.AddParameter("@IdCliProveedor", SqlDbType.VarChar, (IdProveedor != "") ? IdProveedor : "0");
            ObjCmpSql.AddParameter("@PeriodoIni", SqlDbType.Char, PeridoIni);
            ObjCmpSql.AddParameter("@PeriodoFin", SqlDbType.Char, PeriodoFin);
            DataTable dt   = ObjCmpSql.ExecuteDataTable();
            var       list = (from DataRow x in dt.Rows
                              select new ECMP_DataMartixReport
            {
                Codigo = (x["Código"] == DBNull.Value ? "" : x["Código"]).ToString(),
                Articulo = (x["Artículo"] == DBNull.Value ? "" : x["Artículo"]).ToString(),
                CodUndMedida = (x["Und. Medida"] == DBNull.Value ? "" : x["Und. Medida"]).ToString(),
                Marca = (x["Marca"] == DBNull.Value ? "" : x["Marca"]).ToString(),
                Categoria = (x["Categoría"] == DBNull.Value ? "" : x["Categoría"]).ToString(),
                SubCategoria = (x["Sub-Categoría"] == DBNull.Value ? "" : x["Sub-Categoría"]).ToString(),
                NroDocIdentidad = (x["RUC-DNI"] == DBNull.Value ? "" : x["RUC-DNI"]).ToString(),
                RazonSocial = (x["Razón Social"] == DBNull.Value ? "" : x["Razón Social"]).ToString(),
                CodMoneda = (x["Moneda"] == DBNull.Value ? "" : x["Moneda"]).ToString(),
                Periodo = (x["Periodo"] == DBNull.Value ? "" : x["Periodo"]).ToString(),
                Precio = Convert.ToDouble(x["Precio"] == DBNull.Value ? 0 : x["Precio"])
            }).ToList();

            return(list);
        }
Esempio n. 20
0
        /// <summary>
        /// Lista de Carta Dia Detalle
        /// </summary>
        /// <returns>Colección de las Cartas Dia Detalle</returns>
        public CmpObservableCollection <ESGR_CartaDiaDetalle> GetCollectionCartaDiaDetalle(ESGR_CartaDia ESGR_CartaDia)
        {
            try
            {
                var objCmpSql = new CmpSql(SGRVariables.ConectionString);
                var CollectionCartaDiaDetalle = new CmpObservableCollection <ESGR_CartaDiaDetalle>();

                objCmpSql.CommandProcedure("spSGR_GET_BusquedaGeneral");
                objCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, "FiltrarCartaDiaDetalle");
                objCmpSql.AddParameter("@Filtro", SqlDbType.VarChar, "");
                objCmpSql.AddParameter("@ParameterId", SqlDbType.Int, ESGR_CartaDia.IdCartaDia);
                DataTable dt = objCmpSql.ExecuteDataTable();

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    CollectionCartaDiaDetalle.Add(new ESGR_CartaDiaDetalle
                    {
                        IdCartaDia    = (dt.Rows[x]["IdCartaDia"] != DBNull.Value) ? Convert.ToInt32(dt.Rows[x]["IdCartaDia"]) : 0,
                        Item          = (dt.Rows[x]["Item"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["Item"]) : Convert.ToInt16(0),
                        Cantidad      = (dt.Rows[x]["Cantidad"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["Cantidad"]) : Convert.ToInt16(0),
                        TempCantidad  = (dt.Rows[x]["Cantidad"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["Cantidad"]) : Convert.ToInt16(0),
                        Precio        = (dt.Rows[x]["Precio"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["Precio"]) : 0,
                        Stock         = (dt.Rows[x]["Stock"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["Stock"]) : Convert.ToInt16(0),
                        TempStock     = (dt.Rows[x]["Stock"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["Stock"]) : Convert.ToInt16(0),
                        Observacion   = (dt.Rows[x]["Observacion"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Observacion"]) : string.Empty,
                        ESGR_CartaDia = new ESGR_CartaDia()
                        {
                            IdCartaDia = (dt.Rows[x]["IdCartaDia"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdCartaDia"]) : Convert.ToInt16(0),
                        },
                        ESGR_Producto = new ESGR_Producto()
                        {
                            IdProducto = (dt.Rows[x]["IdProducto"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdProducto"]) : Convert.ToInt16(0),
                            Producto   = (dt.Rows[x]["Producto"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Producto"]) : string.Empty,
                            ESGR_ProductoSubCategoria = new ESGR_ProductoSubCategoria()
                            {
                                IdSubCategoria         = (dt.Rows[x]["IdSubCategoria"] != DBNull.Value) ? Convert.ToInt32(dt.Rows[x]["IdSubCategoria"]) : 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.ToInt32(dt.Rows[x]["IdCategoria"]) : 0,
                                    Categoria   = (dt.Rows[x]["Categoria"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Categoria"]) : string.Empty,
                                }
                            }
                        },
                    });
                }
                return(CollectionCartaDiaDetalle);
            }

            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 21
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ObjECMP_ReporteGrlDocumento"></param>
        /// <returns></returns>
        public List <ECMP_ReporteGrlHonorario> ListReporteGrlHonorario(ECMP_ReporteGrlHonorario ObjECMP_ReporteGrlDocumento)
        {
            try
            {
                objCmpSql = new CmpSql(SGCVariables.ConectionString);
                ListECMP_ReporteGrlHonorario = new List <ECMP_ReporteGrlHonorario>();
                objCmpSql.CommandProcedure("spCMP_GET_ConsultaGralHonorario");
                objCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, ObjECMP_ReporteGrlDocumento.Opcion);
                objCmpSql.AddParameter("@Periodo", SqlDbType.Char, ObjECMP_ReporteGrlDocumento.Periodo);
                objCmpSql.AddParameter("@IdCliProveedor", SqlDbType.VarChar, ObjECMP_ReporteGrlDocumento.ObjEMNF_ClienteProveedor.IdCliProveedor);
                objCmpSql.AddParameter("@CodMoneda", SqlDbType.VarChar, ObjECMP_ReporteGrlDocumento.ObjESGC_Moneda.CodMoneda);
                objCmpSql.AddParameter("@IdUsuario", SqlDbType.VarChar, SGCVariables.ObjESGC_Usuario.IdUsuario);
                DataTable dt = objCmpSql.ExecuteDataTable();

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    ListECMP_ReporteGrlHonorario.Add(new ECMP_ReporteGrlHonorario()
                    {
                        FechaEmision      = (dt.Rows[x]["FechaEmision"] != DBNull.Value) ? Convert.ToDateTime(dt.Rows[x]["FechaEmision"]) : DateTime.Now,
                        FechaContable     = (dt.Rows[x]["FechaContable"] != DBNull.Value) ? Convert.ToDateTime(dt.Rows[x]["FechaContable"]) : DateTime.Now,
                        ObjESGC_Documento = new ESGC_Documento()
                        {
                            Descripcion = (dt.Rows[x]["Documento"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Documento"]) : string.Empty,
                        },
                        SerieNumero = (dt.Rows[x]["SerieNumero"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["SerieNumero"]) : string.Empty,
                        ObjEMNF_ClienteProveedor = new EMNF_ClienteProveedor()
                        {
                            RazonSocial     = (dt.Rows[x]["Proveedor"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Proveedor"]) : string.Empty,
                            NroDocIdentidad = (dt.Rows[x]["NroDocIdentidad"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["NroDocIdentidad"]) : string.Empty,
                        },
                        ObjESGC_Moneda = new ESGC_Moneda()
                        {
                            Descripcion = (dt.Rows[x]["Moneda"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Moneda"]) : string.Empty,
                        },
                        TipoCambio     = (dt.Rows[x]["TipoCambio"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["TipoCambio"]) : string.Empty,
                        FechaRecepcion = (dt.Rows[x]["FechaRecepcion"] != DBNull.Value) ? Convert.ToDateTime(dt.Rows[x]["FechaRecepcion"]) : DateTime.Now,
                        THonorario     = (dt.Rows[x]["TotalHonorario"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["TotalHonorario"]) : 0,
                        TotalNeto      = (dt.Rows[x]["Total"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["Total"]) : 0,
                        PRetencion     = (dt.Rows[x]["Retencion"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["Retencion"]) : 0,
                        MRetencion     = (dt.Rows[x]["ImpRetencion"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["ImpRetencion"]) : 0,
                        Glosa          = (dt.Rows[x]["Glosa"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Glosa"]) : string.Empty,
                        ObjESGC_Estado = new ESGC_Estado()
                        {
                            Estado = (dt.Rows[x]["Estado"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Estado"]) : string.Empty,
                        }
                    });
                }
                return(ListECMP_ReporteGrlHonorario);
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 22
0
        /// <summary>
        /// Listado de ObjBCMP_CompraDetalle
        /// </summary>
        /// <param name="ObjECMP_Compra">Objeto de la entidad ECMP_Compra</param>
        /// <returns>Lista ECMP_OrdenCompraDetalle </returns>
        public List <ECMP_CompraDetalle> ListAdministrarCompraDetalle(ECMP_Compra ObjECMP_Compra)
        {
            try
            {
                objCmpSql = new CmpSql(SGCVariables.ConectionString);
                ListECMP_CompraDetalle = new List <ECMP_CompraDetalle>();
                decimal dmlIGV = SGCVariables.ObjESGC_Retencion.IGV / 100;
                objCmpSql.CommandProcedure("spCMP_GET_BusquedaGeneral");
                objCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, "AdministrarCompraDetalle");
                objCmpSql.AddParameter("@Filtro", SqlDbType.VarChar, ObjECMP_Compra.IdCompra);

                DataTable dt = objCmpSql.ExecuteDataTable();

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    ECMP_CompraDetalle ObjECMP_CompraDetalle = new ECMP_CompraDetalle();
                    ObjECMP_CompraDetalle.ObjECMP_Compra     = ObjECMP_Compra;
                    ObjECMP_CompraDetalle.Item               = (dt.Rows[x]["Item"] != DBNull.Value) ? Convert.ToInt32(dt.Rows[x]["Item"]) : 0;
                    ObjECMP_CompraDetalle.IdArticuloServicio = (dt.Rows[x]["IdArticuloServicio"] != DBNull.Value) ? Convert.ToInt32(dt.Rows[x]["IdArticuloServicio"]) : 0;
                    ObjECMP_CompraDetalle.Codigo             = (dt.Rows[x]["Codigo"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Codigo"]) : string.Empty;
                    ObjECMP_CompraDetalle.ArticuloServicio   = (dt.Rows[x]["ArticuloServicio"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["ArticuloServicio"]) : string.Empty;
                    ObjECMP_CompraDetalle.TipoDetalle        = (dt.Rows[x]["TipoDetalle"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["TipoDetalle"]) : string.Empty;
                    ObjECMP_CompraDetalle.CodUndMedida       = (dt.Rows[x]["CodUndMedida"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["CodUndMedida"]) : string.Empty;
                    ObjECMP_CompraDetalle.Cantidad           = (dt.Rows[x]["Cantidad"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["Cantidad"]) : 0;
                    ObjECMP_CompraDetalle.PrecioUnitario     = (dt.Rows[x]["PrecioUnitario"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["PrecioUnitario"]) : 0;
                    ObjECMP_CompraDetalle.PrecioUnitarioTemp = (ObjECMP_Compra.IncluyeIGV) ? (((dt.Rows[x]["PrecioUnitario"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["PrecioUnitario"]) : 0) * ((decimal.Round(dmlIGV * 100, 2) + 100) / 100)) : ((dt.Rows[x]["PrecioUnitario"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["PrecioUnitario"]) : 0);
                    ObjECMP_CompraDetalle.ImporteIGV         = (dt.Rows[x]["ImporteIGV"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["ImporteIGV"]) : 0;
                    ObjECMP_CompraDetalle.CodOperacionIGV    = (dt.Rows[x]["CodOperacionIGV"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["CodOperacionIGV"]) : string.Empty;
                    ObjECMP_CompraDetalle.ObjEALM_Almacen    = new ALM.Entity.EALM_Almacen()
                    {
                        IdAlmacen = (dt.Rows[x]["IdAlmacen"] != DBNull.Value) ? Convert.ToInt32(dt.Rows[x]["IdAlmacen"]) : -1
                    };
                    ObjECMP_CompraDetalle.IdReferencia    = (dt.Rows[x]["IdReferencia"] != DBNull.Value) ? Convert.ToInt32(dt.Rows[x]["IdReferencia"]) : 0;
                    ObjECMP_CompraDetalle.SerieNumero     = (dt.Rows[x]["NroDocumento"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["NroDocumento"]) : string.Empty;
                    ObjECMP_CompraDetalle.IdEmpSucursal   = (dt.Rows[x]["IdEmpSucursal"] != DBNull.Value) ? Convert.ToInt32(dt.Rows[x]["IdEmpSucursal"]) : 0;
                    ObjECMP_CompraDetalle.IdDestino       = (dt.Rows[x]["IdDestino"] != DBNull.Value) ? Convert.ToInt32(dt.Rows[x]["IdDestino"]) : 0;
                    ObjECMP_CompraDetalle.PeriodoCampania = (dt.Rows[x]["PeriodoCampania"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["PeriodoCampania"]) : string.Empty;

                    ListECMP_CompraDetalle.Add(ObjECMP_CompraDetalle);
                }

                return(ListECMP_CompraDetalle);
            }

            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 23
0
        /// <summary>
        /// Lista Articulo Precios
        /// </summary>
        /// <returns></returns>
        public List <string> ListArticuloListaPercio(string IdCategoria, string IdSubCategoria, string IdMarca, string IdArticulo, string IdProveedor, string PeridoIni, string PeriodoFin)
        {
            try
            {
                ObjCmpSql = new CmpSql(SGCVariables.ConectionString);
                ObjCmpSql.CommandProcedure("spCMP_GET_ArticuloListaPrecio");

                var listDetalle = new List <string>();

                ObjCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, "LISTADO");
                ObjCmpSql.AddParameter("@IdCategoria", SqlDbType.VarChar, (IdCategoria != "") ? IdCategoria : "0");
                ObjCmpSql.AddParameter("@IdSubCategoria", SqlDbType.VarChar, (IdSubCategoria != "") ? IdSubCategoria : "0");
                ObjCmpSql.AddParameter("@IdMarca", SqlDbType.VarChar, (IdMarca != "") ? IdMarca : "0");
                ObjCmpSql.AddParameter("@IdArticulo", SqlDbType.VarChar, (IdArticulo != "") ? IdArticulo : "0");
                ObjCmpSql.AddParameter("@IdCliProveedor", SqlDbType.VarChar, (IdProveedor != "") ? IdProveedor : "0");
                ObjCmpSql.AddParameter("@PeriodoIni", SqlDbType.Char, PeridoIni);
                ObjCmpSql.AddParameter("@PeriodoFin", SqlDbType.Char, PeriodoFin);
                ObjCmpSql.AddParameter("@IdUsuario", SqlDbType.Int, SGCVariables.ObjESGC_Usuario.IdUsuario);
                DataTable dt = ObjCmpSql.ExecuteDataTable();

                if (dt.Rows.Count == 0)
                {
                    return(null);
                }
                string cabecera = string.Empty;
                string Detalle  = string.Empty;
                foreach (DataColumn item in dt.Columns)
                {
                    cabecera += item.ToString() + "/";
                }
                cabecera = cabecera.Substring(0, cabecera.Length - 1);
                listDetalle.Add(cabecera);


                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    string strValue = string.Empty;

                    for (int y = 0; y < dt.Columns.Count; y++)
                    {
                        strValue += Convert.ToString(dt.Rows[x][y]) + ",";
                    }

                    strValue = strValue.Substring(0, strValue.Length - 1);
                    listDetalle.Add(strValue);
                }

                return(listDetalle);
            }
            catch (Exception)
            {
                throw;
            }
        }
        /// <summary>
        /// Lista de Pedido Detalle
        /// </summary>
        /// <returns>Colección de las Pedido Detalle</returns>
        public CmpObservableCollection <ESGR_PedidoDetalle> GetCollectionPedidoDetalle(ESGR_Pedido ESGR_Pedido)
        {
            try
            {
                var objCmpSql = new CmpSql(SGRVariables.ConectionString);
                var CollectionPedidoDetalle = new CmpObservableCollection <ESGR_PedidoDetalle>();

                objCmpSql.CommandProcedure("spSGR_GET_BusquedaGeneral");
                objCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, "AdministrarPedidoDetalle");
                objCmpSql.AddParameter("@Filtro", SqlDbType.VarChar, "%");
                objCmpSql.AddParameter("@ParameterId", SqlDbType.Int, ESGR_Pedido.IdPedido);
                DataTable dt = objCmpSql.ExecuteDataTable();

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    CollectionPedidoDetalle.Add(new ESGR_PedidoDetalle
                    {
                        ESGR_Pedido = new ESGR_Pedido()
                        {
                            IdPedido = (dt.Rows[x]["IdPedido"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdPedido"]) : Convert.ToInt16(0),
                        },
                        ESGR_Producto = new ESGR_Producto()
                        {
                            IdProducto = (dt.Rows[x]["IdProducto"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdProducto"]) : Convert.ToInt16(0),
                            Producto   = (dt.Rows[x]["Producto"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Producto"]) : string.Empty,
                            Precio     = (dt.Rows[x]["Precio"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["Precio"]) : Convert.ToDecimal(0),
                            ESGR_ProductoSubCategoria = new ESGR_ProductoSubCategoria()
                            {
                                ESGR_ProductoCategoria = new ESGR_ProductoCategoria()
                                {
                                    Impresora = (dt.Rows[x]["Impresora"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Impresora"]) : string.Empty
                                }
                            }
                        },
                        Cantidad       = (dt.Rows[x]["Cantidad"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["Cantidad"]) : Convert.ToInt16(0),
                        CantidadMesa   = (dt.Rows[x]["CantidadMesa"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["CantidadMesa"]) : Convert.ToInt16(0),
                        CantidadLlevar = (dt.Rows[x]["CantidadLlevar"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["CantidadLlevar"]) : Convert.ToInt16(0),
                        Enviado        = (dt.Rows[x]["Enviado"] != DBNull.Value) ? Convert.ToBoolean(dt.Rows[x]["Enviado"]) : false,
                    });
                }

                return(CollectionPedidoDetalle);
            }

            catch (Exception)
            {
                throw;
            }
        }
 /// <summary>
 /// Insertar, Editar y Eliminar Usuario Area
 /// </summary>
 /// <param name="ESGR_UsuarioArea">Objecto de la Entidad Usuario Area</param>
 public void TransUsuarioArea(ESGR_UsuarioArea ESGR_UsuarioArea)
 {
     try
     {
         var objCmpSql = new CmpSql(SGRVariables.ConectionString);
         objCmpSql.CommandProcedure("spSGR_SET_UsuarioArea");
         objCmpSql.AddParameter("@IdUsuario", SqlDbType.Int, ESGR_UsuarioArea.ESGR_Usuario.IdUsuario);
         objCmpSql.AddParameter("@IdArea", SqlDbType.SmallInt, ESGR_UsuarioArea.ESGR_Area.IdArea);
         objCmpSql.ExecuteNonQuery();
     }
     catch (Exception)
     {
         throw;
     }
 }
        /// <summary>
        /// Lista de Permiso Perfil
        /// </summary>
        /// <returns>Colección de los Permiso Perfil</returns>
        public CmpObservableCollection <ESGR_PermisoPerfil> GetCollectionPermisoPerfil(int ParameterId)
        {
            try
            {
                var objCmpSql = new CmpSql(SGRVariables.ConectionString);
                var CollectionPermisoPerfil = new CmpObservableCollection <ESGR_PermisoPerfil>();

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

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    CollectionPermisoPerfil.Add(new ESGR_PermisoPerfil
                    {
                        IdPermisoPerfil = (dt.Rows[x]["IdPermisoPerfil"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdPermisoPerfil"]) : Convert.ToInt16(0),
                        Consulta        = (dt.Rows[x]["Consulta"] != DBNull.Value) ? Convert.ToBoolean(dt.Rows[x]["Consulta"]) : false,
                        Editar          = (dt.Rows[x]["Editar"] != DBNull.Value) ? Convert.ToBoolean(dt.Rows[x]["Editar"]) : false,
                        Eliminar        = (dt.Rows[x]["Eliminar"] != DBNull.Value) ? Convert.ToBoolean(dt.Rows[x]["Eliminar"]) : false,
                        Nuevo           = (dt.Rows[x]["Nuevo"] != DBNull.Value) ? Convert.ToBoolean(dt.Rows[x]["Nuevo"]) : false,
                        ESGR_Formulario = new ESGR_Formulario()
                        {
                            CodFormulario    = (dt.Rows[x]["CodFormulario"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["CodFormulario"]) : string.Empty,
                            NombreFormulario = (dt.Rows[x]["NombreFormulario"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["NombreFormulario"]) : string.Empty,
                            ESGR_Modulo      = new ESGR_Modulo()
                            {
                                IdModulo     = (dt.Rows[x]["IdModulo"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdModulo"]) : Convert.ToInt16(0),
                                Prefijo      = (dt.Rows[x]["Prefijo"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Prefijo"]) : string.Empty,
                                NombreModulo = (dt.Rows[x]["NombreModulo"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["NombreModulo"]) : string.Empty
                            }
                        },
                        ESGR_Perfil = new ESGR_Perfil()
                        {
                            IdPerfil = (dt.Rows[x]["IdPerfil"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdPerfil"]) : Convert.ToInt16(0),
                        },
                    });
                }

                return(CollectionPermisoPerfil);
            }

            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 27
0
        public ObservableCollection <ECMP_CuentasPorPagar> ListCuentasPorPagar(int IdCliProveedor, int BusqFecha, DateTime FechaInicio, DateTime FechaFin)
        {
            try
            {
                objCmpSql = new CmpSql(SGCVariables.ConectionString);
                var ListECMP_CuentaCorrientedeProveedor = new ObservableCollection <ECMP_CuentasPorPagar>();
                objCmpSql.CommandProcedure("spCMP_GET_CuentasPorPagar");
                objCmpSql.AddParameter("@IdCliProveedor", SqlDbType.Int, IdCliProveedor);
                objCmpSql.AddParameter("@BusqFecha", SqlDbType.Bit, BusqFecha);
                objCmpSql.AddParameter("@Fecha_Ini", SqlDbType.SmallDateTime, (FechaInicio.Year <= 1900) ? DateTime.Now : FechaInicio);
                objCmpSql.AddParameter("@Fecha_Fin", SqlDbType.SmallDateTime, (FechaFin.Year <= 1900) ? DateTime.Now : FechaFin);
                DataTable dt = objCmpSql.ExecuteDataTable();

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    ListECMP_CuentaCorrientedeProveedor.Add(new ECMP_CuentasPorPagar()
                    {
                        Fecha             = (dt.Rows[x]["Fecha"] != DBNull.Value) ? Convert.ToDateTime(dt.Rows[x]["Fecha"]) : DateTime.Now,
                        IdCliProveedor    = (dt.Rows[x]["IdCliProveedor"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdCliProveedor"]) : 0,
                        Proveedor         = (dt.Rows[x]["Proveedor"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Proveedor"]) : string.Empty,
                        NroDocIdentidad   = (dt.Rows[x]["NroDocIdentidad"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["NroDocIdentidad"]) : string.Empty,
                        ObjESGC_Documento = new ESGC_Documento()
                        {
                            Descripcion  = (dt.Rows[x]["Documento"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Documento"]) : string.Empty,
                            CodDocumento = (dt.Rows[x]["CodDocumento"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["CodDocumento"]) : string.Empty,
                        },
                        ObjESGC_Moneda = new ESGC_Moneda()
                        {
                            CodMoneda   = (dt.Rows[x]["CodMoneda"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["CodMoneda"]) : string.Empty,
                            Descripcion = (dt.Rows[x]["Moneda"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Moneda"]) : string.Empty,
                            Simbolo     = (dt.Rows[x]["Simbolo"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Simbolo"]) : string.Empty,
                        },
                        SerieDocumento = (dt.Rows[x]["Serie"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Serie"]) : string.Empty,
                        Numero         = (dt.Rows[x]["Numero"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["Numero"]) : string.Empty,
                        NroDocumento   = (dt.Rows[x]["NroDocumento"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["NroDocumento"]) : string.Empty,
                        Debe           = (dt.Rows[x]["Debe"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["Debe"]) : 0,
                        Haber          = (dt.Rows[x]["Haber"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["Haber"]) : 0,
                        Saldo_SOL      = (dt.Rows[x]["Saldo_SOL"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["Saldo_SOL"]) : 0,
                        Saldo_USD      = (dt.Rows[x]["Saldo_USD"] != DBNull.Value) ? Convert.ToDecimal(dt.Rows[x]["Saldo_USD"]) : 0,
                    });
                }
                return(ListECMP_CuentaCorrientedeProveedor);
            }
            catch (Exception)
            {
                throw;
            }
        }
 /// <summary>
 /// Insertar, Editar y Eliminar Pedido Tipo
 /// </summary>
 /// <param name="ESGR_PedidoTipo">Objecto de la Entidad Pedido Tipo</param>
 public void TransPedidoTipo(ESGR_PedidoTipo ESGR_PedidoTipo)
 {
     try
     {
         var objCmpSql = new CmpSql(SGRVariables.ConectionString);
         objCmpSql.CommandProcedure("spSGR_SET_PedidoTipo");
         objCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, ESGR_PedidoTipo.Opcion);
         objCmpSql.AddParameter("@IdPedidoTipo", SqlDbType.SmallInt, ESGR_PedidoTipo.IdPedidoTipo);
         objCmpSql.AddParameter("@PedidoTipo", SqlDbType.VarChar, ESGR_PedidoTipo.PedidoTipo);
         objCmpSql.ExecuteNonQuery();
     }
     catch (Exception)
     {
         throw;
     }
 }
 /// <summary>
 /// Insertar, Editar y Eliminar Mesa Area
 /// </summary>
 /// <param name="ESGR_MesaArea">Objecto de la Entidad Mesa Area</param>
 public void TransMesaArea(ESGR_MesaArea ESGR_MesaArea)
 {
     try
     {
         var objCmpSql = new CmpSql(SGRVariables.ConectionString);
         objCmpSql.CommandProcedure("spSGR_SET_MesaArea");
         objCmpSql.AddParameter("@Opcion", SqlDbType.VarChar, ESGR_MesaArea.Opcion);
         objCmpSql.AddParameter("@IdMesaArea", SqlDbType.SmallInt, ESGR_MesaArea.IdMesaArea);
         objCmpSql.AddParameter("@MesaArea", SqlDbType.VarChar, ESGR_MesaArea.MesaArea);
         objCmpSql.ExecuteNonQuery();
     }
     catch (Exception)
     {
         throw;
     }
 }
        /// <summary>
        /// Lista de Cierre Caja Detalle
        /// </summary>
        /// <returns>Colección de Cierre Caja Detalle</returns>
        public CmpObservableCollection <ESGR_CierreCaja_Detalle> GetCollectionCierreCajaDetalle()
        {
            try
            {
                var objCmpSql = new CmpSql(SGRVariables.ConectionString);
                var CollectionCierreCaja_Detalle = new CmpObservableCollection <ESGR_CierreCaja_Detalle>();

                objCmpSql.CommandProcedure("spSGR_GET_BusquedaGeneral");
                objCmpSql.AddParameter("@Parametro", SqlDbType.VarChar, "CierreCaja_Detalle");
                DataTable dt = objCmpSql.ExecuteDataTable();

                for (int x = 0; x < dt.Rows.Count; x++)
                {
                    CollectionCierreCaja_Detalle.Add(new ESGR_CierreCaja_Detalle
                    {
                        Item            = (dt.Rows[x]["Item"] != DBNull.Value) ? Convert.ToByte(dt.Rows[x]["Item"]) : Convert.ToByte(0),
                        TipoPago        = (dt.Rows[x]["TipoPago"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["TipoPago"]) : string.Empty,
                        TipoTarjeta     = (dt.Rows[x]["TipoTarjeta"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["TipoTarjeta"]) : string.Empty,
                        Total           = (dt.Rows[x]["Total"] != DBNull.Value) ? Convert.ToByte(dt.Rows[x]["Total"]) : Convert.ToByte(0),
                        MndCodMnd       = (dt.Rows[x]["MndCodMnd"] != DBNull.Value) ? Convert.ToString(dt.Rows[x]["MndCodMnd"]) : string.Empty,
                        ESGR_CierreCaja = new ESGR_CierreCaja()
                        {
                            IdCaja = (dt.Rows[x]["IdCaja"] != DBNull.Value) ? Convert.ToInt16(dt.Rows[x]["IdCaja"]) : Convert.ToInt16(0),
                        },
                    });
                }

                return(CollectionCierreCaja_Detalle);
            }

            catch (Exception)
            {
                throw;
            }
        }