Exemplo n.º 1
0
        private int checkusername(string username)
        {
            string sql = "SELECT * from nguoiDung WHERE username = '******';";

            ws = new kidmathwebserviceSoapClient();
            int check = ws.checkExistsAsync(sql).Result.Body.checkExistsResult;

            return(check);
        }
        private void Admin_StatisticalPage_Loaded(object sender, RoutedEventArgs e)
        {
            ws = new kidmathwebserviceSoapClient();
            List <khoaHoc> dskhoahoc = new List <khoaHoc>();

            dskhoahoc = ws.getDataKhoaHocAsync().Result.Body.getDataKhoaHocResult.ToList <khoaHoc>();
            dskhoahoc = dskhoahoc.FindAll(kh => kh.maKhoaHoc != "");
            adpage_statistical_dskhoahoc.ItemsSource = dskhoahoc;

            ws = new kidmathwebserviceSoapClient();
            soLuongNguoiDung.Text = ws.checkExistsAsync("select * from nguoiDung").Result.Body.checkExistsResult.ToString();
            ws = new kidmathwebserviceSoapClient();
            soLuongKhoaHocDaBan.Text = ws.checkExistsAsync("select * from muaKhoaHoc").Result.Body.checkExistsResult.ToString();
            ws = new kidmathwebserviceSoapClient();
            tongSoTienNguoiDungNap.Text = ws.doanhthu_functAsync().Result.ToString();
            ws = new kidmathwebserviceSoapClient();
            tongSoTienNguoiDungSuDung.Text = (Convert.ToInt32(tongSoTienNguoiDungNap.Text) - ws.nguoidungchi_functAsync().Result).ToString();
        }
Exemplo n.º 3
0
        private void checkbuy(string tenkhoahoc)
        {
            ws = new kidmathwebserviceSoapClient();
            khoaHoc temp = new khoaHoc();

            temp = ws.getDataKhoaHocAsync().Result.Body.getDataKhoaHocResult.ToList <khoaHoc>().Find(kh => kh.tenKhoaHoc == tenkhoahoc);
            string sql = "SELECT * FROM muaKhoaHoc WHERE muaKhoaHoc.username = '******' AND muaKhoaHoc.tenKhoaHoc ='" + tenkhoahoc + "';";

            ws = new kidmathwebserviceSoapClient();
            if (ws.checkExistsAsync(sql).Result.Body.checkExistsResult != 0)
            {
                ViewCoursePage_AfterBuy.khoahocduocmua = temp;
                this.Frame.Navigate(typeof(ViewCoursePage_AfterBuy));
            }
            else
            {
                BuyCoursePage.khoahocduocmua = temp;
                this.Frame.Navigate(typeof(BuyCoursePage));
            }
        }
Exemplo n.º 4
0
        private void tap_khoahoc(object sender, TappedRoutedEventArgs e)
        {
            ws = new kidmathwebserviceSoapClient();
            StackPanel khoahocduocchon = sender as StackPanel;
            khoaHoc    temp            = khoahocduocchon.DataContext as khoaHoc;

            Chinhsuakhoahoc.khoahoccanchinhsua = temp;
            temp = ws.getDataKhoaHocAsync().Result.Body.getDataKhoaHocResult.ToList <khoaHoc>().Find(kh => kh.maKhoaHoc == temp.maKhoaHoc);
            string sql = "SELECT * FROM muaKhoaHoc WHERE muaKhoaHoc.username = '******' AND muaKhoaHoc.maKhoaHoc ='" + temp.maKhoaHoc + "';";

            ws = new kidmathwebserviceSoapClient();
            if (ws.checkExistsAsync(sql).Result.Body.checkExistsResult != 0)
            {
                ViewCoursePage_AfterBuy.khoahocduocmua = temp;
                this.Frame.Navigate(typeof(ViewCoursePage_AfterBuy));
            }
            else
            {
                BuyCoursePage.khoahocduocmua = temp;
                this.Frame.Navigate(typeof(BuyCoursePage));
            }
        }