protected void DWSaga_Init(object sender, EventArgs e)
        {
            int i;

            if (DWSaga != null)
            {
                sagaCAD       S       = new sagaCAD();
                List <String> nombres = new List <string>();
                listaSagas = S.listaSagas();
                for (i = 0; i < listaSagas.Count; i++)
                {
                    nombres.Add(listaSagas[i].Nombre);
                }
                DWSaga.DataSource = nombres;
                DWSaga.DataBind();
                DWSaga.Items.Insert(0, new ListItem("[Seleccionar]", "0"));
            }
            if (DWSaga.Items.Count == 1)
            {
                Btn_Borrar.Visible = false;
                Err1.ForeColor     = Color.Red;
                Err1.Visible       = true;
                Err1.Text          = "No quedan sagas";
            }
        }
示例#2
0
 public sagaEN mostrarSaga()
 {
     try
     {
         sagaCAD s = new sagaCAD();
         return(s.mostrarSaga(this.idSaga));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
示例#3
0
 public void borrarSaga()
 {
     try
     {
         sagaCAD s = new sagaCAD();
         s.borrarSaga(this.idSaga);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
示例#4
0
 public void anyadirSaga()
 {
     try
     {
         sagaCAD s = new sagaCAD();
         s.anyadirSaga(this);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
示例#5
0
        public List <sagaEN> listaSagas()
        {
            sagaCAD s = new sagaCAD();

            try
            {
                return(s.listaSagas());
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        protected void DWdia_Init(object sender, EventArgs e)
        {
            int        i;
            List <int> nums = new List <int>();

            if (DWdir != null)
            {
                directorCAD       d       = new directorCAD();
                directorEN        dir     = new directorEN();
                List <directorEN> dirlist = d.mostrarListaDirectores(dir);
                listaIdDir.Clear();
                nombres.Clear();
                for (i = 0; i < dirlist.Count; i++)
                {
                    nombres.Add(dirlist[i].Nombre + " " + dirlist[i].Apellidos);
                    listaIdDir.Add(dirlist[i].IdD);
                }
                DWdir.DataSource = nombres;
                DWdir.DataBind();
                DWdir.Items.Insert(0, new ListItem("[Seleccionar]", "0"));
            }
            if (DWdist != null)
            {
                DistribuidoraCAD dist = new DistribuidoraCAD();
                nombres.Clear();
                listaIdDist.Clear();
                List <distribuidoraEN> dlist = dist.mostrarListaDistribuidora();
                for (i = 0; i < dlist.Count; i++)
                {
                    nombres.Add(dlist[i].Nombre);
                    listaIdDist.Add(dlist[i].IdDis);
                }
                DWdist.DataSource = nombres;
                DWdist.DataBind();
                DWdist.Items.Insert(0, new ListItem("[Seleccionar]", "0"));
            }
            if (DWsaga != null)
            {
                sagaCAD dist = new sagaCAD();
                nombres.Clear();
                listaIdSag.Clear();
                List <sagaEN> dlist = dist.listaSagas();
                for (i = 0; i < dlist.Count; i++)
                {
                    nombres.Add(dlist[i].Nombre);
                    listaIdSag.Add(dlist[i].IDsaga);
                }
                DWsaga.DataSource = nombres;
                DWsaga.DataBind();
                DWsaga.Items.Insert(0, new ListItem("NINGUNA", "0"));
            }
            if (DWdia != null)
            {
                nums.Clear();
                for (i = 1; i < 32; i++)
                {
                    nums.Add(i);
                }
                DWdia.DataSource = nums;
                DWdia.DataBind();
            }
            if (DWmes != null)
            {
                nums.Clear();
                for (i = 1; i < 13; i++)
                {
                    nums.Add(i);
                }
                DWmes.DataSource = nums;
                DWmes.DataBind();
            }
            if (DWaño != null)
            {
                nums.Clear();
                for (i = 1900; i < 2019; i++)
                {
                    nums.Add(i);
                }
                DWaño.DataSource = nums;
                DWaño.DataBind();
            }
        }