public ImageClienteModel seleDatosImagen(ImageClienteModel requestModel) { var respon = iImagenClienteDataAccess.seleDatosImagen(requestModel); return(respon); }
public SingleResponse <bool> GuardarDatosIMagen(ImageClienteModel requestModel) { SingleResponse <bool> response = new SingleResponse <bool>(); try { var respon = iImagenClienteDataAccess.GuardarDatosIMagen(requestModel); response.Done(respon, string.Empty); } catch (Exception e) { //Agregar menjase de error response.Error(new DomainException(e.Message)); } return(response); }
public SingleResponse <ImageClienteModel> ObtenerImagenCliente(ImageClienteModel requestModel) { SingleResponse <ImageClienteModel> response = new SingleResponse <ImageClienteModel>(); var datosImagen = iImagenClienteBussines.seleDatosImagen(requestModel); if (datosImagen.Id == 0) { response.Done(null, string.Empty); return(response); } Byte[] bytes = File.ReadAllBytes(datosImagen.Url); String file = Convert.ToBase64String(bytes); requestModel.Id = datosImagen.Id; requestModel.imagen64 = file; requestModel.Fecha = datosImagen.Fecha; requestModel.Url = ""; response.Done(requestModel, string.Empty); return(response); }
public ImageClienteModel seleDatosImagen(ImageClienteModel requestModel) { var respuesta = new ImageClienteModel(); try { SqlCommand command = new SqlCommand { CommandText = ConstStoredProcedures.SpSelImagenClienteFlex }; command.Parameters.Add("@IdCliente", SqlDbType.Int).Value = requestModel.IdCliente; command.Parameters.Add("@IdSolicitud", SqlDbType.Int).Value = requestModel.IdSolictud; SqlDataReader datosStored = iGenericDataAccess.StoredProcedure(command); if (datosStored.HasRows) { while (datosStored.Read()) { respuesta.Id = Convert.ToInt32(datosStored["Id"]); respuesta.Fecha = Convert.ToDateTime(datosStored["Fecha"]); respuesta.Url = Convert.ToString(datosStored["Url"]); respuesta.IdCliente = Convert.ToInt32(datosStored["IdCliente"]); } iGenericDataAccess.CloseConnection(); } } catch (Exception e) { iGenericDataAccess.CloseConnection(); throw new DalException(Codes.ERR_00_01, e); } return(respuesta); }
public bool GuardarDatosIMagen(ImageClienteModel requestModel) { try { SqlCommand command = new SqlCommand { CommandText = (requestModel.IsUpdate == 0) ? ConstStoredProcedures.SpInsertImagenClienteFlex : ConstStoredProcedures.SpUpdateImagenClienteFlex }; if (requestModel.IsUpdate == 1)// Solo Para Updates { command.Parameters.Add("@Id", SqlDbType.VarChar).Value = requestModel.Id; } command.Parameters.Add("@URl", SqlDbType.VarChar).Value = requestModel.Url; if (requestModel.IsUpdate == 0) { command.Parameters.Add("@IdCliente", SqlDbType.Int).Value = requestModel.IdCliente; } SqlDataReader datosStored = iGenericDataAccess.StoredProcedure(command); iGenericDataAccess.CloseConnection(); } catch (Exception e) { iGenericDataAccess.CloseConnection(); throw new DalException(Codes.ERR_00_01, e); } return(true); }
public SingleResponse <bool> GuardarDatosImagenCliente(ImageClienteModel requestModel) { return(iImagenClienteBussines.GuardarDatosIMagen(requestModel)); }