Beispiel #1
0
        public Studentlist()
        {
            InitializeComponent();

            studentdb = new StudentDB();
            var stu = studentdb.GetStudents();

            listviewstudentlist.ItemsSource = stu;
        }
        public void Getdata(Object o, EventArgs e)
        {
            studentdb = new StudentDB();
            Student stu = studentdb.GetStudent(Convert.ToInt32(id1.Text));

            name.Text    = stu.Name;
            address.Text = stu.Address;
            phone.Text   = stu.Phone;
        }
Beispiel #3
0
        public Studentlist(int id)
        {
            studentdb = new StudentDB();
            Student        stu = studentdb.GetStudent(id);
            List <Student> sb  = new List <Student>();

            sb.Add(new Student {
                Address = stu.Address
            });
            //sb.Add(new Student { Phone = stu.Phone });
            listviewstudentlist.ItemsSource = sb;
        }
        public void updatedata(Object o, EventArgs e)
        {
            //string folder = System.Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            //var conn = new SQLiteConnection(System.IO.Path.Combine(folder, "stocks.db"));
            //conn.CreateTable<Student>();
            //conn.CreateTable<Valuation>();
            // string path = db.DatabasePath;

            studentdb    = new StudentDB();
            student      = new Student();
            student.Id   = Convert.ToInt32(id1.Text);
            student.Name = name.Text;

            student.Address = address.Text;
            //student.Phone = phone.Text;
            //studentdb.AddStusent(student);
            studentdb.UpdateStudent(student);
            //studentdb.DeleteStudent(Convert.ToInt32(student.Name));
        }
        public async void adddata(Object o, EventArgs e)
        {
            //string folder = System.Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            //var conn = new SQLiteConnection(System.IO.Path.Combine(folder, "stocks.db"));
            //conn.CreateTable<Student>();
            //conn.CreateTable<Valuation>();
            // string path = db.DatabasePath;
            await GetConferences().ConfigureAwait(false);

            studentdb  = new StudentDB();
            student    = new Student();
            _SkuMaster = new SkuMaster();

            // this result string should be something like: "{"token":"rgh2ghgdsfds"}"

            //student.Id =Convert.ToInt32(id1.Text);
            student.Name = name.Text;

            student.Address = address.Text;
            student.Phone   = phone.Text;
            studentdb.AddStusent(student);
            //studentdb.UpdateStudent(student);
            //studentdb.DeleteStudent(Convert.ToInt32(student.Name));
        }