Пример #1
0
        public SqlOperation GetCreateStatement(BaseEntity entity)
        {
            var operation = new SqlOperation {
                ProcedureName = "CRE_CELLAR_PR"
            };

            var cellar = (Cellar)entity;

            operation.AddDecimalParam(DB_COL_ID_LATITUDE, cellar.Latitude);
            operation.AddDecimalParam(DB_COL_ID_LONGITUDE, cellar.Longitude);
            operation.AddVarcharParam(DB_COL_ID_STORE, cellar.Id_Store);
            operation.AddVarcharParam(DB_COL_ADDRESS, cellar.Address);

            return(operation);
        }
Пример #2
0
        public SqlOperation GetCreateStatement(EntidadBase entidad)
        {
            var operation = new SqlOperation {
                ProcedureName = "CRE_INGREDIENTE_PR"
            };

            var i = (Ingrediente)entidad;

            operation.AddVarcharParam(DB_COL_NOMBRE, i.Nombre);
            operation.AddIntParam(DB_COL_UNIDAD_MEDIDA, i.UnidadDeMedida.Id);
            operation.AddVarcharParam(DB_COL_UNIDAD_EMPAQUE, i.UnidadDeEmpaque);
            operation.AddDecimalParam(DB_COL_CANT_POR_EMPAQUE, i.CantPorEmpaque);
            operation.AddDecimalParam(DB_COL_UNIDADES, i.Unidades);

            return(operation);
        }
Пример #3
0
        public SqlOperation GetCreateStatement(BaseEntity entity)
        {
            var operation = new SqlOperation {
                ProcedureName = "CRE_USUARIO_PR"
            };

            var u = (Usuario)entity;

            operation.AddVarcharParam(DB_COL_EMAIL, u.Email);
            operation.AddVarcharParam(DB_COL_SALT, u.PasswordSalt);
            operation.AddVarcharParam(DB_COL_HASH, u.PasswordHash);
            operation.AddDateTimeParam(DB_COL_PASSWORD_LAST_SET, u.PasswordLastSet);
            operation.AddVarcharParam(DB_COL_IDENTIFICACION, u.Identificacion);
            operation.AddVarcharParam(DB_COL_NOMBRE, u.Nombre);
            operation.AddVarcharParam(DB_COL_APELLIDOS, u.Apellidos);
            operation.AddDateParam(DB_COL_NACIMIENTO, u.FechaNacimiento);
            operation.AddVarcharParam(DB_COL_ESTADO, u.Estado);
            operation.AddVarcharParam(DB_COL_ROLE_ID, u.RoleId);
            operation.AddDecimalParam(DB_COL_NOTIFY_USER_AT, u.SmsNotificationsMin ?? 100);
            operation.AddIntParam(DB_COL_PHONE, u.Telefono);

            if (u.TerminalId != null && u.TerminalId != -1)
            {
                operation.AddIntParam(DB_COL_TERMINAL, u.TerminalId ?? 0);
            }

            return(operation);
        }
        public SqlOperation GetUpdateStatement(Entity entity)
        {
            var operation = new SqlOperation {
                ProcedureName = "UPD_PARAMETROS_PR"
            };

            var p = (ParametrizablesHotel)entity;

            operation.AddVarcharParam(DB_COL_ID_HOTEL, p.IdHotel);
            operation.AddDecimalParam(DB_COL_COMISION, p.Comision);
            operation.AddDecimalParam(DB_COL_PORCENTAJE_POLITICA, p.Porciento);
            operation.AddVarcharParam(DB_COL_DESCRIPCION_POLITICA, p.Politica);
            operation.AddIntParam(DB_COL_CANT_DIAS_DEVOLUCION, p.Dias);
            operation.AddVarcharParam(DB_COL_MENSAJE_SMS, p.Mensaje);
            return(operation);
        }
Пример #5
0
        public SqlOperation GetCreateStatement(BaseEntity entity)
        {
            var operation = new SqlOperation()
            {
                ProcedureName = "CRUD_EVENTO"
            };
            var evento = (Evento)entity;

            operation.Parameters = new List <SqlParameter>();
            operation.AddIntParam(DbColIdEvento, evento.IdEvento);
            operation.AddVarcharParam(DbColNombreEvento, evento.NombreEvento);
            operation.AddVarcharParam(DbColUbicacionEvento, evento.UbicacionEvento);
            operation.AddVarcharParam(DbColDescripcionEvento, evento.DescripcionEvento);
            operation.AddByteParam(DbColLogoEvento, ConvertImageToByteArray(evento.LogoEvento));

            operation.AddIntParam(DbColIdCategoria, evento.IdCategoria);
            operation.AddIntParam(DbColCupoEvento, evento.CupoEvento);
            operation.AddVarcharParam(DbColIdEntidad, evento.IdEntidad);
            operation.AddDateParam(DbColFechaInicioEvento, evento.FechaInicioEvento);
            operation.AddDateParam(DbColFechaFinalEvento, evento.FechaFinalEvento);
            operation.AddDateParam(DbColFechaInicioInscripcion, evento.FechaInicioInscripcion);
            operation.AddDateParam(DbColFechaFinalInscripcion, evento.FechaFinalInscripcion);
            operation.AddDecimalParam(DbColCostoInscripcion, evento.CostoInscripcion);

            operation.AddIntParam(DbCrudAction, (int)CrudActionEnum.Create);

            return(operation);
        }
Пример #6
0
        public SqlOperation GetCreateStatement(BaseEntity entity)
        {
            var operation = new SqlOperation {
                ProcedureName = "CRE_RECIPE_PR"
            };

            var c = (Recipe)entity;

            operation.AddVarcharParam(DB_COL_EMAIL, c.Email);
            operation.AddDecimalParam(DB_COL_LONGITUDE, c.Longitud);
            operation.AddDecimalParam(DB_COL_LATITUDE, c.Latitud);
            operation.AddIntParam(DB_COL_ID_PROVIDER, c.IdProvider);
            operation.AddDecimalParam(DB_COL_TOTAL_PROVIDER, c.TotalProvider);
            operation.AddDecimalParam(DB_COL_TOTAL, c.Total);
            return(operation);
        }
Пример #7
0
        public SqlOperation GetCreateStatement(EntidadBase entidad)
        {
            var operation = new SqlOperation {
                ProcedureName = "CRE_ESTACION_PR"
            };

            var e = (Estacion)entidad;

            operation.AddVarcharParam(DB_COL_NOMBRE, e.Nombre);
            operation.AddVarcharParam(DB_COL_ESTADO, e.Estado);
            operation.AddDecimalParam(DB_COL_LATITUD, e.Latitud);
            operation.AddDecimalParam(DB_COL_LONGITUD, e.Longitud);
            operation.AddIntParam(DB_COL_CENTRAL, e.Central);
            operation.AddIntParam(DB_COL_KILOMETRO, e.Kilometro);
            return(operation);
        }
Пример #8
0
        public SqlOperation GetCreateStatement(BaseEntity entity)
        {
            var operation = new SqlOperation {
                ProcedureName = "CRE_TERMINAL_PR"
            };

            var t = (Terminal)entity;

            operation.AddVarcharParam(DB_COL_NOMBRE, t.TerminalName);
            operation.AddDecimalParam(DB_COL_LATITUD, t.Latitude);
            operation.AddDecimalParam(DB_COL_LONGITUD, t.Longitude);
            operation.AddIntParam(DB_COL_CANTIDAD_LINEAS, t.CantidadLineas);
            operation.AddVarcharParam(DB_COL_ESTADO, "Activo");
            operation.AddIntParam(DB_COL_ESPACIOS_PARQUEO, t.EspaciosParqueo);
            operation.AddIntParam(DB_COL_ESPACIOS_PARQUEO_BUS, t.EspaciosParqueoBus);

            return(operation);
        }
Пример #9
0
        public SqlOperation GetUpdateStatement(BaseEntity entity)
        {
            var operation = new SqlOperation {
                ProcedureName = "UPD_SHIPPING_PR"
            };

            var s = (Shipping)entity;

            operation.AddVarcharParam(DB_COL_IDENTIFICATION, s.Identification);
            operation.AddVarcharParam(DB_COL_NAME, s.Name);
            operation.AddVarcharParam(DB_COL_LOGO, s.Logo);
            operation.AddDecimalParam(DB_COL_AREA_ENVIOS, s.CoveredArea);
            operation.AddVarcharParam(DB_COL_NUMERO_TELEFONO, s.Phone_Number);
            //operation.AddVarcharParam(DB_COL_TIPOS_ENVIO, s.TiposEnvio);
            operation.AddDecimalParam(DB_COL_TARIFA_BASE, s.Minimum_Rate);
            operation.AddDecimalParam(DB_COL_TARIFAXKILOMETRIO, s.Rate);
            operation.AddIntParam(DB_COL_ID_CURRENCY, s.IdCurrency);

            return(operation);
        }
Пример #10
0
        public SqlOperation GetDeleteStatement(BaseEntity entity)
        {
            var operation = new SqlOperation {
                ProcedureName = "DEL_PRODUCT_PR"
            };

            var prouct = (Product)entity;

            operation.AddDecimalParam(DB_COL_ID, prouct.Id);
            return(operation);
        }
Пример #11
0
        public SqlOperation GetCreateStatement(BaseEntity entity)
        {
            var operation = new SqlOperation {
                ProcedureName = "CRE_AIRPORT_PR"
            };
            var c = (Airport)entity;

            operation.AddVarcharParam(DB_COL_ID, c.ID);
            operation.AddVarcharParam(DB_COL_NAME, c.Name);
            operation.AddVarcharParam(DB_COL_ADDRESS, c.Address);
            operation.AddVarcharParam(DB_COL_PHONE, c.Phone);
            operation.AddVarcharParam(DB_COL_ZIPCODE, c.ZipCode);
            operation.AddDecimalParam(DB_COL_GATE_TARIFF, c.GateTariff);
            operation.AddDecimalParam(DB_COL_RUNWAY_TARIFF, c.RunwayTariff);
            operation.AddDecimalParam(DB_COL_TAX, c.Tax);
            operation.AddIntParam(DB_COL_STATUS, c.Status ? 1 : 0);
            operation.AddVarcharParam(DB_COL_LATITUDE, c.Latitude);
            operation.AddVarcharParam(DB_COL_LONGITUDE, c.Longitude);
            // operation.AddIntParam(DB_COL_ASIGNED, c.Asigned ? 1 : 0);
            return(operation);
        }
Пример #12
0
        public SqlOperation GetCreateStatement(BaseEntity entity)
        {
            var operation = new SqlOperation {
                ProcedureName = "CRE_PRODUCT_PR"
            };

            var Product = (Product)entity;

            operation.AddIntParam(DB_COL_ID, Product.Id);
            operation.AddVarcharParam(DB_COL_NAME, Product.Name);
            operation.AddVarcharParam(DB_COL_DESCRIPTION, Product.Description);
            operation.AddDecimalParam(DB_COL_PRICE_INITIAL, Product.PriceInitial);
            operation.AddDecimalParam(DB_COL_PRICE_FINAL, Product.PriceFinal);
            operation.AddDecimalParam(DB_COL_START_TAXES, Product.Taxes);
            operation.AddVarcharParam(DB_COL_PROVIDER, Product.Provider);
            operation.AddIntParam(DB_COL_ID_CATEGORY, Product.IdCategory);
            operation.AddIntParam(DB_COL_ID_CURRENCY, Product.IdCurrency);
            operation.AddBooleanParam(DB_COL_STATE, Product.State);

            return(operation);
        }
Пример #13
0
        public SqlOperation UpdateTarjetaSaldo(BaseEntity entity)
        {
            var tarjeta   = (Tarjeta)entity;
            var operation = new SqlOperation {
                ProcedureName = "UPD_SALDO_TARJETA"
            };

            operation.AddVarcharParam(DB_COL_CODIGO_UNICO, tarjeta.CodigoUnico);
            operation.AddDecimalParam(DB_COL_SALDO_DISPONIBLE, tarjeta.SaldoDisponible);

            return(operation);
        }
Пример #14
0
        public SqlOperation GetCreateStatement(EntidadBase entidad)
        {
            var operation = new SqlOperation {
                ProcedureName = "CRE_TIPO_TIQUETE_PR"
            };

            var c = (TipoTiquete)entidad;

            operation.AddVarcharParam(DB_COL_TIPO, c.Tipo);
            operation.AddDecimalParam(DB_COL_PRECIO, c.Precio);

            return(operation);
        }
Пример #15
0
        public SqlOperation GetCreateStatement(BaseEntity entity)
        {
            var operation = new SqlOperation()
            {
                ProcedureName = "CRUD_PAGO"
            };
            var pago = (Ruta)entity;

            operation.Parameters = new List <SqlParameter>();
            operation.AddIntParam(DbColIdPago, pago.IdPago);
            operation.AddVarcharParam(DbColIdUsuario, pago.IdUsuario);
            operation.AddVarcharParam(DbColMetodoPago, pago.MetodoDePago);
            operation.AddVarcharParam(DbColEstadoPago, pago.EstadoDePago);
            operation.AddDecimalParam(DbColMontoPago, pago.MontoDePago);
            operation.AddDecimalParam(DbColImpuestoVentaPago, pago.ImpuestoDePago);
            operation.AddDecimalParam(DbColDescuentoPago, pago.DescuentoDePago);
            operation.AddDecimalParam(DbColTotalPago, pago.TotalPago);
            operation.AddVarcharParam(DbColDetallePago, pago.DetalleDePago);
            operation.AddIntParam(DbCrudAction, (int)CrudActionEnum.Create);

            return(operation);
        }
Пример #16
0
        public SqlOperation GetCreateStatement(EntidadBase entidad)
        {
            var operation = new SqlOperation {
                ProcedureName = "CRE_CONVENIO_PR"
            };

            var c = (Convenio)entidad;

            operation.AddVarcharParam(DB_COL_NOMBRE, c.Nombre);
            operation.AddDecimalParam(DB_COL_DESCUENTO, c.Descuento);

            return(operation);
        }
Пример #17
0
        public SqlOperation GetUpdateStatement(BaseEntity entity)
        {
            var operation = new SqlOperation {
                ProcedureName = "CRE_SALIDA_PARQUEO_PR"
            };

            var r = (RegistroParqueo)entity;

            operation.AddVarcharParam(DB_COL_TARJETA_ID, r.TarjetaId);
            operation.AddIntParam(DB_COL_TERMINAL_ID, r.TerminalId);
            operation.AddDateTimeParam(DB_COL_HORA_FINAL, r.HoraFin);
            operation.AddDecimalParam(DB_COL_COSTO_TOTAL, r.CostoTotal);

            return(operation);
        }
Пример #18
0
        public SqlOperation GetCreateStatement(BaseEntity entity)
        {
            var operation = new SqlOperation()
            {
                ProcedureName = "CRUD_PRODUCTO"
            };
            var producto = (Producto)entity;

            operation.Parameters = new List <SqlParameter>();
            operation.AddIntParam(DbColIdProducto, producto.IdProducto);
            operation.AddVarcharParam(DbColNombreProducto, producto.NombreProducto);
            operation.AddDecimalParam(DbColCostoProducto, producto.CostoProducto);
            operation.AddByteParam(DbColLogoProducto, ConvertImageToByteArray(producto.LogoProducto));
            operation.AddIntParam(DbCrudAction, (int)CrudActionEnum.Create);
            return(operation);
        }
        public SqlOperation GetUpdateStatement(Entity entity)
        {
            var operation = new SqlOperation {
                ProcedureName = "UPD_TIPO_IMPUESTO_PR"
            };

            var imp = (TipoImpuesto)entity;

            operation.AddIntParam(DB_COL_CODIGO, imp.Codigo);
            operation.AddVarcharParam(DB_COL_NOMBRE, imp.Nombre);
            operation.AddDecimalParam(DB_COL_PORCENTAJE, imp.Porcentaje);
            operation.AddVarcharParam(DB_COL_DESCRIPCION, imp.Descripcion);
            operation.AddVarcharParam(DB_COL_ESTADO, imp.Estado);

            return(operation);
        }
Пример #20
0
        public SqlOperation GetPagoMembresiaStatement(Entity entity)
        {
            var operation = new SqlOperation {
                ProcedureName = "PAGO_MEMBRESIA_PR"
            };

            var c = (Cuenta)entity;

            operation.AddVarcharParam(DB_COL_ID_USUARIO, c.IdUsuario);
            operation.AddDecimalParam(DB_COL_MONTO, c.Monto);
            operation.AddVarcharParam(DB_COL_ID_HOTEL, c.IdHotel);
            operation.AddVarcharParam(DB_COL_TIPO_PAGO, c.TipoPago);


            return(operation);
        }
Пример #21
0
        public SqlOperation GetUpdateStatement(BaseEntity entity)
        {
            var operation = new SqlOperation {
                ProcedureName = "UPD_ADVERTISING_PR"
            };

            var ads = (Advertising)entity;

            operation.AddIntParam(DB_COL_ID_PRODUCT, ads.IdProduct);
            operation.AddVarcharParam(DB_COL_PRODUCT, ads.ProductName);
            operation.AddIntParam(DB_COL_ID_USER_PREFERENCES, ads.IdUserPreferences);
            operation.AddDecimalParam(DB_COL_PRICE, ads.Price);
            operation.AddVarcharParam(DB_COL_USER, ads.Email);

            return(operation);
        }
Пример #22
0
        public SqlOperation GetCreateStatement(BaseEntity entity)
        {
            var operation = new SqlOperation {
                ProcedureName = "CRE_OFFER_CODE_PR"
            };

            var offerCode = (OfferCode)entity;

            operation.AddVarcharParam(DB_COL_CODE, offerCode.Code);
            operation.AddVarcharParam(DB_COL_DESCRIPTION, offerCode.Description);
            operation.AddDecimalParam(DB_COL_VALUE, offerCode.Value);
            operation.AddIntParam(DB_COL_CODE, offerCode.Product);
            operation.AddIntParam(DB_COL_ID_PROVIDER, offerCode.Provider);

            return(operation);
        }
Пример #23
0
        public SqlOperation GetCreateGananciaStatement(Entity entity)
        {
            var operation = new SqlOperation {
                ProcedureName = "CRE_GANANCIA_DIA_PR"
            };


            var c = (Cuenta)entity;

            operation.AddVarcharParam(DB_COL_ID_USUARIO, c.IdUsuario);
            operation.AddDecimalParam(DB_COL_MONTO, c.Monto);
            operation.AddVarcharParam(DB_COL_ID_HOTEL, c.IdHotel);
            operation.AddVarcharParam(DB_COL_TIPO_USUARIO, c.TipoUsuario);
            operation.AddVarcharParam(DB_COL_TIPO_PAGO, c.TipoPago);

            return(operation);
        }
Пример #24
0
        public SqlOperation GetUpdateStatement(Entity entity)
        {
            var operation = new SqlOperation {
                ProcedureName = "UPD_GANANCIA_DIA_PR"
            };

            var c = (Cuenta)entity;

            operation.AddVarcharParam(DB_COL_ID_USUARIO, c.IdUsuario);
            operation.AddDateTimeParam(DB_COL_FECHA_REALIZADO, c.FechaRealizado);
            operation.AddDecimalParam(DB_COL_MONTO, c.Monto);
            operation.AddVarcharParam(DB_COL_ID_HOTEL, c.IdUsuario);
            operation.AddVarcharParam(DB_COL_TIPO_USUARIO, c.TipoUsuario);
            operation.AddVarcharParam(DB_COL_TIPO_PAGO, c.TipoPago);

            return(operation);
        }
Пример #25
0
        public SqlOperation GetUpdateStatement(BaseEntity entity)
        {
            var operation = new SqlOperation {
                ProcedureName = "UPD_STORE_PR"
            };
            var c = (Store)entity;

            operation.AddVarcharParam(DB_COL_ID, c.IDStore);
            operation.AddVarcharParam(DB_COL_NAME, c.Name);
            operation.AddVarcharParam(DB_COL_MANAGER_NAME, c.ManagerName);
            operation.AddVarcharParam(DB_COL_PHONE, c.Phone);
            operation.AddVarcharParam(DB_COL_ID_CATEGORY, c.IDCategory);
            operation.AddVarcharParam(DB_COL_ID_AIRPORT, c.IDAirport);
            operation.AddDecimalParam(DB_COL_RENT, c.Rent);
            operation.AddIntParam(DB_COL_STATUS, c.Status ? 1 : 0);

            return(operation);
        }
Пример #26
0
        public SqlOperation GetCreateStatement(BaseEntity entity)
        {
            var operation = new SqlOperation()
            {
                ProcedureName = "CRUD_EVENTO_PRODUCTO"
            };
            var eventoProducto = (EventoProducto)entity;

            operation.Parameters = new List <SqlParameter>();
            operation.AddIntParam(DbColIdProducto, eventoProducto.IdProducto);
            operation.AddVarcharParam(DbColTipoPatrocinio, eventoProducto.TipoPatrocinio);
            operation.AddIntParam(DbColCantidadProducto, eventoProducto.CantidadProducto);
            operation.AddDecimalParam(DbColValorTotalProducto, eventoProducto.ValorTotalProducto);
            operation.AddIntParam(DbColIdEvento, eventoProducto.IdEvento);
            operation.AddIntParam(DbColIdPatrocinador, eventoProducto.IdPatrocinador);
            operation.AddIntParam(DbCrudAction, (int)CrudActionEnum.Create);
            return(operation);
        }
Пример #27
0
        public SqlOperation GetCreateStatement(BaseEntity entity)
        {
            var operation = new SqlOperation {
                ProcedureName = "SP_CREATE_TICKET"
            };
            var a = (Ticket)entity;

            operation.AddVarcharParam(DB_COL_ID, a.Id);
            operation.AddVarcharParam(DB_COL_ID_FLIGHT, a.Id_Flight);
            operation.AddVarcharParam(DB_COL_TICKET_CLASS, a.Ticket_Class);
            operation.AddVarcharParam(DB_COL_STATUS, a.Status);
            operation.AddDecimalParam(DB_COL_PRICE, a.Price);
            operation.AddDateParam(DB_COL_BUY_DATE, a.Buy_Date);
            operation.AddVarcharParam(DB_COL_ID_PERSON, a.Id_Person);
            operation.AddVarcharParam(DB_COL_PERSON_NAME, a.Person_Name);

            return(operation);
        }
Пример #28
0
        public SqlOperation GetCreateReservationReturn(Reservation reservation)
        {
            var operation = new SqlOperation {
                ProcedureName = $"CRE_RESERVACIONES_RETURN_PR"
            };

            operation.AddIntParam("ID", reservation.Id);
            operation.AddIntParam("FK_USUARIO", reservation.FkUser);
            operation.AddIntParam("FK_HOTEL", reservation.FkHotel);
            operation.AddDateParam("FECHA_INCIO", reservation.StartDate);
            operation.AddDateParam("FECHA_FIN", reservation.EndDate);
            operation.AddDecimalParam("PRECIO", reservation.Price);
            operation.AddIntParam("FK_HABITACION", reservation.FKRoom);
            operation.AddIntParam("FK_RESERVACION", reservation.FkReservation);
            operation.AddIntParam("FK_SUBRESERVACION", reservation.FkSubreservation);
            operation.AddVarcharParam("ESTADO", reservation.State);
            return(operation);
        }
Пример #29
0
        public SqlOperation GetUpdateStatement(EntidadBase entidad)
        {
            var operation = new SqlOperation {
                ProcedureName = "UPD_TREN_PR"
            };

            var t = (Tren)entidad;

            operation.AddVarcharParam(DB_COL_MODELO, t.Modelo);
            operation.AddVarcharParam(DB_COL_MATRICULA, t.Matricula);
            operation.AddVarcharParam(DB_COL_NOMBRE, t.Nombre);
            operation.AddVarcharParam(DB_COL_FECHA_COMPRA, t.FechaCompra);
            operation.AddDecimalParam(DB_COL_COSTO, t.Costo);
            operation.AddVarcharParam(DB_COL_DESCRIPCION, t.Descripcion);
            operation.AddVarcharParam(DB_COL_ESTADO, t.Estado);

            return(operation);
        }
Пример #30
0
        public SqlOperation GetUpdateStatement(BaseEntity entity)
        {
            var operation = new SqlOperation {
                ProcedureName = "UPD_STORE_PR"
            };

            var store = (Store)entity;

            operation.AddVarcharParam(DB_COL_ID, store.Id);
            operation.AddVarcharParam(DB_COL_NAME, store.Name);
            operation.AddVarcharParam(DB_COL_LOGO, store.Logo);
            operation.AddVarcharParam(DB_COL_PHONE_NUMBER, store.PhoneNumber);
            operation.AddIntParam(DB_COL_CATEGORY, store.Category);
            operation.AddBooleanParam(DB_COL_ACTIVE, store.Active);
            operation.AddDecimalParam(DB_COL_EARNINGS, store.Earnings);

            return(operation);
        }