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); }
public SqlOperation GetCreateStatement(BaseEntity entity) { var operation = new SqlOperation() { ProcedureName = "CRUD_USUARIOS" }; var user = (User)entity; operation.AddVarcharParam(DbColIdUsuario, user.IdUsuario); operation.AddVarcharParam(DbColNombre_Usuario, user.NombreUsuario); operation.AddVarcharParam(DbColDireccion_Usuario, user.DirUsuario); operation.AddVarcharParam(DbColProvincia_Usuario, user.Prov_Usuario); operation.AddVarcharParam(DbColCanton_Usuario, user.Cant_Usuario); operation.AddVarcharParam(DbColDistrito_Usuario, user.Dist_Usuario); operation.AddVarcharParam(DbColCorreo_Usuario, user.Correo_Usuario); operation.AddVarcharParam(DbColContrasenia_Usuario, user.Pass_Usuario); operation.AddDateParam(DbColFecha_Nacimiento, user.FNac_Usuario); operation.AddByteParam(DbColImagen_Usuario, ConvertImageToByteArray(user.Imagen_Usuario)); operation.AddDateParam(DbColFecha_Creacion, user.FCreacion_Usuario); operation.AddIntParam(DbColIdRole, user.IdRole); operation.AddVarcharParam(DbColIdEntidad, user.IdEntidad); operation.AddIntParam(DbCrudAction, (int)CrudActionEnum.Create); return(operation); }
public SqlOperation GetRetriveStatementDate(DateTime fechaInicion, DateTime fechaFinal) { var operation = new SqlOperation { ProcedureName = "RET_Fecha_Animales_PR" }; operation.AddDateParam(DB_COL_Fecha_inicio, fechaInicion); operation.AddDateParam(DB_COL_Fecha_Final, fechaFinal); return(operation); }
public SqlOperation GetSanctionsByDateRangeStatement(DateTime beginDate, DateTime endDate) { var Operation = new SqlOperation { ProcedureName = "RetrieveSanctionsByDateRange" }; Operation.AddDateParam(DATEINIT, beginDate); Operation.AddDateParam(DATEEND, endDate); return(Operation); }
public SqlOperation GetComplaintsByDateRange(DateTime beginDate, DateTime endDate) { var Operation = new SqlOperation { ProcedureName = "RetrieveComplaintsByDateRange" }; Operation.AddDateParam(DATEINIT, beginDate); Operation.AddDateParam(DATEEND, endDate); return(Operation); }
public SqlOperation GetRetrieveAllByFiltroStatement(HotelFiltro hotelFiltro) { var operation = new SqlOperation { ProcedureName = $"RET_ALL_HOTELES_DISPONIBLES_PR" }; operation.AddVarcharParam("HOTEL_NOMBRE", hotelFiltro.HotelNombre); operation.AddIntParam("TIPO_HABITACION_PERSONAS", hotelFiltro.TipoHabitacionPersonas); operation.AddDateParam("FECHA_INICIO", hotelFiltro.FechaInicio); operation.AddDateParam("FECHA_FIN", hotelFiltro.FechaFin); return(operation); }
public SqlOperation GetRetriveStatementDatAndType(BaseEntity entity, DateTime fechaInicion, DateTime fechaFinal) { var c = (Producion)entity; var operation = new SqlOperation { ProcedureName = "[RET_Fecha_Animales_Tipo_PR]" }; operation.AddVarcharParam(DB_COL_TIPO_PRODUCTO, c.tipoProducto); operation.AddDateParam(DB_COL_Fecha_inicio, fechaInicion); operation.AddDateParam(DB_COL_Fecha_Final, fechaFinal); return(operation); }
public SqlOperation GetComplaintsByDateRangeAndTerminal(int idTerminal, DateTime beginDate, DateTime endDate) { var Operation = new SqlOperation { ProcedureName = "RetrieveComplaintsByDateRangeAndTerminalId" }; Operation.AddDateParam(DATEINIT, beginDate); Operation.AddDateParam(DATEEND, endDate); Operation.AddIntParam(IDTERMINAL, idTerminal); return(Operation); }
public SqlOperation GetSanctionsByDateRangeAndCompanyStatement(DateTime beginDate, DateTime endDate, int idCompany) { var Operation = new SqlOperation { ProcedureName = "RetrieveSanctionsByDateRangeAndCompanyId" }; Operation.AddDateParam(DATEINIT, beginDate); Operation.AddDateParam(DATEEND, endDate); Operation.AddIntParam(IDCOMPANY, idCompany); return(Operation); }
public SqlOperation GetRetriveAllStatement(int idHotel, int cantPersonas, DateTime checkin, DateTime checkout) { var operation = new SqlOperation { ProcedureName = "RET_ALL_AVAILABLE_ROOMS_PR" }; operation.AddIntParam("HOTEL_ID", idHotel); operation.AddIntParam("TIPO_HABITACION_PERSONAS", cantPersonas); operation.AddDateParam("FECHA_INICIO", checkin); operation.AddDateParam("FECHA_FIN", checkout); return(operation); }
public SqlOperation GetCompareStatament(BaseEntity entity) { var c = (Cita)entity; var operacion = new SqlOperation { ProcedureName = "COMPARAR_HORARIO_SUCURSAL" }; operacion.AddDateParam(DB_COL_HORA_INICIO, c.hora_inicio); operacion.AddDateParam(DB_COL_HORA_FIN, c.hora_fin); operacion.AddIntParam(DB_COL_ID_SUCURSAL, c.id_sucursal); return(operacion); }
public SqlOperation GetEmpleadoDisponibleProdStatament(BaseEntity entity) { var c = (Cita)entity; var operacion = new SqlOperation { ProcedureName = "OBTENER_EMPLEADO_DISPONIBLE_PROD" }; operacion.AddDateParam(DB_COL_HORA_INICIO, c.hora_inicio); operacion.AddDateParam(DB_COL_HORA_FIN, c.hora_fin); operacion.AddDateParam(DB_COL_FECHA, c.fecha); operacion.AddIntParam(DB_COL_ID_SUCURSAL, c.id_sucursal); operacion.AddIntParam(DB_COL_ID_ITEM, c.id_item); return(operacion); }
public SqlOperation GetCreateStatement(BaseEntity entity) { var operation = new SqlOperation { ProcedureName = "CREAR_HORARIO_PR" }; var h = (Horario)entity; operation.AddDateParam(DB_COL_FECHA, h.fecha); operation.AddVarcharParam(DB_COL_TIPO_HORARIO, h.tipo_horario); operation.AddDateParam(DB_COL_HORA_INICIO, h.hora_inicio); operation.AddDateParam(DB_COL_HORA_FIN, h.hora_fin); operation.AddIntParam(DB_COL_ID_SUCURSAL, h.id_sucursal); return(operation); }
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 GetCreateStatement(BaseEntity entity) { var operation = new SqlOperation { ProcedureName = "CreateCard" }; var Card = (Card)entity; operation.AddDoubleParam(BALANCE, Card.Balance); operation.AddIntParam(DAYSFORNOTIFICATION, Card.DaysForNotification); operation.AddDateParam(NOTIFICATION, Card.Notification); operation.AddDateParam(DATEEXPIRY, Card.ExpiryDate); operation.AddIntParam(IDTETMINAL, Card.Terminal.IdTerminal); operation.AddIntParam(IDUSER, Card.User.IdUser); operation.AddIntParam(IDCARDTYPE, Card.CrType.IdCardType); return(operation); }
public SqlOperation GetCreateProductStatement(BaseEntity entity) { var operacion = new SqlOperation { ProcedureName = "CREAR_CITA_PRODUCTO" }; var c = (Cita)entity; operacion.AddIntParam(DB_COL_ID_CLIENTE, c.id_cliente); operacion.AddIntParam(DB_COL_ID_EMPLEADO, c.id_empleado); operacion.AddDateParam(DB_COL_FECHA, c.fecha); operacion.AddDateParam(DB_COL_HORA_INICIO, c.hora_inicio); operacion.AddDateParam(DB_COL_HORA_FIN, c.hora_fin); operacion.AddVarcharParam(DB_COL_CODIGO, c.codigo); return(operacion); }
public SqlOperation GetCreateStatement(BaseEntity entity) { //este stored proc inserta en la tabla persona y en la tabla admin aeropuerto var operation = new SqlOperation { ProcedureName = "sp_CreateAirportManager" }; var m = (AirportManager)entity; operation.AddVarcharParam(DB_COL_ID, m.ID); operation.AddVarcharParam(DB_COL_FIRST_NAME, m.FirstName); operation.AddVarcharParam(DB_COL_SECOND_NAME, m.SecondName); operation.AddVarcharParam(DB_COL_FIRST_LAST_NAME, m.LastName); operation.AddVarcharParam(DB_COL_SECOND_LAST_NAME, m.SecondLastName); operation.AddDateParam(DB_COL_BIRTHDATE, m.BirthDate); operation.AddVarcharParam(DB_COL_GENRE, m.Genre); operation.AddVarcharParam(DB_COL_EMAIL, m.Email); operation.AddVarcharParam(DB_COL_PASSWORD, m.Password); operation.AddVarcharParam(DB_COL_PHONE, m.Phone); operation.AddVarcharParam(DB_COL_CIVIL_STATUS, m.CivilStatus); operation.AddIntParam(DB_COL_STATUS, m.Status ? 1 : 0); operation.AddVarcharParam(DB_COL_ID_ROL, m.Rol); operation.AddVarcharParam(DB_COL_ID_AIRPORT, m.AirportID); return(operation); }
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); }
public SqlOperation GetUpdateStatement(BaseEntity entity) { var operacion = new SqlOperation { ProcedureName = "MODIFICAR_CITA" }; var c = (Cita)entity; operacion.AddIntParam(DB_COL_ID, c.id); operacion.AddIntParam(DB_COL_ID_CLIENTE, c.id_cliente); operacion.AddIntParam(DB_COL_ID_ITEM, c.id_item); operacion.AddIntParam(DB_COL_ID_EMPLEADO, c.id_empleado); operacion.AddDateParam(DB_COL_FECHA, c.fecha); operacion.AddDateParam(DB_COL_HORA_INICIO, c.hora_inicio); operacion.AddDateParam(DB_COL_HORA_FIN, c.hora_fin); return(operacion); }
public SqlOperation GetCreateStatement(Entity entity) { var operation = new SqlOperation { ProcedureName = "CRE_PROMOCIONES_PR" }; var p = (Promociones)entity; operation.AddVarcharParam(DB_COL_CODIGO, p.Codigo); operation.AddIntParam(DB_COL_CANT_DISPONIBLE, p.CantDisponible); operation.AddDateParam(DB_COL_FECHA_INICIO, p.FechaFin); operation.AddDateParam(DB_COL_FECHA_FIN, p.FechaFin); operation.AddDecimalParam(DB_COL_DESCUENTO, p.Descuento); operation.AddVarcharParam(DB_COL_VALOR_TIPO_PROMOCION, p.ValorTipoPromocion); operation.AddVarcharParam(DB_COL_ID_HOTEL, p.IdHotel); return(operation); }
public SqlOperation GetCreateStatement(BaseEntity entity) { var operation = new SqlOperation { ProcedureName = "SP_CREATEFLIGHT" }; var a = (Flight)entity; operation.AddVarcharParam(DB_COL_ID, a.Id); operation.AddVarcharParam(DB_COL_AIRLINE_ID, a.Airline_Id); operation.AddVarcharParam(DB_COL_ORIGIN_AIRPORT, a.Origin_Airport_Id); operation.AddVarcharParam(DB_COL_DESTINY_AIRPORT, a.Destiny_Airport_Id); operation.AddDateParam(DB_COL_DEPARTURE_TIME, a.Departure_Time); operation.AddDateParam(DB_COL_ARRIVAL_TIME, a.Arrival_DateTime); operation.AddVarcharParam(DB_COL_STATUS, a.Status); operation.AddVarcharParam(DB_COL_ID_AIRPLANE, a.Id_Airplane); operation.AddVarcharParam(DB_COL_ID_GATE, a.Id_Gate); return(operation); }
public SqlOperation GetCitasClienteStatament(BaseEntity entity) { var c = (Cita)entity; var operacion = new SqlOperation { ProcedureName = "OBTENER_CITAS_CLIENTE" }; operacion.AddDateParam(DB_COL_FECHA, c.fecha); operacion.AddIntParam(DB_COL_ID_CLIENTE, c.id_cliente); return(operacion); }
public SqlOperation GetUpdateNotiStatement(BaseEntity entity) { var operation = new SqlOperation { ProcedureName = "UpdateCardNotification" }; var Card = (Card)entity; operation.AddVarcharParam(IDCARD, Card.IdCard); operation.AddIntParam(DAYSFORNOTIFICATION, Card.DaysForNotification); operation.AddDateParam(NOTIFICATION, Card.Notification); return(operation); }
public SqlOperation GetCitasEmpleadoStatament(BaseEntity entity) { var c = (Cita)entity; var operacion = new SqlOperation { ProcedureName = "OBTENER_CITA_EMPLEADO" }; operacion.AddDateParam(DB_COL_FECHA, c.fecha); operacion.AddIntParam(DB_COL_ID_EMPLEADO, c.id_empleado); return(operacion); }
public SqlOperation GetCitasComercioStatament(BaseEntity entity) { var c = (Cita)entity; var operacion = new SqlOperation { ProcedureName = "OBTENER_CITA_COMERCIO" }; operacion.AddDateParam(DB_COL_FECHA, c.fecha); operacion.AddIntParam(DB_COL_ID_COMERCIO, c.id_comercio); return(operacion); }
public SqlOperation GetCitasSucursalStatament(BaseEntity entity) { var c = (Cita)entity; var operacion = new SqlOperation { ProcedureName = "OBTENER_CITA_SUCURSAL" }; operacion.AddDateParam(DB_COL_FECHA, c.fecha); operacion.AddIntParam(DB_COL_ID_SUCURSAL, c.id_sucursal); return(operacion); }
public SqlOperation GetUpdateStatement(BaseEntity entity, BaseEntity ReqEntity) { var Operation = new SqlOperation { ProcedureName = "UpdateBusDateRequirements" }; var C = (Bus)entity; var req = (Requirement)ReqEntity; Operation.AddIntParam(PKIDBUS, C.IdBus); Operation.AddIntParam(IDREQUIREMENTN, req.IdRequirement); Operation.AddDateParam(Expiry, req.Expiry); return(Operation); }
public SqlOperation GetCreateStatement(BaseEntity entity) { var operation = new SqlOperation { ProcedureName = "sp_CreateUserHistory" }; var userHistory = (UserHistory)entity; operation.AddVarcharParam(DB_COL_ID_ACTION, userHistory.Id); operation.AddVarcharParam(DB_COL_ID_USER, userHistory.UserId); operation.AddVarcharParam(DB_COL_ACTION, userHistory.ActionType.ToString()); operation.AddDateParam(DB_COL_DATE_ACTION, userHistory.ActionDate); return(operation); }
public SqlOperation GetRegistException(Exception bex) { var operation = new SqlOperation { ProcedureName = "RegisterException" }; operation.AddVarcharParam(HOUR, DateTime.Now.ToString("HH:mm:ss")); operation.AddDateParam(DATE, DateTime.Now); operation.AddVarcharParam(MESSAGE, bex.Message); operation.AddVarcharParam(STACKTRACE, bex.StackTrace); return(operation); }
public SqlOperation GetCreateStatementForReqXBus(BaseEntity BusEntity, BaseEntity ReqEntity) { var operation = new SqlOperation { ProcedureName = "CreateBusxReq" }; var Bus = (Bus)BusEntity; var Requirement = (Requirement)ReqEntity; operation.AddIntParam(IDBUS, Bus.IdBus); operation.AddIntParam(REQUIREMENT, Requirement.IdRequirement); operation.AddDateParam(EXPIRY, Requirement.Expiry); return(operation); }