Example #1
0
        public JsonResult GetArquivo(int id)
        {
            object Dado = new object();

            DAL.LicençaDAL scn = new DAL.LicençaDAL();

            var L = scn.GetArquivo(id);

            if (L == null)
            {
                Dado = null;
            }
            else
            {
                Dado = (new
                {
                    Id = L.Id,
                    IdLic = L.IdLic,
                    Nome = L.Nome,
                    Formato = L.Formato,
                    Type = L.Type,
                    Tamanho = L.Tamanho,
                    Arquivo = L.Arq
                });
            }

            return(Json(Dado));
        }
Example #2
0
        public List <Models.Licença> BuscarItensLicença(int id)
        {
            List <Models.OrçamentoLic> dados = new List <Models.OrçamentoLic>();
            List <Models.Licença>      lic   = new List <Models.Licença>();

            DAL.LicençaDAL sbd = new DAL.LicençaDAL();
            try
            {
                string sql = @"select * from orçamento_licença
                              where Id_or =" + id;

                DataTable dt = _bd.ExecutarSelect(sql);
                foreach (DataRow row in dt.Rows)
                {
                    Models.OrçamentoLic itens = new Models.OrçamentoLic();

                    itens.Id_or  = Convert.ToInt32(row["Id_or"]);
                    itens.Id_lic = Convert.ToInt32(row["Id_li"]);

                    lic.Add(sbd.Obter(itens.Id_lic));
                }
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                _bd.Fechar();
            }
            return(lic);
        }
        public bool Att(int id, string Versao, string dtVenc)
        {
            bool operacao = false;

            DAL.LicençaDAL lbd = new DAL.LicençaDAL();

            operacao = lbd.Att(id, Versao, dtVenc);

            return(operacao);
        }
        public (bool, string) Criar(Models.Licença licença)
        {
            string msg      = "";
            bool   operacao = false;

            DAL.LicençaDAL lbd = new DAL.LicençaDAL();

            operacao = lbd.Criar(licença);

            return(operacao, msg);
        }
Example #5
0
        public JsonResult AtualizarDoc()
        {
            int idlic = Convert.ToInt32(Request.Form["id"]);

            Models.Licença_Documento LicD = null;
            if (Request.Form.Files.Count > 0)
            {
                MemoryStream ms = new MemoryStream();
                Request.Form.Files[0].CopyTo(ms);
                byte[] arq     = ms.ToArray();
                string nome    = Request.Form.Files[0].FileName;
                string formato = System.IO.Path.GetExtension(nome);
                string type    = Request.Form.Files[0].ContentType;
                string desc    = Request.Form.Files[0].Name;
                int    tamanho = Convert.ToInt32(Request.Form.Files[0].Length);
                LicD = new Models.Licença_Documento(idlic, nome, formato, type, tamanho, arq);
            }

            DAL.LicençaDAL ld = new DAL.LicençaDAL();
            if (ld.AtualizarDoc(LicD))
            {
                return(Json(new
                {
                    ok = true,
                    msg = "Documento Atualizado com sucesso!"
                }));
            }
            else
            {
                return(Json(new
                {
                    ok = false,
                    msg = "Erro ao atualizar documento!"
                }));
            }
        }
 public Licença_Documento BuscarArquivo(int id)
 {
     DAL.LicençaDAL lbd = new DAL.LicençaDAL();
     return(lbd.GetArquivo(id));
 }
 public bool Excluir(int id)
 {
     DAL.LicençaDAL lbd = new DAL.LicençaDAL();
     return(lbd.Excluir(id));
 }
        public List <Models.Licença> Pesquisar(string nome)
        {
            DAL.LicençaDAL lbd = new DAL.LicençaDAL();

            return(lbd.Pesquisar(nome));
        }
 public List <Models.Licença> BuscarLicençaCli(int id)
 {
     DAL.LicençaDAL sbd = new DAL.LicençaDAL();
     return(sbd.BuscarLicençaCli(id));
 }
 public List <Models.Licença> ObterTodos()
 {
     DAL.LicençaDAL sbd = new DAL.LicençaDAL();
     return(sbd.ObterTodos());
 }
 public Models.Licença Obter(int id)
 {
     DAL.LicençaDAL lbd = new DAL.LicençaDAL();
     return(lbd.Obter(id));
 }