Esempio n. 1
0
 public void guardarmedicina(Umedicina datos)
 {
     Medicapp13Context.Medicapp13DataContext conec = new Medicapp13Context.Medicapp13DataContext();
     Medicapp13Context.Medicina medicina           = new Medicapp13Context.Medicina();
     medicina.NombreMedicina = datos.Medicina;
     conec.Medicinas.InsertOnSubmit(medicina);
     conec.SubmitChanges();
 }
Esempio n. 2
0
        public DataTable mostrarmedicinas()
        {
            DataTable medicina = new DataTable();

            Medicapp13Context.Medicapp13DataContext conec = new Medicapp13Context.Medicapp13DataContext();
            Medicapp13Context.Medicina        medicinas   = new Medicapp13Context.Medicina();
            List <Medicapp13Context.Medicina> med         = conec.Medicinas.ToList <Medicapp13Context.Medicina>();
            Udatatable data = new Udatatable();

            medicina = data.ToDataTable(med);

            return(medicina);
        }