示例#1
0
 protected void rptProduto_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         pPecas P            = (pPecas)e.Item.DataItem;
         Label  lblCod_Pecas = (Label)e.Item.FindControl("lblCod_Pecas");
         lblCod_Pecas.Text = P.Cod_Pecas.ToString();
         Label lblDescricao = (Label)e.Item.FindControl("lblDescricao");
         lblDescricao.Text = P.Descricao.ToString();
         Label lblFabricante = (Label)e.Item.FindControl("lblFabricante");
         lblFabricante.Text = P.Fabricante.ToString();
         Label lblModelo = (Label)e.Item.FindControl("lblModelo");
         lblModelo.Text = P.Modelo.ToString();
         Label lblEstoque = (Label)e.Item.FindControl("lblEstoque");
         lblEstoque.Text = P.Quantidade.ToString();
         Label lblValor_Saida = (Label)e.Item.FindControl("lblValor_Saida");
         lblValor_Saida.Text = P.Valor_Saida.ToString("#,##0.00");
         //CheckBox Chk = (CheckBox)Rpt.FindControl("ChkMais");
         //int E;
         //E =Convert.ToInt32(lblEstoque.Text);
         //if (E > 0)
         //{
         //    Chk.Visible = false;
         //}
         //else
         //{
         //    Chk.Enabled = true;
         //}
     }
 }
示例#2
0
 protected void btnEnviar_Click(object sender, EventArgs e)
 {
     if (txtDescricao.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtDescricao.Focus();
         return;
     }
     else if (txtFabricante.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtFabricante.Focus();
         return;
     }
     else if (txtModelo.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtModelo.Focus();
         return;
     }
     else if (txtValor_Entrada.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtValor_Entrada.Focus();
         return;
     }
     else if (txtValor_Saida.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtValor_Saida.Focus();
         return;
     }
     else if (txtQuantidade.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtQuantidade.Focus();
         return;
     }
     else
     {
         Msg("Peça cadastrada com sucesso!");
         pPecas P = new pPecas();
         P.Descricao        = txtDescricao.Text;
         P.Fabricante       = txtFabricante.Text;
         P.Modelo           = txtModelo.Text;
         P.Valor_Entrada    = Convert.ToDecimal(txtValor_Entrada.Text);
         P.Valor_Saida      = Convert.ToDecimal(txtValor_Saida.Text);
         P.Quantidade       = Convert.ToInt32(txtQuantidade.Text);
         P.Cod_FornecedorFK = Convert.ToInt32(ddlFornecedor.Text);
         mPecas M = new mPecas();
         M.InsPecas(P);
         LimparContato();
     }
 }
示例#3
0
 protected void btnEnviar_Click(object sender, EventArgs e)
 {
     if (txtDescricao.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtDescricao.Focus();
         return;
     }
     else if (txtFabricante.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtFabricante.Focus();
         return;
     }
     else if (txtModelo.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtModelo.Focus();
         return;
     }
     else if (txtValor_Entrada.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtValor_Entrada.Focus();
         return;
     }
     else if (txtValor_Saida.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtValor_Saida.Focus();
         return;
     }
     else if (txtQuantidade.Text == string.Empty)
     {
         Msg("Campo obrigatório em branco!");
         txtQuantidade.Focus();
         return;
     }
     else
     {
         Msg("Peça cadastrada com sucesso!");
         pPecas P = new pPecas();
         P.Descricao = txtDescricao.Text;
         P.Fabricante = txtFabricante.Text;
         P.Modelo = txtModelo.Text;
         P.Valor_Entrada = Convert.ToDecimal(txtValor_Entrada.Text);
         P.Valor_Saida = Convert.ToDecimal(txtValor_Saida.Text);
         P.Quantidade = Convert.ToInt32(txtQuantidade.Text);
         P.Cod_FornecedorFK = Convert.ToInt32(ddlFornecedor.Text);
         mPecas M = new mPecas();
         M.InsPecas(P);
         LimparContato();
     }
 }
示例#4
0
        protected void gdvPecas_SelectedIndexChanged(object sender, EventArgs e)
        {
            List <pPecas> LP = new List <pPecas>();
            pPecas        P  = new pPecas();

            P.Cod_Pecas   = Convert.ToInt32(gdvPecas.SelectedRow.Cells[0].Text);
            P.Descricao   = gdvPecas.SelectedRow.Cells[1].Text;
            P.Fabricante  = gdvPecas.SelectedRow.Cells[2].Text;
            P.Modelo      = gdvPecas.SelectedRow.Cells[3].Text;
            P.Valor_Saida = Convert.ToDecimal(gdvPecas.SelectedRow.Cells[4].Text);
            P.Quantidade  = Convert.ToInt32(gdvPecas.SelectedRow.Cells[5].Text);
            LP.Add(P);
            rptProduto.DataSource = LP;
            rptProduto.DataBind();
        }
 protected void btnAlterar_Click(object sender, EventArgs e)
 {
     Msg("Peça alterada com sucesso!");
     int Cod_Pecas = Convert.ToInt32(txtConsulta.Text);
     pPecas P = new pPecas();
     P.Descricao = txtDescricao.Text;
     P.Fabricante = txtFabricante.Text;
     P.Modelo = txtModelo.Text;
     P.Valor_Entrada = Convert.ToDecimal(txtValor_Entrada.Text);
     P.Valor_Saida = Convert.ToDecimal(txtValor_Saida.Text);
     P.Quantidade = Convert.ToInt32(txtQuantidade.Text);
     P.Cod_Pecas = Convert.ToInt32(lblCodPecas.Text);
     mPecas M = new mPecas();
     M.AtuPecas(P);
     ListarGrid();
     LimparContatos();
 }
示例#6
0
 protected void rptProduto_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         pPecas P            = (pPecas)e.Item.DataItem;
         Label  lblCod_Pecas = (Label)e.Item.FindControl("lblCod_Pecas");
         lblCod_Pecas.Text = P.Cod_Pecas.ToString();
         Label lblDescricao = (Label)e.Item.FindControl("lblDescricao");
         lblDescricao.Text = P.Descricao.ToString();
         Label lblFabricante = (Label)e.Item.FindControl("lblFabricante");
         lblFabricante.Text = P.Fabricante.ToString();
         Label lblModelo = (Label)e.Item.FindControl("lblModelo");
         lblModelo.Text = P.Modelo.ToString();
         Label lblEstoque = (Label)e.Item.FindControl("lblEstoque");
         lblEstoque.Text = P.Quantidade.ToString();
         Label lblValor_Saida = (Label)e.Item.FindControl("lblValor_Saida");
         lblValor_Saida.Text = P.Valor_Saida.ToString("#,##0.00");
     }
 }
示例#7
0
        protected void btnAlterar_Click(object sender, EventArgs e)
        {
            Msg("Peça alterada com sucesso!");
            int    Cod_Pecas = Convert.ToInt32(txtConsulta.Text);
            pPecas P         = new pPecas();

            P.Descricao     = txtDescricao.Text;
            P.Fabricante    = txtFabricante.Text;
            P.Modelo        = txtModelo.Text;
            P.Valor_Entrada = Convert.ToDecimal(txtValor_Entrada.Text);
            P.Valor_Saida   = Convert.ToDecimal(txtValor_Saida.Text);
            P.Quantidade    = Convert.ToInt32(txtQuantidade.Text);
            P.Cod_Pecas     = Convert.ToInt32(lblCodPecas.Text);
            mPecas M = new mPecas();

            M.AtuPecas(P);
            ListarGrid();
            LimparContatos();
        }
示例#8
0
        public List <pPecas> SelPecas(int Cod_Pecas)
        {
            Dao           D  = new Dao();
            DataTable     DT = D.SelPecas(Cod_Pecas);
            List <pPecas> LC = new List <pPecas>();

            for (int i = 0; i < DT.Rows.Count; i++)
            {
                pPecas P = new pPecas();
                P.Cod_Pecas     = Convert.ToInt32(DT.Rows[i]["Cod_Pecas"]);
                P.Descricao     = DT.Rows[i]["Descricao"].ToString();
                P.Fabricante    = DT.Rows[i]["Fabricante"].ToString();
                P.Modelo        = DT.Rows[i]["Modelo"].ToString();
                P.Valor_Entrada = Convert.ToDecimal(DT.Rows[i]["Valor_Entrada"]);
                P.Valor_Saida   = Convert.ToDecimal(DT.Rows[i]["Valor_Saida"]);
                P.Quantidade    = Convert.ToInt32(DT.Rows[i]["Quantidade"]);
                LC.Add(P);
            }
            return(LC);
        }
示例#9
0
 public List<pPecas> SelRepeater()
 {
     Dao D = new Dao();
     DataTable DT = D.SelRepeater();
     List<pPecas> LC = new List<pPecas>();
     for (int i = 0; i < DT.Rows.Count; i++)
     {
         pPecas P = new pPecas();
         P.Cod_Pecas = Convert.ToInt32(DT.Rows[i]["Cod_Pecas"]);
         P.Descricao = DT.Rows[i]["Descricao"].ToString();
         P.Fabricante = DT.Rows[i]["Fabricante"].ToString();
         P.Modelo = DT.Rows[i]["Modelo"].ToString();
         P.Valor_Entrada = Convert.ToDecimal(DT.Rows[i]["Valor_Entrada"]);
         P.Valor_Saida = Convert.ToDecimal(DT.Rows[i]["Valor_Saida"]);
         P.Quantidade = Convert.ToInt32(DT.Rows[i]["Quantidade"]);
         LC.Add(P);
     }
     return LC;
 }
示例#10
0
 public void InsPecas(pPecas P)
 {
     Dao D = new Dao();
     D.InsPecas(P.Descricao, P.Fabricante, P.Modelo, P.Valor_Entrada, P.Valor_Saida, P.Quantidade, P.Cod_FornecedorFK);
 }
示例#11
0
 public void AtuPecas(pPecas P)
 {
     Dao D = new Dao();
     D.AtuPecas(P.Cod_Pecas, P.Descricao, P.Fabricante, P.Modelo, P.Valor_Entrada, P.Valor_Saida, P.Quantidade);
 }
示例#12
0
        public void AtuPecas(pPecas P)
        {
            Dao D = new Dao();

            D.AtuPecas(P.Cod_Pecas, P.Descricao, P.Fabricante, P.Modelo, P.Valor_Entrada, P.Valor_Saida, P.Quantidade);
        }
示例#13
0
        public void InsPecas(pPecas P)
        {
            Dao D = new Dao();

            D.InsPecas(P.Descricao, P.Fabricante, P.Modelo, P.Valor_Entrada, P.Valor_Saida, P.Quantidade, P.Cod_FornecedorFK);
        }
示例#14
0
 protected void gdvPecas_SelectedIndexChanged(object sender, EventArgs e)
 {
     List<pPecas> LP = new List<pPecas>();
     pPecas P = new pPecas();
     P.Cod_Pecas = Convert.ToInt32(gdvPecas.SelectedRow.Cells[0].Text);
     P.Descricao = gdvPecas.SelectedRow.Cells[1].Text;
     P.Fabricante = gdvPecas.SelectedRow.Cells[2].Text;
     P.Modelo = gdvPecas.SelectedRow.Cells[3].Text;
     P.Valor_Saida = Convert.ToDecimal(gdvPecas.SelectedRow.Cells[4].Text);
     P.Quantidade = Convert.ToInt32(gdvPecas.SelectedRow.Cells[5].Text);
     LP.Add(P);
     rptProduto.DataSource = LP;
     rptProduto.DataBind();
 }