예제 #1
0
        protected void Atualizar_Click(object sender, EventArgs e)
        {
            try
            {
                int imovel = Convert.ToInt32(Request.QueryString["prt"]);

                Entidades.Imovel Ent = new Entidades.Imovel();
                BLL.Imovel       BLL = new global::BLL.Imovel();

                string NomeImo   = NomeImov.Text.Replace("\r\n", "<BR>");
                string NumeroImo = Numero.Text.Replace("\r\n", "<BR>");

                Ent.Nome         = NomeImov.Text;
                Ent.Numero       = Convert.ToInt32(Numero.Text);
                Ent.Preco        = Convert.ToDouble(Preco.Text);
                Ent.Categoria    = Convert.ToInt32(ddlCategoria);
                Ent.SubCategoria = Convert.ToInt32(ddlSubCat);
                BLL.AlteraImovel(imovel, Ent);
                Response.Redirect("Produto_Lista.aspx");
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #2
0
        protected void Gravar_Click(object sender, EventArgs e)
        {
            try
            {
                var mensagem = string.Empty;

                Entidades.Imovel Ent = new Entidades.Imovel();
                BLL.Imovel       BLL = new global::BLL.Imovel();

                Ent.Nome_Imovel = Nome_Imovel.Text;
                Ent.Numero      = Convert.ToInt32(Numero.Text.ToString());
                Ent.Preco       = Convert.ToDouble(Preco.Text.ToString());
                //Ent.Ativo = Convert.ToInt32(Ativo.Text.ToString());
                Ent.Categoria    = Convert.ToInt32(ddlCategoria.SelectedValue.ToString());
                Ent.SubCategoria = Convert.ToInt32(SubCategoria.Text.ToString());
                BLL.InserirImovel(Ent);
                //Response.Redirect("Default.aspx");

                //if (this.IMG.HasFile)
                //{
                //    this.IMG.SaveAs(Server.MapPath("images/thumb/" + IMG.FileName));
                //    mensagem = "Imagem gravada com sucesso!";
                //    Entidades.Produtos Ent = new Entidades.Produtos();
                //    BLL.Produtos BLL = new global::BLL.Produtos();
                //    string Descri = Descricao.Text.Replace("\r\n", "<br>");
                //    string Especi = Especificacoes.Text.Replace("\r\n", "<br>");
                //string Descri = Descricao.Text.Replace("<br>", System.Environment.NewLine);
                //string Especi = Especificacoes.Text.Replace("<br>", System.Environment.NewLine);
                //string Descri = Descricao.Text.Replace(vbCrLf, "<br>");
                //string Especi = Especificacoes.Text.Replace(vbCrLf, "<br>");
                //    Ent.CodProduto = CodProd.Text;
                //    Ent.NomeProduto = NomeProd.Text;
                //    Ent.Descricao = Descri;
                //    Ent.Especificacoes = Especi;
                //    Ent.Categoria = Convert.ToInt32(ddlCategoria.SelectedValue.ToString());
                //    Ent.Imagem = IMG.FileName;
                //    BLL.InseriProduto(Ent);
                //    Response.Redirect("Default.aspx");
                //}
                //else
                //{

                //}
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }