예제 #1
0
        private void btnCargarL_Click(object sender, EventArgs e)
        {
            {
                if (!AgendaDAL.Existe(Convert.ToInt32(cbmTera.SelectedValue)))
                {
                    Agenda pAgenda = new Agenda();
                    {
                        pAgenda.IdTerapeuta = (Int64)cbmTera.SelectedValue;
                        if (chbLunes1.Checked)
                        {
                            pAgenda.Lunes       = true;
                            pAgenda.IdTerapeuta = (Int64)cbmTera.SelectedValue;
                        }
                        if (chbMartes2.Checked)
                        {
                            pAgenda.Martes      = true;
                            pAgenda.IdTerapeuta = (Int64)cbmTera.SelectedValue;
                        }
                        if (chbMiercoles3.Checked)
                        {
                            pAgenda.Miércoles   = true;
                            pAgenda.IdTerapeuta = (Int64)cbmTera.SelectedValue;
                        }
                        if (chbJueves4.Checked)
                        {
                            pAgenda.Jueves      = true;
                            pAgenda.IdTerapeuta = (Int64)cbmTera.SelectedValue;
                        }
                        if (chbViernes5.Checked)
                        {
                            pAgenda.Viernes     = true;
                            pAgenda.IdTerapeuta = (Int64)cbmTera.SelectedValue;
                        }
                        if (chbSabado6.Checked)
                        {
                            pAgenda.Sabado      = true;
                            pAgenda.IdTerapeuta = (Int64)cbmTera.SelectedValue;
                        }
                        if (chbDomingo7.Checked)
                        {
                            pAgenda.Domingo     = true;
                            pAgenda.IdTerapeuta = (Int64)cbmTera.SelectedValue;
                        }

                        AgendaDAL.AgregarDia(pAgenda);
                        MessageBox.Show("Se agrego el DIA", "Dias Guardados", MessageBoxButtons.OK,
                                        MessageBoxIcon.Information);
                        btnModLab.Enabled = true;
                    }
                }
                else
                {
                    MessageBox.Show("Ya Se han Asiganado los dias al Terapeuta!", "Error", MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                }
            }
        }