示例#1
0
        protected override void BorrarActual()
        {
            string msg = string.Empty;

            if (CitaSeleccionada != null)
            {
                int Existe = ComprobarExistencia();
                if (Existe < 0)
                {
                    msg = "No se puede borrar porque no se ha insertado en la base de datos";
                }
                else
                {
                    db.TBLCITAPREVIA.Remove(CitaSeleccionada.LaCita);
                    ListaCitas.Remove(CitaSeleccionada);
                    db.SaveChanges();
                    RaisePropertyChanged("ListaCitas");
                    msg = "Borrado";
                }
            }
            else
            {
                msg = "Ningun usuario seleccionado";
            }
            MessageBox.Show(msg);
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            List <Cita> listaCitas = new List <Cita>();
            ListaCitas  lc         = new ListaCitas();

            listaCitas = lc.cargarCitas();

            Session["ListaCitas"] = listaCitas;

            if (Session["ListaCarrito"] == null)
            {
                List <Productos> ListaCarrito = new List <Productos>();
                Session["ListaCarrito"] = ListaCarrito;
            }
        }