Пример #1
0
        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            Label6.Text = "";
            Label8.Text = "";
            DropDownList2.Items.Clear();
            DAL.DALPagamento        SelectPagamento = new DAL.DALPagamento();
            List <Modelo.Pagamento> pagamentos      = SelectPagamento.SelectPagamento(int.Parse(DropDownList1.SelectedValue));
            int contador = 0;

            foreach (Modelo.Pagamento pagamento in pagamentos)
            {
                if (contador == 0)
                {
                    DropDownList2.Items.Add(new ListItem(pagamento.mesReferencia.ToString() + "/" + pagamento.anoReferencia.ToString(), pagamento.mesReferencia.ToString() + "/" + pagamento.anoReferencia.ToString()));
                }
                else
                {
                    if (DropDownList2.Items.Contains(DropDownList2.Items.FindByText(pagamento.mesReferencia.ToString() + "/" + pagamento.anoReferencia.ToString())))
                    {
                        DropDownList2.Items.Add(new ListItem(pagamento.mesReferencia.ToString() + "/" + pagamento.anoReferencia.ToString(), pagamento.mesReferencia.ToString() + "/" + pagamento.anoReferencia.ToString()));
                        DropDownList2.Items.RemoveAt(DropDownList2.Items.Count - 1);
                    }
                    else
                    {
                        DropDownList2.Items.Add(new ListItem(pagamento.mesReferencia.ToString() + "/" + pagamento.anoReferencia.ToString(), pagamento.mesReferencia.ToString() + "/" + pagamento.anoReferencia.ToString()));
                    }
                }
                contador = contador + 1;
            }
            DAL.DALFuncionario        SelectFuncionario = new DAL.DALFuncionario();
            List <Modelo.Funcionario> funcionarios1     = SelectFuncionario.Select(int.Parse(DropDownList1.SelectedValue));

            Label4.Text = funcionarios1[0].salario.ToString();
        }
Пример #2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            DAL.DALFuncionario        DelectFuncionario = new DAL.DALFuncionario();
            List <Modelo.Funcionario> Funcionario       = DelectFuncionario.Select(int.Parse(Request.QueryString["idFuncionario"]));

            DelectFuncionario.Delete(Funcionario[0].idFuncionario);
            Response.Redirect("./Funcionario.aspx");
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DAL.DALFuncionario        SelectFuncionarios = new DAL.DALFuncionario();
            List <Modelo.Funcionario> funcionarios       = SelectFuncionarios.Select(int.Parse(Request.QueryString["idFuncionario"]));

            Label8.Text       = funcionarios[0].nome;
            Label9.Text       = funcionarios[0].telefones;
            Label10.Text      = funcionarios[0].identidade;
            Label11.Text      = funcionarios[0].carteiradetrabalho;
            Label12.Text      = funcionarios[0].salario.ToString();
            CheckBox1.Checked = true;
            CheckBox2.Checked = true;
            CheckBox1.Checked = funcionarios[0].motorista;
            CheckBox2.Checked = funcionarios[0].tecnico;
            Label13.Text      = funcionarios[0].observacao;
        }
Пример #4
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            DAL.DALFuncionario        AtualizarFuncionario = new DAL.DALFuncionario();
            List <Modelo.Funcionario> funcionarios         = AtualizarFuncionario.Select(int.Parse(Request.QueryString["idFuncionario"]));

            funcionarios[0].nome               = TextBox1.Text;
            funcionarios[0].telefones          = TextBox2.Text;
            funcionarios[0].identidade         = TextBox3.Text;
            funcionarios[0].carteiradetrabalho = TextBox4.Text;
            funcionarios[0].salario            = Convert.ToDouble(TextBox5.Text);
            funcionarios[0].motorista          = Convert.ToBoolean(CheckBox1.Checked);
            funcionarios[0].tecnico            = Convert.ToBoolean(CheckBox2.Checked);
            funcionarios[0].observacao         = TextBox8.Text;
            AtualizarFuncionario.AtualizarFuncionario(funcionarios[0]);
            Response.Redirect("./Funcionario.aspx");
        }
Пример #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DAL.DALFuncionario        SelectCliente = new DAL.DALFuncionario();
         List <Modelo.Funcionario> funcionarios  = SelectCliente.Select(int.Parse(Request.QueryString["idFuncionario"]));
         TextBox1.Text     = funcionarios[0].nome;
         TextBox2.Text     = funcionarios[0].telefones;
         TextBox3.Text     = funcionarios[0].identidade;
         TextBox4.Text     = funcionarios[0].carteiradetrabalho;
         TextBox5.Text     = funcionarios[0].salario.ToString();
         CheckBox1.Checked = true;
         CheckBox2.Checked = true;
         CheckBox1.Checked = funcionarios[0].motorista;
         CheckBox2.Checked = funcionarios[0].tecnico;
         TextBox8.Text     = funcionarios[0].observacao;
     }
 }
Пример #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         DAL.DALFuncionario        SelectFuncionario = new DAL.DALFuncionario();
         List <Modelo.Funcionario> funcionarios      = SelectFuncionario.SelectAll();
         if (funcionarios.Count >= 1)
         {
             foreach (Modelo.Funcionario funcionario in funcionarios)
             {
                 DropDownList1.Items.Add(new ListItem(funcionario.nome, funcionario.idFuncionario.ToString()));
             }
             DAL.DALPagamento        SelectPagamento = new DAL.DALPagamento();
             List <Modelo.Pagamento> pagamentos      = SelectPagamento.SelectPagamento(int.Parse(DropDownList1.SelectedValue));
             int contador = 0;
             foreach (Modelo.Pagamento pagamento in pagamentos)
             {
                 if (contador == 0)
                 {
                     DropDownList2.Items.Add(new ListItem(pagamento.mesReferencia.ToString() + "/" + pagamento.anoReferencia.ToString(), pagamento.mesReferencia.ToString() + "/" + pagamento.anoReferencia.ToString()));
                 }
                 else
                 {
                     if (DropDownList2.Items.Contains(DropDownList2.Items.FindByText(pagamento.mesReferencia.ToString() + "/" + pagamento.anoReferencia.ToString())))
                     {
                         DropDownList2.Items.Add(new ListItem(pagamento.mesReferencia.ToString() + "/" + pagamento.anoReferencia.ToString(), pagamento.mesReferencia.ToString() + "/" + pagamento.anoReferencia.ToString()));
                         DropDownList2.Items.RemoveAt(DropDownList2.Items.Count - 1);
                     }
                     else
                     {
                         DropDownList2.Items.Add(new ListItem(pagamento.mesReferencia.ToString() + "/" + pagamento.anoReferencia.ToString(), pagamento.mesReferencia.ToString() + "/" + pagamento.anoReferencia.ToString()));
                     }
                 }
                 contador = contador + 1;
             }
             List <Modelo.Funcionario> funcionarios1 = SelectFuncionario.Select(int.Parse(DropDownList1.SelectedValue));
             Label4.Text = funcionarios1[0].salario.ToString();
         }
     }
 }