Exemple #1
0
        public void AgregarImagenTarea(IEnumerable <HttpPostedFileBase> Imagen, int IdTarea)
        {
            FotosBO  FotBO    = new FotosBO();
            FotosDAO DAOFotos = new FotosDAO();

            FotBO.CodigoTarea = IdTarea;
            if (Imagen != null)
            {
                foreach (var item in Imagen)
                {
                    Account account = new Account("collegejob", "668222543257229", "KmLmrbmSfDXVabsyzcFHQxKdiIE");

                    CloudinaryDotNet.Cloudinary cloudinary = new CloudinaryDotNet.Cloudinary(account);

                    var uploadParams = new ImageUploadParams
                    {
                        File = new FileDescription(item.FileName, item.InputStream),
                    };

                    var uploadResult = cloudinary.Upload(uploadParams);

                    string ruta = uploadResult.SecureUri.ToString();

                    FotBO.Imagen = ruta;
                    DAOFotos.AgregarFoto(FotBO);
                }
            }
        }
 public RelObras()
 {
     InitializeComponent();
     obrasDAO = new ObrasDAO();
     projDAO  = new ProjetosDAO();
     fotosDAO = new FotosDAO();
     agendDAO = new AgendamentosDAO();
     path     = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName + @"\rel\";
     radioUltimaFoto.Checked = true;
 }
Exemple #3
0
        public MenuPrincipal(string login, int tipoUsuario)
        {
            InitializeComponent();
            acoesDAO    = new AcoesDAO();
            agendDAO    = new AgendamentosDAO();
            cidadesDAO  = new CidadesDAO();
            fotosDAO    = new FotosDAO();
            logsDAO     = new LogsDAO();
            usuariosDAO = new UsuariosDAO();

            this.login       = login;
            this.tipoUsuario = tipoUsuario;

            // Tirar borda 3D
            this.SetBevel(false);
        }
Exemple #4
0
        public AddFoto(string id)
        {
            InitializeComponent();
            textId.Text = id;

            obrasDAO = new ObrasDAO();
            fotosDAO = new FotosDAO();

            #region Criação do filtro do openFileDialog (só aceita arquivos do tipo imagem)
            ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders();
            openFileDialog.Filter = String.Format("{0}{1}{2} ({3})|{3}", openFileDialog.Filter, "",
                                                  "Arquivos de Imagem", "*.BMP;*.DIB;*.RLE;*.JPG;*.JPEG;*.JPE;*.JFIF;*.GIF;*.TIF;*.TIFF;*.PNG");

            foreach (var c in codecs)
            {
                string codecName = c.CodecName.Substring(8).Replace("Codec", "").Trim();
                openFileDialog.Filter = String.Format("{0}{1}{2} ({3})|{3}", openFileDialog.Filter, "|",
                                                      "Arquivos " + codecName, c.FilenameExtension);
            }

            openFileDialog.FilterIndex = 1;
            #endregion
        }
 public Backup()
 {
     InitializeComponent();
     agendDAO    = new AgendamentosDAO();
     cidadesDAO  = new CidadesDAO();
     clientesDAO = new ClientesDAO();
     fornDAO     = new FornecedoresDAO();
     fotosDAO    = new FotosDAO();
     logsDAO     = new LogsDAO();
     obrasDAO    = new ObrasDAO();
     ofDAO       = new ObrasFornecedoresDAO();
     otDAO       = new ObrasTrabalhadoresDAO();
     obsDAO      = new ObservacoesDAO();
     palavrasDAO = new PalavrasProibidasDAO();
     projetosDAO = new ProjetosDAO();
     regCauDAO   = new RegCauDAO();
     regCauPDAO  = new RegCauProjetoDAO();
     regCreaDAO  = new RegCreaDAO();
     regCreaPDAO = new RegCreaProjetoDAO();
     respDAO     = new ResponsavelDAO();
     trabDAO     = new TrabalhadoresDAO();
     usuariosDAO = new UsuariosDAO();
     inserts     = new StringBuilder();
 }