Example #1
0
 private void FindButton_Click(object sender, RoutedEventArgs e)
 {
     if (txttim.Text.Trim() != "")
     {
         QLThuebaoDomainContext db = new QLThuebaoDomainContext();
         if (chkInt.IsChecked == true)
         {
             EntityQuery<internet> Query = db.GetInternetsQuery();
             LoadOperation<internet> Load = db.Load(Query.Where(p => p.user_name.Trim().Contains(txttim.Text.Trim())).OrderBy(p => p.ma_huyen), lo =>
             {
                 gridInt.Visibility = Visibility.Visible;
                 gridmy.Visibility = Visibility.Collapsed;
                 gridInt.ItemsSource = lo.Entities;                      
             }, null);
         }
         else
         {
             EntityQuery<mytv> Query = db.GetMytvsQuery();
             LoadOperation<mytv> Load = db.Load(Query.Where(p => p.user_name.Trim().Contains(txttim.Text.Trim())).OrderBy(p=>p.ma_huyen), lo =>
             {
                 gridInt.Visibility = Visibility.Collapsed;
                 gridmy.Visibility = Visibility.Visible;
                 gridmy.ItemsSource = lo.Entities;                        
             }, null);
         }
     }
 }
Example #2
0
 void Completed(object sende, EventArgs e)
 {
     string m_huyen = App.nhomtd.Length>30 ? App.nhomtd + ";WWW": App.nhomtd;
     QLThuebaoDomainContext dstb = new QLThuebaoDomainContext();
     EntityQuery<rp_tktonghop> Query = dstb.GetRp_tktonghopQuery();
     LoadOperation<rp_tktonghop> LoadOp = dstb.Load(Query.Where(p => m_huyen.Contains(p.ma_dv.Trim())).OrderBy(p => p.ma_dv), LoadOp_Complete, null);
 }
 void Completed(object sende, EventArgs e)
 {
     QLThuebaoDomainContext db = new QLThuebaoDomainContext();
     EntityQuery<rp_dt_diaban> Query = db.GetRp_dt_diabanQuery();
     LoadOperation<rp_dt_diaban> LoadOp = db.Load(Query.Where(p => App.nhomtd.Contains(p.ma_huyen)).OrderBy(p => p.ma_huyen).OrderBy(p => p.ten_tuyen), LoadOp_Complete, null);
        
 }
 void Completed(object sende, EventArgs e)
 {
     string m_huyen = App.nhomtd;
     QLThuebaoDomainContext dstb = new QLThuebaoDomainContext();
     EntityQuery<rp_tklydocat> Query = dstb.GetRp_tklydocatQuery();
     LoadOperation<rp_tklydocat> LoadOp = dstb.Load(Query.OrderBy(p => p.ma_dv), LoadOp_Complete, null);
 }
        void dien_dl(string mloai, string mbd,string mhuyen,DateTime ngaybd, DateTime ngaykt) //mbd M: hoa mang N: ngung C: cat T:thtb
        {
            QLThuebaoDomainContext dstb = new QLThuebaoDomainContext();
            // loai co dinh
            if (mloai == "C")
            {
                EntityQuery<codinh_log> Query = dstb.GetCodinh_logQuery();
                LoadOperation<codinh_log> Load = dstb.Load(Query.Where(p => p.ma_huyen == mhuyen && p.lydocat == mbd && p.ngay_ngung >= ngaybd && p.ngay_ngung <= ngaykt), LoadOpCDComplete, null);
                
            }

            // loai Gphone
            if (mloai == "G")
            {
                EntityQuery<Gphone_log> Query = dstb.GetGphone_logQuery();
                LoadOperation<Gphone_log> Load = dstb.Load(Query.Where(p => p.ma_huyen == mhuyen && p.lydocat == mbd && p.ngay_ngung >= ngaybd && p.ngay_ngung <= ngaykt && p.loai_tb == false), LoadOpGPComplete, null);
                
            }

         
            // loai MyTV
            if (mloai == "M")
            {
               EntityQuery<mytv_log> Query = dstb.GetMytv_logQuery();
               LoadOperation<mytv_log> Load = dstb.Load(Query.Where(p => p.ma_huyen == mhuyen && p.lydocat == mbd && p.ngay_ngung >= ngaybd && p.ngay_ngung <= ngaykt), LoadOpMYComplete, null);
            
            }


            // loai internet
            if (mloai == "I")
            {
                 EntityQuery<internet_log> Query = dstb.GetInternet_logQuery();
                 LoadOperation<internet_log> Load = dstb.Load(Query.Where(p => p.ma_huyen == mhuyen && p.ma_dv == "ADSL" && p.lydocat == mbd && p.ngay_ngung >= ngaybd && p.ngay_ngung <= ngaykt), LoadOpINTComplete, null);               
            }

            // loai ftth
            if (mloai == "F")
            { 
                EntityQuery<internet_log> Query = dstb.GetInternet_logQuery();
                LoadOperation<internet_log> Load = dstb.Load(Query.Where(p => p.ma_huyen == mhuyen && p.ma_dv == "FIBER" && p.lydocat == mbd && p.ngay_ngung >= ngaybd && p.ngay_ngung <= ngaykt), LoadOpINTComplete, null);
                
            }

        }
        void get_data()
        {
            //grid.ShowLoadingPanel = true;
            //grid1.ShowLoadingPanel = true;
            QLThuebaoDomainContext db = new QLThuebaoDomainContext();
            if (App.admin_119)
            {
                EntityQuery<dssuaxong_119> Query = db.GetDssuaxong_119Query();
                LoadOperation<dssuaxong_119> LoadOp = db.Load(Query.Where(p=>p.bfinished==true).OrderByDescending(p => p.dtRecvTime), LoadOp_Complete, null);
            }
            else
            {
                EntityQuery<dssuaxong_119> Query = db.GetDssuaxong_119Query();
                LoadOperation<dssuaxong_119> LoadOp = db.Load(Query.Where(p =>App.nhomtd.Contains(p.ma_huyen) && p.bfinished==true).OrderByDescending(p => p.dtRecvTime), LoadOp_Complete, null);
            }

            EntityQuery<tkloai119> Querys = db.GetTkloai119Query();
            LoadOperation<tkloai119> LoadOps = db.Load(Querys.OrderBy(p => p.istatusID), LoadOps_Complete, null);
        }
Example #7
0
 void GetData(object sender, EventArgs e)
 {
     grid.ShowLoadingPanel = true;
     QLThuebaoDomainContext db = new QLThuebaoDomainContext();           
     if (App.admin_119)
     {
         EntityQuery<ds_119> Query = db.GetDs_119Query();
         LoadOperation<ds_119> LoadOp = db.Load(Query.OrderByDescending(p => p.dtRecvTime), LoadOp_Complete, null);
         EntityQuery<dsw_119> Query1 = db.GetDsw_119Query();
         LoadOperation<dsw_119> LoadOp1 = db.Load(Query1.OrderByDescending(p => p.dtRecvTime), LoadOp1_Complete, null);
     }
     else
     {
         EntityQuery<ds_119> Query = db.GetDs_119Query();
         LoadOperation<ds_119> LoadOp = db.Load(Query.Where(p => App.nhomtd.Contains(p.ma_huyen)).OrderByDescending(p => p.dtRecvTime), LoadOp_Complete, null);
         EntityQuery<dsw_119> Query1 = db.GetDsw_119Query();
         LoadOperation<dsw_119> LoadOp1 = db.Load(Query1.Where(p => App.nhomtd.Contains(p.ma_huyen)).OrderByDescending(p => p.dtRecvTime), LoadOp1_Complete, null);
     }
 }
 void dien_dl()
 {
     int m_kt;            
     m_kt = dngaykt.DateTime.Month;            
     QLThuebaoDomainContext db = new QLThuebaoDomainContext();
     EntityQuery<khachhangDN> Query = db.GetKhachhangDNQuery();
     if (checkEdit1.IsChecked == true)
     {
         LoadOperation<khachhangDN> Load = db.Load(Query.Where(p =>p.ngay_tl.Value.Month == m_kt).OrderBy(p => p.ngay_tl), lo =>
         {
             gridControl1.ItemsSource = lo.Entities;
             this.Title = "Khách hàng là doanh nghiệp : " + lo.Entities.Count().ToString();
         }, true);
     }
     else
     {
         LoadOperation<khachhangDN> Load = db.Load(Query.Where(p => p.ngay_tl.Value >= dngaybd.DateTime && p.ngay_tl.Value <= dngaykt.DateTime).OrderBy(p => p.ngay_tl), lo =>
         {
             gridControl1.ItemsSource = lo.Entities;
             this.Title = "Khách hàng là doanh nghiệp : " + lo.Entities.Count().ToString();
         }, true);
     }
 }
Example #9
0
        void search()
        {
            gridControl1.ItemsSource = null;
            gridControl1.ShowLoadingPanel = true;
            QLThuebaoDomainContext db = new QLThuebaoDomainContext();
            //if ((txtsodt.Text.Trim() != "" || txtsodt.Text.Trim() != "0") && txtsodt.Text.Trim().Length < 7)
            //{
            //    MessageBox.Show("Nhập chưa đúng số điện thoại !");
            //    return;
            //}
            if (txtsodt.Text.Trim() != "" && txtsodt.Text.Trim() !="0")
            {
                EntityQuery<DSCD> Query = db.Getds1080Query(txtsodt.Text.Trim());
                LoadOperation<DSCD> Load = db.Load(Query, LoadOpComplete, null);
            }
            if (txttentb.Text.Trim() != "" && txtdcld.Text.Trim() == "" && txtttin108.Text.Trim() == "")
            {
                EntityQuery<DSCD> Query = db.Getds10801Query(txttentb.Text.Trim());
                LoadOperation<DSCD> Load = db.Load(Query, LoadOpComplete, null);
            }

            if (txttentb.Text.Trim() != "" && txtdcld.Text.Trim() != "" && txtttin108.Text.Trim() == "")
            {
                EntityQuery<DSCD> Query = db.Getds10802Query(txttentb.Text.Trim(), txtdcld.Text.Trim());
                LoadOperation<DSCD> Load = db.Load(Query, LoadOpComplete, null);
            }

            if (txttentb.Text.Trim() != "" && txtdcld.Text.Trim() != "" && txtttin108.Text.Trim() != "")
            {
                EntityQuery<DSCD> Query = db.Getds10803Query(txttentb.Text.Trim(), txtdcld.Text.Trim(), txtttin108.Text.Trim());
                LoadOperation<DSCD> Load = db.Load(Query, LoadOpComplete, null);
            }

            if (txttentb.Text.Trim() == "" && txtdcld.Text.Trim() == "" && txtttin108.Text.Trim() != "")
            {
                EntityQuery<DSCD> Query = db.Getds10804Query(txtttin108.Text.Trim());
                LoadOperation<DSCD> Load = db.Load(Query, LoadOpComplete, null);
            }
            if (txttentb.Text.Trim() == "" && txtdcld.Text.Trim() != "" && txtttin108.Text.Trim() == "")
            {
                EntityQuery<DSCD> Query = db.Getds10805Query(txtdcld.Text.Trim());
                LoadOperation<DSCD> Load = db.Load(Query, LoadOpComplete, null);
            }
        }
 void laythongtin()
 {
     QLThuebaoDomainContext dbs = new QLThuebaoDomainContext();
     EntityQuery<ma_diaban> Query = dbs.GetMa_diabanQuery();
     LoadOperation<ma_diaban> Load = dbs.Load(Query.Where(p => p.ma_huyen == App.ma_huyen && p.kt == App.kythuat), lo => { gridControl1.ItemsSource = lo.Entities; }, null);             
 }
        void dien_dl(string mloai, string mbd,string mhuyen,DateTime ngaybd, DateTime ngaykt) //mbd M: hoa mang N: ngung C: cat T:thtb
        {
            QLThuebaoDomainContext dstb = new QLThuebaoDomainContext();
            // loai co dinh
            if (mloai == "C")
            {
                
                switch( mbd)
                {
                    case "T":
                        EntityQuery<codinh_log> Query = dstb.GetCodinh_logQuery();
                        LoadOperation<codinh_log> Load = dstb.Load(Query.Where(p => p.ma_huyen == mhuyen && (p.may_ngung == "C" || p.may_ngung == "N") && p.ngay_ngung >= ngaybd && p.ngay_ngung <= ngaykt), LoadOpCDComplete, null);
                        break;
                    case "M":
                        EntityQuery<codinh_log> QueryM = dstb.GetCodinh_logQuery();
                        LoadOperation<codinh_log> LoadM = dstb.Load(QueryM.Where(p => p.ma_huyen == mhuyen && p.ngay_hd >= ngaybd && p.ngay_hd <= ngaykt), LoadOpCDComplete, null);
                        break;
                    
                    default:
                        EntityQuery<codinh_log> Queryd = dstb.GetCodinh_logQuery();
                        LoadOperation<codinh_log> Loadd = dstb.Load(Queryd.Where(p => p.ma_huyen == mhuyen && p.may_ngung == mbd && p.ngay_ngung >= ngaybd && p.ngay_ngung <= ngaykt), LoadOpCDComplete, null);
                        break;
                }
            }

            // loai Gphone
            if (mloai == "G")
            {

                switch (mbd)
                {
                    case "T":
                        EntityQuery<Gphone_log> Query = dstb.GetGphone_logQuery();
                        LoadOperation<Gphone_log> Load = dstb.Load(Query.Where(p => p.ma_huyen == mhuyen && (p.may_ngung == "C" || p.may_ngung == "N") && p.ngay_ngung >= ngaybd && p.ngay_ngung <= ngaykt && p.loai_tb == false), LoadOpGPComplete, null);
                        break;
                    case "M":
                        EntityQuery<Gphone_log> QueryM = dstb.GetGphone_logQuery();
                        LoadOperation<Gphone_log> LoadM = dstb.Load(QueryM.Where(p => p.ma_huyen == mhuyen && p.ngay_hd >= ngaybd && p.ngay_hd <= ngaykt && p.loai_tb == false), LoadOpGPComplete, null);
                        break;
                    default:
                        EntityQuery<Gphone_log> Queryd = dstb.GetGphone_logQuery();
                        LoadOperation<Gphone_log> Loadd = dstb.Load(Queryd.Where(p => p.ma_huyen == mhuyen && p.may_ngung == mbd && p.ngay_ngung >= ngaybd && p.ngay_ngung <= ngaykt && p.loai_tb == false), LoadOpGPComplete, null);
                        break;
                }
            }

            // loai Gphone
            if (mloai == "GT")
            {

                switch (mbd)
                {
                    case "T":
                        EntityQuery<Gphone_log> Query = dstb.GetGphone_logQuery();
                        LoadOperation<Gphone_log> Load = dstb.Load(Query.Where(p => p.ma_huyen == mhuyen && (p.may_ngung == "C" || p.may_ngung == "N") && p.ngay_ngung >= ngaybd && p.ngay_ngung <= ngaykt && p.loai_tb == true), LoadOpGPComplete, null);
                        break;
                    case "M":
                        EntityQuery<Gphone_log> QueryM = dstb.GetGphone_logQuery();
                        LoadOperation<Gphone_log> LoadM = dstb.Load(QueryM.Where(p => p.ma_huyen == mhuyen && p.ngay_hd >= ngaybd && p.ngay_hd <= ngaykt && p.loai_tb == true), LoadOpGPComplete, null);
                        break;
                    default:
                        EntityQuery<Gphone_log> Queryd = dstb.GetGphone_logQuery();
                        LoadOperation<Gphone_log> Loadd = dstb.Load(Queryd.Where(p => p.ma_huyen == mhuyen && p.may_ngung == mbd && p.ngay_ngung >= ngaybd && p.ngay_ngung <= ngaykt && p.loai_tb == true), LoadOpGPComplete, null);
                        break;
                }
            }


            // loai MyTV
            if (mloai == "M")
            {

                switch (mbd)
                {
                    case "T":
                        EntityQuery<mytv_log> Query = dstb.GetMytv_logQuery();
                        LoadOperation<mytv_log> Load = dstb.Load(Query.Where(p => p.ma_huyen == mhuyen && (p.tinh_trang == "C" || p.tinh_trang == "N") && p.ngay_ngung >= ngaybd && p.ngay_ngung <= ngaykt), LoadOpMYComplete, null);
                        break;
                    case "M":
                        EntityQuery<mytv_log> QueryM = dstb.GetMytv_logQuery();
                        LoadOperation<mytv_log> LoadM = dstb.Load(QueryM.Where(p => p.ma_huyen == mhuyen && p.ngay_hd >= ngaybd && p.ngay_hd <= ngaykt), LoadOpMYComplete, null);
                        break;
                    default:
                        EntityQuery<mytv_log> Queryd = dstb.GetMytv_logQuery();
                        LoadOperation<mytv_log> Loadd = dstb.Load(Queryd.Where(p => p.ma_huyen == mhuyen && p.tinh_trang == mbd && p.ngay_ngung >= ngaybd && p.ngay_ngung <= ngaykt), LoadOpMYComplete, null);
                        break;
                }
            }


            // loai internet
            if (mloai == "I")
            {

                switch (mbd)
                {
                    case "T":
                        EntityQuery<internet_log> Query = dstb.GetInternet_logQuery();
                        LoadOperation<internet_log> Load = dstb.Load(Query.Where(p => p.ma_huyen == mhuyen && p.ma_dv == "ADSL" && (p.may_ngung == "C" || p.may_ngung == "N") && p.ngay_ngung >= ngaybd && p.ngay_ngung <= ngaykt), LoadOpINTComplete, null);
                        break;
                    case "M":
                        EntityQuery<internet_log> QueryM = dstb.GetInternet_logQuery();
                        LoadOperation<internet_log> LoadM = dstb.Load(QueryM.Where(p => p.ma_huyen == mhuyen && p.ma_dv == "ADSL" && p.ngay_hd >= ngaybd && p.ngay_hd <= ngaykt), LoadOpINTComplete, null);
                        break;
                    default:
                        EntityQuery<internet_log> Queryd = dstb.GetInternet_logQuery();
                        LoadOperation<internet_log> Loadd = dstb.Load(Queryd.Where(p => p.ma_huyen == mhuyen && p.ma_dv == "ADSL" && p.may_ngung == mbd && p.ngay_ngung >= ngaybd && p.ngay_ngung <= ngaykt), LoadOpINTComplete, null);
                        break;
                }
            }

            // loai ftth
            if (mloai == "F")
            {

                switch (mbd)
                {
                    case "T":
                        EntityQuery<internet_log> Query = dstb.GetInternet_logQuery();
                        LoadOperation<internet_log> Load = dstb.Load(Query.Where(p => p.ma_huyen == mhuyen && p.ma_dv == "FIBER" && (p.may_ngung == "C" || p.may_ngung == "N") && p.ngay_ngung >= ngaybd && p.ngay_ngung <= ngaykt), LoadOpINTComplete, null);
                        break;
                    case "M":
                        EntityQuery<internet_log> QueryM = dstb.GetInternet_logQuery();
                        LoadOperation<internet_log> LoadM = dstb.Load(QueryM.Where(p => p.ma_huyen == mhuyen && p.ma_dv == "FIBER" && p.ngay_hd >= ngaybd && p.ngay_hd <= ngaykt), LoadOpINTComplete, null);
                        break;
                    default:
                        EntityQuery<internet_log> Queryd = dstb.GetInternet_logQuery();
                        LoadOperation<internet_log> Loadd = dstb.Load(Queryd.Where(p => p.ma_huyen == mhuyen && p.ma_dv == "FIBER" && p.may_ngung == mbd && p.ngay_ngung >= ngaybd && p.ngay_ngung <= ngaykt), LoadOpINTComplete, null);
                        break;
                }
            }

        }
        void GetData(object sender, EventArgs e)
        {
            this.gridControl1.ItemsSource = new GanDB(); // lay bang rong dua vao
            tableView1.DeleteRow(0);
            gridControl1.ShowLoadingPanel = true;
            QLThuebaoDomainContext db = new QLThuebaoDomainContext();
            if (m_kt)
            {
                EntityQuery<rp_dsgan> Query = db.GetRp_dsganQuery();
                LoadOperation<rp_dsgan> LoadOp = db.Load(Query.OrderBy(p => p.ma_nvcs), LoadOp_Complete, null);
            }
            else
            {
                EntityQuery<rp_dsgan> Query = db.GetRp_dsganQuery();
                LoadOperation<rp_dsgan> LoadOp = db.Load(Query.OrderBy(p => p.ma_nvkt), LoadOp_Complete, null);
            }

        }
Example #13
0
 private void txttentb_DefaultButtonClick(object sender, RoutedEventArgs e)
 {
     grid.ShowLoadingPanel = true;
     txtsdt.IsEnabled = false;
     txttentb.IsEnabled = false;
     QLThuebaoDomainContext dbs = new QLThuebaoDomainContext();
     if (App.admin_119)
     {
         EntityQuery<ds119s> Query = dbs.Getds119Query(txttentb.Text.Trim());
         LoadOperation<ds119s> Load = dbs.Load(Query, LoadOpComplete, null);
     }
     else
     {
         EntityQuery<ds119s> Query = dbs.Getds119Query(txttentb.Text.Trim());
         LoadOperation<ds119s> Load = dbs.Load(Query.Where(p => p.ma_huyen == App.ma_huyen), LoadOpComplete, null);
     }
 }
Example #14
0
        void CreateChart()
        {
            double mtong = 0;
            QLThuebaoDomainContext db = new QLThuebaoDomainContext();
            EntityQuery<tk119> Qr = db.GetTk119Query();
            LoadOperation<tk119> Load = db.Load(Qr.OrderBy(p => p.ID), lo =>
            {
                if (lo.Entities.Count() > 0)
                {
                    for (int i = 0; i < lo.Entities.Count(); i++)
                    {
                        double sl = Convert.ToDouble(lo.Entities.ElementAt(i).suaxong, CultureInfo.InvariantCulture);
                        double slx = Convert.ToDouble(lo.Entities.ElementAt(i).baohong, CultureInfo.InvariantCulture);
                        string name = lo.Entities.ElementAt(i).loai.Trim();                        
                        thuebao.Add(new slthuebao(name, sl,slx));
                        mtong += sl;
                    }
                    chart.Diagram.Series[0].DataSource = thuebao;
                    chart.Diagram.Series[1].DataSource = thuebao;
                    // ltongc.Content = "Tổng : " + mtong.ToString() + " tính theo phương pháp 60 ngày có nạp thẻ trên địa bàn tỉnh";
                    //TT.Content = "";
                    chart.Diagram.Series[0].LabelsVisibility = true;
                    chart.Animate();                    
                }


            }, false
                );



        }