예제 #1
0
 private void OKButton_Click(object sender, RoutedEventArgs e)
 {
     FunAndPro callF = new FunAndPro();
     callF.GetDateTime();
     string ma_nv=this.txtmanv.Text.Trim().ToUpper();
     EntityQuery<nhanvien_cs> Query = dstb.Getnhanvien_csQuery();
     LoadOperation<nhanvien_cs> Load = dstb.Load(Query.Where(p => p.ma_nvcs.Trim() != ma_nv && p.ma_huyen == App.ma_huyen),CheckDouble,null);           
 }
예제 #2
0
 private void txtsonha_LostFocus(object sender, RoutedEventArgs e)
 {
     if (txtsonha.Text.Trim() != "")
     {
         char[] s = txtsonha.Text.Trim().ToCharArray();
         FunAndPro callF = new FunAndPro();
         if (FunAndPro.ContainsUnicodeCharacter(s))
         {
             MessageBox.Show("Nhập dữ liệu vào chương trình bằng font TCVN3 (font ABC)");
             txtsonha.Focus();
         }
     }
 }
예제 #3
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {

            FunAndPro callF = new FunAndPro();
            callF.GetDateTime();

            //if (chkthtb.IsChecked == true && txtSeri.Text.Trim() == "")
            //{
            //    MessageBox.Show("Chưa nhập vào seri thiết bị thu hồi!");
            //    return;
            //}

            if (DateTime.Parse(dngaycat.DateTime.ToShortDateString()) < DateTime.Parse(App.Min_Date.ToShortDateString()) || DateTime.Parse(dngaycat.DateTime.ToShortDateString()) > DateTime.Parse(App.Current_d.ToShortDateString()))
            {
                MessageBox.Show("Ngày cắt, ngưng, thanh lý không được nhỏ hơn 2 ngày hoặc lớn hơn so với ngày hiện tại !");
                dngaycat.Focus();
                return;
            }

            if ( this.txtusr.Text == "" || this.cmbgoicuoc.Text == "" || this.txttentb.Text == "" || this.txtdctb.Text == "" || this.txttendb.Text == "" || this.txtdcld.Text == "" || cmbtramvt.Text.Trim() == "" || cmbnhom.Text.Trim() == "" || cmbnganh.Text.Trim() == "" || this.txtcmnd.Text.Trim() == "" || cmbtocdo.Text.Trim()=="" || cmbkhuutien.Text.Trim()=="" || cmbloaibd.Text.Trim()=="")
            {
                MessageBox.Show("Nhập chưa đủ dữ liệu");
            }
            else
            {
                EntityQuery<internet> Query = dstb.GetInternetsQuery();
                LoadOpMy = dstb.Load(Query.Where(t => t.user_name.Trim() == this.txtusr.Text.Trim() && t.ma_huyen == App.ma_huyen), LoadOpHD_Complete, null);
            }
        }
예제 #4
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            if (this.cmbcbcs.SelectedIndex == -1 || this.cmbcbkt.SelectedIndex == -1)
            {
                MessageBox.Show("Phải chọn địa bàn kỹ thuật và địa bàn kinh doanh !");
                return;
            }

            if (this.cmbgoith.SelectedIndex > -1 && (App.id_goicuoc == null || App.id_goicuoc == ""))
            {
                MessageBox.Show("Chọn gói cước tích hợp chưa đúng !");
                this.cmbgoith.SelectedIndex = -1;
                return;
            }

            if (this.txtdtlh.Text.Trim() == "")
            {
                MessageBox.Show("Chưa nhập số điện thoại liên hệ !");
                this.txtdtlh.Focus();
                return;
            }

            if (this.txtemail.Text.Trim() != "")
            {
                if (!this.txtemail.Text.Contains('@'))
                {
                    MessageBox.Show("Nhập e mail sai định dạng !");
                    this.txtemail.Focus();
                    return;
                }
            }

            FunAndPro callF = new FunAndPro();
            callF.GetDateTime();
            if (this.txtusr.Text == "" || this.cmbgoicuoc.Text == "" || this.txttentb.Text == "" || this.txtdctb.Text == "" || this.txttendb.Text == "" || this.txtdcld.Text == "" || cmbtramvt.Text.Trim() == "" || cmbnhom.Text.Trim() == "" || this.txtcmnd.Text.Trim() == "" || dngaycap.Text.Trim() == "" )
            {
                MessageBox.Show("Nhập chưa đủ dữ liệu");
            }
            else
            {
                if (v_update)
                    if (LoadOptb.Entities.ElementAt(0).tinh_trang == "M")
                        Update_data();
                    else
                        if (nhiemthu.IsChecked == true)
                            innhiemthu();
                        else
                            inhopdong();    
                else
                {
                    // lay hopdong                
                    string m_hd = App.ma_huyen + "-M/" + this.dngayhd.DateTime.Year.ToString().Substring(2, 2);
                    EntityQuery<maxmakhachhang> Query = dstb.GethopdongmyQuery(m_hd);
                    LoadOperation<maxmakhachhang> LoadOp = dstb.Load(Query, LoadOpHD_Complete, null);
                }
            }
        }
예제 #5
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {

            FunAndPro callF = new FunAndPro();
            callF.GetDateTime();
            if (this.cmbcbcs.SelectedIndex == -1 || this.cmbcbkt.SelectedIndex == -1)
            {
                MessageBox.Show("Phải chọn địa bàn kỹ thuật và địa bàn kinh doanh !");
                return;
            }


            if (this.cmbgoith.SelectedIndex > -1 && (App.id_goicuoc == null || App.id_goicuoc == ""))
            {
                MessageBox.Show("Chọn gói cước tích hợp chưa đúng !");
                this.cmbgoith.SelectedIndex = -1;
                return;
            }

            if ((DateTime.Parse(dngayld.DateTime.ToShortDateString()) < DateTime.Parse(App.Min_Date.ToShortDateString()) || DateTime.Parse(dngayld.DateTime.ToShortDateString()) > DateTime.Parse(App.Current_d.ToShortDateString())) && dngayld.IsEnabled)
            {
                MessageBox.Show("Ngày lắp đặt không được nhỏ hơn 2 ngày hoặc lớn hơn so với ngày hiện tại !");
                dngayld.Focus();
                return;
            }

            if (DateTime.Parse(dngayld.DateTime.ToShortDateString()) < DateTime.Parse(this.dngayhd.DateTime.ToShortDateString()))
            {
                MessageBox.Show("Ngày lắp đặt nhỏ hơn ngày hợp đồng không lưu dữ liệu được !");
                return;
            }

            if (this.txtsdt.Text == "" || this.txttentb.Text == "" || this.txtdctb.Text == "" || this.txttendb.Text == "" || this.txtdcld.Text == "" || cmbtramvt.Text.Trim() == "" || cmbnhom.Text.Trim() == "" || this.txtcmnd.Text.Trim() == "" || this.cmbxa.Text.Trim() == "" || cmbtuyen.Text.Trim() == "" || cmbloaitb.SelectedIndex == -1 )
            {
                MessageBox.Show("Nhập chưa đủ dữ liệu");
            }
            else
            {

                EntityQuery<Gphone> Query = dstb.GetGphonesQuery();
                LoadOp = dstb.Load(Query.Where(t => t.so_dt == this.txtsdt.Text && t.ma_kh.Substring(0,7) == App.batdau_mkh), LoadOpHD_Complete, null);
            }
        }
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            FunAndPro callF = new FunAndPro();
            callF.GetDateTime();
            if (this.txtusr.Text == "" || this.txtusrn.Text == "" )
            {
                MessageBox.Show("Nhập chưa đủ dữ liệu");
            }
            else
            {                  
                mytv_log dsl = new mytv_log
                {
                    user_name = txtusrn.Text.Trim(),
                    n_user_name = LoadOp.Entities.ElementAt(0).user_name.Trim(),
                    //ten_dktb = LoadOp.Entities.ElementAt(0).ten_dktb,
                    //ten_nsd = LoadOp.Entities.ElementAt(0).ten_nsd,
                    //dia_chitb = LoadOp.Entities.ElementAt(0).dia_chitb,
                    //dc_tbld = LoadOp.Entities.ElementAt(0).dc_tbld,
                    //sohopdong = LoadOp.Entities.ElementAt(0).sohopdong,
                    //ngay_hd = LoadOp.Entities.ElementAt(0).ngay_hd,
                    //ngay_ld = LoadOp.Entities.ElementAt(0).ngay_ld,
                    //tuyen_tc = LoadOp.Entities.ElementAt(0).tuyen_tc,
                    goi_cuoc = LoadOp.Entities.ElementAt(0).goi_cuoc.Trim(),
                    //toc_do = LoadOp.Entities.ElementAt(0).toc_do,
                    //so_dt = LoadOp.Entities.ElementAt(0).so_dt,                    
                    //ht_ld = LoadOp.Entities.ElementAt(0).ht_ld,
                    ma_huyen = LoadOp.Entities.ElementAt(0).ma_huyen,
                    //socmnd = LoadOp.Entities.ElementAt(0).socmnd,
                    //may_ngung = LoadOp.Entities.ElementAt(0).may_ngung,
                    //noi_cap = LoadOp.Entities.ElementAt(0).noi_cap,
                    //ngay_cap = LoadOp.Entities.ElementAt(0).ngay_cap,
                    ma_kh = LoadOp.Entities.ElementAt(0).ma_kh,
                    //ngay_kn = LoadOp.Entities.ElementAt(0).ngay_kn,
                    //note_ngay_kn = LoadOp.Entities.ElementAt(0).note_ngay_kn,
                    //ms_thue = LoadOp.Entities.ElementAt(0).ms_thue,
                    //ngan_hang = LoadOp.Entities.ElementAt(0).ngan_hang,
                    //ma_km = LoadOp.Entities.ElementAt(0).ma_km,
                    //ma_nhom = LoadOp.Entities.ElementAt(0).ma_nhom,
                    //ma_nghe = LoadOp.Entities.ElementAt(0).ma_nghe,
                    //ma_nvcs = LoadOp.Entities.ElementAt(0).ma_nvcs,
                    user_login = App.User_name,
                    thoi_gian = App.Current_d
                };               

                dstb.mytv_logs.Add(dsl);
                dstb.SubmitChanges(OnSubmitCompleted, true);
            }             
        }        
예제 #7
0
        private void cmdSua_Click(object sender, RoutedEventArgs e)
        {
            FunAndPro callF = new FunAndPro();
            callF.GetDateTime();
            Nullable<DateTime> m_ngayhd, m_ngaykn, m_ngayld, m_ngaycap;          
             if (LoadOp.Entities.Count() > 0)
              {
                  MessageBoxResult result = MessageBox.Show("Muốn thay tiền thuê bao tháng này bằng thuê bao tháng kế ?", "Xác nhận", MessageBoxButton.OKCancel);
                  if (result == MessageBoxResult.OK)
                  {
                      gridControl1.ShowLoadingPanel = true;
                     for (int i = 0; i < LoadOp.Entities.Count(); i++)
                     {
                         LoadOp.Entities.ElementAt(i).tien_tb = LoadOp.Entities.ElementAt(i).tienno == null ? 0 : LoadOp.Entities.ElementAt(i).tienno;

                         if (LoadOp.Entities.ElementAt(i).ngay_hd.HasValue)
                             m_ngayhd = LoadOp.Entities.ElementAt(i).ngay_hd;
                         else
                             m_ngayhd = null;

                         if (LoadOp.Entities.ElementAt(i).ngay_kn.HasValue)
                             m_ngaykn = LoadOp.Entities.ElementAt(i).ngay_kn;
                         else
                             m_ngaykn = null;

                         if (LoadOp.Entities.ElementAt(i).ngay_ld.HasValue)
                             m_ngayld = LoadOp.Entities.ElementAt(i).ngay_ld;
                         else
                             m_ngayld = null;

                         if (LoadOp.Entities.ElementAt(i).ngay_cap.HasValue)
                             m_ngaycap = LoadOp.Entities.ElementAt(i).ngay_cap;
                         else
                             m_ngaycap = null;
       

                         codinh_log dsl = new codinh_log
                         {
                             so_dt = LoadOp.Entities.ElementAt(i).so_dt,
                             ten_dktb = LoadOp.Entities.ElementAt(i).ten_dktb == null ? "" : LoadOp.Entities.ElementAt(i).ten_dktb,
                             ten_dkdb = LoadOp.Entities.ElementAt(i).ten_dkdb == null ? "" : LoadOp.Entities.ElementAt(i).ten_dkdb,
                             dia_chitb = LoadOp.Entities.ElementAt(i).dia_chitb == null ? "" : LoadOp.Entities.ElementAt(i).dia_chitb,
                             dc_tbld = LoadOp.Entities.ElementAt(i).dc_tbld == null ? "" : LoadOp.Entities.ElementAt(i).dc_tbld,
                             tuyen_tc = LoadOp.Entities.ElementAt(i).tuyen_tc == null ? "" : LoadOp.Entities.ElementAt(i).tuyen_tc,
                             tien_tb = LoadOp.Entities.ElementAt(i).tien_tb,
                             tb_dv = LoadOp.Entities.ElementAt(i).tb_dv,
                             tienno = LoadOp.Entities.ElementAt(i).tienno,
                             khg_vat = LoadOp.Entities.ElementAt(i).khg_vat,
                             ma_tram = LoadOp.Entities.ElementAt(i).ma_tram,
                             pl = LoadOp.Entities.ElementAt(i).pl,
                             may_ngung = LoadOp.Entities.ElementAt(i).may_ngung,
                             ma_huyen = LoadOp.Entities.ElementAt(i).ma_huyen,
                             sohopdong = LoadOp.Entities.ElementAt(i).sohopdong,
                             ngay_hd = m_ngayhd,
                             ngay_ld = m_ngayld,
                             village = LoadOp.Entities.ElementAt(i).village,
                             ma_kh = LoadOp.Entities.ElementAt(i).ma_kh,
                             ngay_kn = m_ngaykn,
                             note_ngay_kn = LoadOp.Entities.ElementAt(i).note_ngay_kn,
                             ms_thue = LoadOp.Entities.ElementAt(i).ms_thue,
                             socmnd = LoadOp.Entities.ElementAt(i).socmnd,
                             noi_cap = LoadOp.Entities.ElementAt(i).noi_cap,
                             ngay_cap = m_ngaycap,
                             e_mail = LoadOp.Entities.ElementAt(i).e_mail,
                             thoi_gian = App.Current_d,
                             ma_km = LoadOp.Entities.ElementAt(i).ma_km,
                             users = App.User_name
                         };

                         dstb.codinh_logs.Add(dsl);

                     }
                     dstb.SubmitChanges(OnSubmitCompleted, true);
                  }
              }           
        }
예제 #8
0
        void SaveDate()
        {            
            FunAndPro callF = new FunAndPro();
            callF.GetDateTime();
            Nullable<DateTime> m_ngayhd, m_ngaykn, m_ngayld, m_ngaycap;
            decimal m_stt1;
            gridControl1.ShowLoadingPanel = true;
            for (int i = 0; i < gridControl1.VisibleRowCount; i++)
            {
                sdt = gridControl1.GetCellValue(i, sodt).ToString().Trim();
                m_stt = (gridControl1.GetCellValue(i, stt) == null || gridControl1.GetCellValue(i, stt).ToString().Trim() == "") ? 0 : Convert.ToDecimal(gridControl1.GetCellValue(i, stt));
                m_tuyen = gridControl1.GetCellValue(i, tuyen_tc).ToString().Trim();                
               // Update ds_codinh
                for (int j = 0; j < LoadOpS.Entities.Count(); j++)
                {
                    if (LoadOpS.Entities.ElementAt(j).so_dt.Trim() == sdt)
                    {
                        m_stt1 = (LoadOpS.Entities.ElementAt(j).stt == null || LoadOpS.Entities.ElementAt(j).stt.ToString().Trim() == "") ? 0 : Convert.ToDecimal(LoadOpS.Entities.ElementAt(j).stt);
                        if (LoadOpS.Entities.ElementAt(j).tuyen_tc.Trim() != m_tuyen || m_stt1 != m_stt)
                        {                          
                            LoadOpS.Entities.ElementAt(j).stt = m_stt;
                            LoadOpS.Entities.ElementAt(j).tuyen_tc = m_tuyen;

                            if (LoadOpS.Entities.ElementAt(j).ngay_hd.HasValue)
                                m_ngayhd = LoadOpS.Entities.ElementAt(j).ngay_hd;
                            else
                                m_ngayhd = null;

                            if (LoadOpS.Entities.ElementAt(j).ngay_kn.HasValue)
                                m_ngaykn = LoadOpS.Entities.ElementAt(j).ngay_kn;
                            else
                                m_ngaykn = null;

                            if (LoadOpS.Entities.ElementAt(j).ngay_ld.HasValue)
                                m_ngayld = LoadOpS.Entities.ElementAt(j).ngay_ld;
                            else
                                m_ngayld = null;

                            if (LoadOpS.Entities.ElementAt(j).ngay_cap.HasValue)
                                m_ngaycap = LoadOpS.Entities.ElementAt(j).ngay_cap;
                            else
                                m_ngaycap = null;


                            codinh_log dsl = new codinh_log
                            {
                                so_dt = LoadOpS.Entities.ElementAt(j).so_dt,
                                ten_dktb = LoadOpS.Entities.ElementAt(j).ten_dktb == null ? "" : LoadOpS.Entities.ElementAt(j).ten_dktb,
                                ten_dkdb = LoadOpS.Entities.ElementAt(j).ten_dkdb == null ? "" : LoadOpS.Entities.ElementAt(j).ten_dkdb,
                                dia_chitb = LoadOpS.Entities.ElementAt(j).dia_chitb == null ? "" : LoadOpS.Entities.ElementAt(j).dia_chitb,
                                dc_tbld = LoadOpS.Entities.ElementAt(j).dc_tbld == null ? "" : LoadOpS.Entities.ElementAt(j).dc_tbld,
                                tuyen_tc = m_tuyen,
                                stt = m_stt,
                                tien_tb = LoadOpS.Entities.ElementAt(j).tien_tb == null ? j : LoadOpS.Entities.ElementAt(j).tien_tb,
                                tb_dv = LoadOpS.Entities.ElementAt(j).tb_dv == null ? j : LoadOpS.Entities.ElementAt(j).tb_dv,
                                tienno = LoadOpS.Entities.ElementAt(j).tienno == null ? j : LoadOpS.Entities.ElementAt(j).tienno,
                                khg_vat = LoadOpS.Entities.ElementAt(j).khg_vat == null ? false : LoadOpS.Entities.ElementAt(j).khg_vat,
                                ma_tram = LoadOpS.Entities.ElementAt(j).ma_tram,
                                pl = LoadOpS.Entities.ElementAt(j).pl,
                                may_ngung = LoadOpS.Entities.ElementAt(j).may_ngung,
                                ma_huyen = LoadOpS.Entities.ElementAt(j).ma_huyen,
                                sohopdong = LoadOpS.Entities.ElementAt(j).sohopdong,
                                ngay_hd = m_ngayhd,
                                ngay_ld = m_ngayld,
                                village = LoadOpS.Entities.ElementAt(j).village,
                                ma_kh = LoadOpS.Entities.ElementAt(j).ma_kh,
                                ngay_kn = m_ngaykn,
                                note_ngay_kn = LoadOpS.Entities.ElementAt(j).note_ngay_kn,
                                ms_thue = LoadOpS.Entities.ElementAt(j).ms_thue,
                                socmnd = LoadOpS.Entities.ElementAt(j).socmnd,
                                noi_cap = LoadOpS.Entities.ElementAt(j).noi_cap,
                                ngay_cap = m_ngaycap,
                                e_mail = LoadOpS.Entities.ElementAt(j).e_mail,
                                thoi_gian = App.Current_d,
                                ma_km = LoadOpS.Entities.ElementAt(j).ma_km,
                                users = App.User_name
                            };
                            dstb.codinh_logs.Add(dsl);
                            break;
                        }
                    }
                }

                for (int k = 0; k < LoadOpG.Entities.Count(); k++)
                {
                    if (LoadOpG.Entities.ElementAt(k).so_dt == sdt)
                    {
                        if (LoadOpG.Entities.ElementAt(k).tuyen_tc.Trim() != m_tuyen || LoadOpG.Entities.ElementAt(k).stt != m_stt)
                        {
                            LoadOpG.Entities.ElementAt(k).stt = m_stt;
                            LoadOpG.Entities.ElementAt(k).tuyen_tc = m_tuyen;

                            if (LoadOpG.Entities.ElementAt(k).ngay_hd.HasValue)
                                m_ngayhd = LoadOpG.Entities.ElementAt(k).ngay_hd;
                            else
                                m_ngayhd = null;

                            if (LoadOpG.Entities.ElementAt(k).ngay_kn.HasValue)
                                m_ngaykn = LoadOpG.Entities.ElementAt(k).ngay_kn;
                            else
                                m_ngaykn = null;

                            if (LoadOpG.Entities.ElementAt(k).ngay_ld.HasValue)
                                m_ngayld = LoadOpG.Entities.ElementAt(k).ngay_ld;
                            else
                                m_ngayld = null;

                            if (LoadOpG.Entities.ElementAt(k).ngay_cap.HasValue)
                                m_ngaycap = LoadOpG.Entities.ElementAt(k).ngay_cap;
                            else
                                m_ngaycap = null;


                            Gphone_log dsl = new Gphone_log
                            {
                                so_dt = LoadOpG.Entities.ElementAt(k).so_dt,
                                ten_dktb = LoadOpG.Entities.ElementAt(k).ten_dktb == null ? "" : LoadOpG.Entities.ElementAt(k).ten_dktb,
                                ten_dkdb = LoadOpG.Entities.ElementAt(k).ten_dkdb == null ? "" : LoadOpG.Entities.ElementAt(k).ten_dkdb,
                                dia_chitb = LoadOpG.Entities.ElementAt(k).dia_chitb == null ? "" : LoadOpG.Entities.ElementAt(k).dia_chitb,
                                dc_tbld = LoadOpG.Entities.ElementAt(k).dc_tbld == null ? "" : LoadOpG.Entities.ElementAt(k).dc_tbld,
                                tuyen_tc = m_tuyen,
                                stt = m_stt,
                                tien_tb = LoadOpG.Entities.ElementAt(k).tien_tb,
                                tb_dv = LoadOpG.Entities.ElementAt(k).tb_dv,
                                tienno = LoadOpG.Entities.ElementAt(k).tienno,
                                khg_vat = LoadOpG.Entities.ElementAt(k).khg_vat,
                                pl = LoadOpG.Entities.ElementAt(k).pl,
                                may_ngung = LoadOpG.Entities.ElementAt(k).may_ngung,
                                ma_huyen = LoadOpG.Entities.ElementAt(k).ma_huyen,
                                sohopdong = LoadOpG.Entities.ElementAt(k).sohopdong,
                                ngay_hd = m_ngayhd,
                                ngay_ld = m_ngayld,
                                village = LoadOpG.Entities.ElementAt(k).village,
                                ma_kh = LoadOpG.Entities.ElementAt(k).ma_kh,
                                ngay_kn = m_ngaykn,
                                note_ngay_kn = LoadOpG.Entities.ElementAt(k).note_ngay_kn,
                                ms_thue = LoadOpG.Entities.ElementAt(k).ms_thue,
                                socmnd = LoadOpG.Entities.ElementAt(k).socmnd,
                                noi_cap = LoadOpG.Entities.ElementAt(k).noi_cap,
                                ngay_cap = m_ngaycap,
                                e_mail = LoadOpG.Entities.ElementAt(k).e_mail,
                                thoi_gian = App.Current_d,
                                ma_km = LoadOpG.Entities.ElementAt(k).ma_km,
                                users = App.User_name
                            };

                            dstb.Gphone_logs.Add(dsl);  

                        }
                    }
                }

                for (int l = 0; l < LoadOpM.Entities.Count(); l++)
                {
                    if (LoadOpM.Entities.ElementAt(l).user_name.Trim() == sdt)
                    {
                        if (LoadOpM.Entities.ElementAt(l).tuyen_tc.Trim() != m_tuyen || LoadOpM.Entities.ElementAt(l).stt != m_stt)
                        {
                            LoadOpM.Entities.ElementAt(l).stt = m_stt;
                            LoadOpM.Entities.ElementAt(l).tuyen_tc = m_tuyen;

                            if (LoadOpM.Entities.ElementAt(l).ngay_hd.HasValue)
                                m_ngayhd = LoadOpM.Entities.ElementAt(l).ngay_hd;
                            else
                                m_ngayhd = null;

                            if (LoadOpM.Entities.ElementAt(l).ngay_kn.HasValue)
                                m_ngaykn = LoadOpM.Entities.ElementAt(l).ngay_kn;
                            else
                                m_ngaykn = null;

                            if (LoadOpM.Entities.ElementAt(l).ngay_ld.HasValue)
                                m_ngayld = LoadOpM.Entities.ElementAt(l).ngay_ld;
                            else
                                m_ngayld = null;

                            if (LoadOpM.Entities.ElementAt(l).ngay_cap.HasValue)
                                m_ngaycap = LoadOpM.Entities.ElementAt(l).ngay_cap;
                            else
                                m_ngaycap = null;


                            mytv_log dsl = new mytv_log
                            {
                                user_name = LoadOpM.Entities.ElementAt(l).user_name,
                                ten_dktb = LoadOpM.Entities.ElementAt(l).ten_dktb == null ? "" : LoadOpM.Entities.ElementAt(l).ten_dktb,
                                ten_dkdb = LoadOpM.Entities.ElementAt(l).ten_dkdb == null ? "" : LoadOpM.Entities.ElementAt(l).ten_dkdb,
                                dia_chitb = LoadOpM.Entities.ElementAt(l).dia_chitb == null ? "" : LoadOpM.Entities.ElementAt(l).dia_chitb,
                                dc_tbld = LoadOpM.Entities.ElementAt(l).dc_tbld == null ? "" : LoadOpM.Entities.ElementAt(l).dc_tbld,
                                sohopdong = LoadOpM.Entities.ElementAt(l).sohopdong,
                                ngay_hd = m_ngayhd,
                                ngay_ld = m_ngayld,
                                tuyen_tc = m_tuyen,
                                stt = m_stt,
                                goi_cuoc = LoadOpM.Entities.ElementAt(l).goi_cuoc,
                                so_dt = LoadOpM.Entities.ElementAt(l).so_dt == null ? "" : LoadOpM.Entities.ElementAt(l).so_dt,
                                stb_serial = LoadOpM.Entities.ElementAt(l).stb_serial == null ? "" : LoadOpM.Entities.ElementAt(l).stb_serial,
                                loai_cap = LoadOpM.Entities.ElementAt(l).loai_cap == null ? "" : LoadOpM.Entities.ElementAt(l).loai_cap,
                                ht_ld = LoadOpM.Entities.ElementAt(l).ht_ld == null ? "" : LoadOpM.Entities.ElementAt(l).ht_ld,
                                ma_huyen = App.ma_huyen,
                                socmnd = LoadOpM.Entities.ElementAt(l).socmnd == null ? "" : LoadOpM.Entities.ElementAt(l).socmnd,
                                noi_cap = LoadOpM.Entities.ElementAt(l).noi_cap == null ? "" : LoadOpM.Entities.ElementAt(l).noi_cap,
                                ngay_cap = m_ngaycap,
                                ma_kh = LoadOpM.Entities.ElementAt(l).ma_kh,
                                pl = LoadOpM.Entities.ElementAt(l).pl == null ? "" : LoadOpM.Entities.ElementAt(l).pl,
                                ngay_kn = m_ngaykn,
                                note_ngay_kn = LoadOpM.Entities.ElementAt(l).note_ngay_kn == null ? "" : LoadOpM.Entities.ElementAt(l).note_ngay_kn,
                                ms_thue = LoadOpM.Entities.ElementAt(l).ms_thue == null ? "" : LoadOpM.Entities.ElementAt(l).ms_thue,
                                ngan_hang = LoadOpM.Entities.ElementAt(l).ngan_hang == null ? "" : LoadOpM.Entities.ElementAt(l).ngan_hang,
                                ma_km = LoadOpM.Entities.ElementAt(l).ma_km == null ? "" : LoadOpM.Entities.ElementAt(l).ma_km,
                                user_login = App.User_name,
                                thoi_gian = App.Current_d
                            };
                            dstb.mytv_logs.Add(dsl);
                        }
                    }
                } 
              // update internet

                for (int m = 0; m < LoadOpI.Entities.Count(); m++)
                {
                    if (LoadOpI.Entities.ElementAt(m).user_name.Trim() == sdt)
                    {
                        if (LoadOpI.Entities.ElementAt(m).tuyen_tc.Trim() != m_tuyen || LoadOpI.Entities.ElementAt(m).stt != m_stt)
                        {
                            LoadOpI.Entities.ElementAt(m).stt = m_stt;
                            LoadOpI.Entities.ElementAt(m).tuyen_tc = m_tuyen;

                            if (LoadOpI.Entities.ElementAt(m).ngay_hd.HasValue)
                                m_ngayhd = LoadOpI.Entities.ElementAt(m).ngay_hd;
                            else
                                m_ngayhd = null;

                            if (LoadOpI.Entities.ElementAt(m).ngay_kn.HasValue)
                                m_ngaykn = LoadOpI.Entities.ElementAt(m).ngay_kn;
                            else
                                m_ngaykn = null;

                            if (LoadOpI.Entities.ElementAt(m).ngay_ld.HasValue)
                                m_ngayld = LoadOpI.Entities.ElementAt(m).ngay_ld;
                            else
                                m_ngayld = null;

                            if (LoadOpI.Entities.ElementAt(m).ngay_cap.HasValue)
                                m_ngaycap = LoadOpI.Entities.ElementAt(m).ngay_cap;
                            else
                                m_ngaycap = null;


                            internet_log dsl = new internet_log
                            {
                                user_name = LoadOpI.Entities.ElementAt(m).user_name,
                                ten_dktb = LoadOpI.Entities.ElementAt(m).ten_dktb == null ? "" : LoadOpI.Entities.ElementAt(m).ten_dktb.Trim(),
                                ten_nsd = LoadOpI.Entities.ElementAt(m).ten_nsd == null ? "" : LoadOpI.Entities.ElementAt(m).ten_nsd.Trim(),
                                dia_chitb = LoadOpI.Entities.ElementAt(m).dia_chitb == null ? "" : LoadOpI.Entities.ElementAt(m).dia_chitb.Trim(),
                                dc_tbld = LoadOpI.Entities.ElementAt(m).dc_tbld == null ? "" : LoadOpI.Entities.ElementAt(m).dc_tbld.Trim(),
                                sohopdong =LoadOpI.Entities.ElementAt(m).sohopdong==null? "": LoadOpI.Entities.ElementAt(m).sohopdong.Trim(),
                                //ngay_hd = m_ngayhd,
                                //ngay_ld = m_ngayld,
                                tuyen_tc = m_tuyen,
                                stt = m_stt,
                                goi_cuoc = LoadOpI.Entities.ElementAt(m).goi_cuoc.Trim(),
                                //so_dt = LoadOpI.Entities.ElementAt(m).so_dt == null ? "" : LoadOpI.Entities.ElementAt(m).so_dt,
                                toc_do = LoadOpI.Entities.ElementAt(m).toc_do == null ? "" : LoadOpI.Entities.ElementAt(m).toc_do.Trim(),                                                               
                                //may_ngung = LoadOpI.Entities.ElementAt(m).may_ngung == null ? "" : LoadOpI.Entities.ElementAt(m).may_ngung,
                                ma_huyen = App.ma_huyen,
                                //socmnd = LoadOpI.Entities.ElementAt(m).socmnd == null ? "" : LoadOpI.Entities.ElementAt(m).socmnd.Trim(),
                                //noi_cap = LoadOpI.Entities.ElementAt(m).noi_cap == null ? "" : LoadOpI.Entities.ElementAt(m).noi_cap.Trim(),
                                //ngay_cap = m_ngaycap,
                                ma_kh = LoadOpI.Entities.ElementAt(m).ma_kh,                                
                                //ngay_kn = m_ngaykn,
                                //note_ngay_kn = LoadOpI.Entities.ElementAt(m).note_ngay_kn == null ? "" : LoadOpI.Entities.ElementAt(m).note_ngay_kn.Trim(),
                                //ms_thue = LoadOpI.Entities.ElementAt(m).ms_thue == null ? "" : LoadOpI.Entities.ElementAt(m).ms_thue.Trim(),
                                //ngan_hang = LoadOpI.Entities.ElementAt(m).ngan_hang == null ? "" : LoadOpI.Entities.ElementAt(m).ngan_hang.Trim(),
                                //ma_km = LoadOpI.Entities.ElementAt(m).ma_km == null ? "" : LoadOpI.Entities.ElementAt(m).ma_km.Trim(),
                                //ma_nvcs = LoadOpI.Entities.ElementAt(m).ma_nvcs == null ? "" : LoadOpI.Entities.ElementAt(m).ma_nvcs,
                                user_login = App.User_name,
                                thoi_gian = App.Current_d
                            };
                            dstb.internet_logs.Add(dsl);
                        }
                    }
                }    


              //  UpdateCodinh(sdt, m_tuyen, m_stt);
              //  UpdateGphone(sdt, m_tuyen, m_stt);
              //  UpdateMytv(sdt, m_tuyen, m_stt);
               //// xem co phai la thue bao Gphone k ?                           
               // EntityQuery<Gphone> QueryG = dstb.GetGphonesQuery();
               // LoadOpG = dstb.Load(QueryG.Where(p => p.ma_huyen == App.ma_huyen && p.so_dt == sdt), LoadOpG_Complete, null);
               // //xem co phai la thue bao MyTv k ?
               // EntityQuery<mytv> QueryM = dstb.GetMytvsQuery();
               // LoadOpM = dstb.Load(QueryM.Where(p => p.user_name.Trim() == sdt), LoadOpM_Complete, null);                         
            }
            dstb.SubmitChanges(OnSubmitCompleted, true);
        }
예제 #9
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            FunAndPro callF = new FunAndPro();            
            callF.GetDateTime();
            if (cmbloaibd.Text.Trim() == "")
            {
                MessageBox.Show("Chưa chọn loại biến động");
                return;
            }
            if (DateTime.Parse(dngaycat.DateTime.ToShortDateString()) < DateTime.Parse(App.Min_Date.ToShortDateString()) || DateTime.Parse(dngaycat.DateTime.ToShortDateString()) > DateTime.Parse(App.Current_d.ToShortDateString()))
            {
                MessageBox.Show("Ngày cắt, ngưng, thanh lý không được nhỏ hơn 2 ngày hoặc lớn hơn so với ngày hiện tại !");
                dngaycat.Focus();
                return;
            }

            if (m_camket > 0 && (DateTime.Parse(dngaycat.DateTime.ToShortDateString()) < DateTime.Parse(dngaycat.DateTime.AddMonths(m_camket).ToShortDateString())))
            {
                MessageBoxResult Q = MessageBox.Show("Thuê bao này cam kết sử dụng : " + m_camket.ToString() + " tháng, thời gian cắt ngưng chưa đủ thời gian cam kết sử dụng, bạn muốn cắt ngưng không ?", "Xác nhận", MessageBoxButton.OKCancel);
                if (Q == MessageBoxResult.Cancel)
                {
                    return;
                }
            }

            if (this.txtsdt.Text == "" || this.txttentb.Text == "" || this.txtdctb.Text == "" || this.txttendb.Text == "" || this.txtdcld.Text == "" || cmbtramvt.Text.Trim() == "" || cmbnhom.Text.Trim() == "" || cmbnganh.Text.Trim() == "" || this.txtcmnd.Text.Trim() == "" || this.cmbxa.Text.Trim() == "" || cmbtuyen.Text.Trim() == "" || cmbloaitb.SelectedIndex == -1 || cmbloaibd.Text.Trim()=="")
            {
                MessageBox.Show("Nhập chưa đủ dữ liệu");
            }
            else
            {
                EntityQuery<Gphone> Query = dstb.GetGphonesQuery();
                LoadOp = dstb.Load(Query.Where(t => t.so_dt == this.txtsdt.Text && t.ma_huyen == App.ma_huyen), LoadOpHD_Complete, null);           
            }
        }
예제 #10
0
 private void OKButton_Click(object sender, RoutedEventArgs e)
 {
     FunAndPro callF = new FunAndPro();
     callF.GetDateTime();
     string m_sdt,m_mayc;
     for (int i = 0; i < gridControl1.VisibleRowCount; i++)
     {                
         if (Convert.ToBoolean(gridControl1.GetCellValue(i, check)) ==true)
         {
             m_sdt=gridControl1.GetCellValue(i, sodt).ToString().Trim();
             m_mayc=gridControl1.GetCellValue(i, ma_yc).ToString().Trim();
             for (int j = 0; j < LoadOpR.Entities.Count(); j++)
             {
                 if (LoadOpR.Entities.ElementAt(j).so_dt.Trim() == m_sdt && LoadOpR.Entities.ElementAt(j).ma_yc.Trim() == m_mayc)
                 {
                     cat_mo_log cml = new cat_mo_log
                     {
                         card = LoadOpR.Entities.ElementAt(j).card,
                         dc_tbld = LoadOpR.Entities.ElementAt(j).dc_tbld,
                         dia_chitb = LoadOpR.Entities.ElementAt(j).dia_chitb,
                         dlu = LoadOpR.Entities.ElementAt(j).dlu,
                         en = LoadOpR.Entities.ElementAt(j).en,
                         frame = LoadOpR.Entities.ElementAt(j).frame,
                         logic = true,
                         ma_huyen = LoadOpR.Entities.ElementAt(j).ma_huyen,
                         ma_yc = LoadOpR.Entities.ElementAt(j).ma_yc,
                         mo = LoadOpR.Entities.ElementAt(j).mo,
                         nguoi_mo = App.User_name,
                         nguoi_yc = LoadOpR.Entities.ElementAt(j).nguoi_yc,
                         port = LoadOpR.Entities.ElementAt(j).port,
                         shell = LoadOpR.Entities.ElementAt(j).shell,
                         slot = LoadOpR.Entities.ElementAt(j).slot,
                         slp = LoadOpR.Entities.ElementAt(j).slp,
                         so_dt = LoadOpR.Entities.ElementAt(j).so_dt,
                         ten_dkdb = LoadOpR.Entities.ElementAt(j).ten_dkdb,
                         ten_dktb = LoadOpR.Entities.ElementAt(j).ten_dktb,
                         tg_mo = App.Current_d,
                         tg_yc = LoadOpR.Entities.ElementAt(j).tg_yc
                     };
                     dstb.cat_mo_logs.Add(cml); 
                     cat_mo cm = LoadOpR.Entities.ElementAt(j);
                     dstb.cat_mos.Remove(cm);
                 }
             }                  
         }                             
     }
     dstb.SubmitChanges(OnSubmitCompleted, true);
 }
예제 #11
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            FunAndPro callF = new FunAndPro();
            callF.GetDateTime();

            if (this.cmbcbcs.SelectedIndex == -1 || this.cmbcbkt.SelectedIndex == -1)
            {
                MessageBox.Show("Phải chọn địa bàn kỹ thuật và địa bàn kinh doanh !");
                return;
            }

            if (this.cmbgoith.SelectedIndex > -1 && (App.id_goicuoc == null || App.id_goicuoc == ""))
            {
                MessageBox.Show("Chọn gói cước tích hợp chưa đúng !");
                this.cmbgoith.SelectedIndex = -1;
                return;
            }
            //if (m_may_ngung == "M" && txtseri.Text.Trim() == "")
            //{
            //    MessageBox.Show("Chưa nhập vào số seri thiết bị lắp đặt !");
            //    txtseri.Focus();
            //}

            if (cmbhtld.Text.Substring(0, 1) == "1" && txtsdt.Text.Trim() == "")
            {
                MessageBox.Show("Chưa nhập vào số điện thoại lắp chung");
                return;
            }

            if ((DateTime.Parse(dngayld.DateTime.ToShortDateString()) < DateTime.Parse(App.Min_Date.ToShortDateString()) || DateTime.Parse(dngayld.DateTime.ToShortDateString()) > DateTime.Parse(App.Current_d.ToShortDateString())) && dngayld.IsEnabled)
            {
                MessageBox.Show("Ngày lắp đặt không được nhỏ hơn 2 ngày hoặc lớn hơn so với ngày hiện tại !");
                dngayld.Focus();
            }

            if (DateTime.Parse(dngayld.DateTime.ToShortDateString()) < DateTime.Parse(this.dngayhd.DateTime.ToShortDateString()))
            {
                MessageBox.Show("Ngày lắp đặt nhỏ hơn ngày hợp đồng không lưu dữ liệu được !");
                return;
               // dngayld.Focus();
              //  return;
            }

            if (this.txtusr.Text == "" || this.cmbgoicuoc.Text == "" || this.txttentb.Text == "" || this.txtdctb.Text == "" || this.txttendb.Text == "" || this.txtdcld.Text == "" || cmbtramvt.Text.Trim() == "" || cmbtocdo.Text.Trim()=="" || cmbkhuutien.Text.Trim()=="" || cmbnhom.Text.Trim() == "" || this.txtcmnd.Text.Trim() == "" || cmbhtld.Text.Trim()=="" || cmbkm.Text.Trim()=="")
            {
                MessageBox.Show("Nhập chưa đủ dữ liệu");
            }
            else
            {
                EntityQuery<internet> Query = dstb.GetInternetsQuery();
                LoadOpMy = dstb.Load(Query.Where(t => t.user_name == this.txtusr.Text.Trim() && t.ma_kh.Substring(0, 7) == App.batdau_mkh), LoadOpHD_Complete, null);
            }
        }
예제 #12
0
        private void cmdCancel_Click(object sender, RoutedEventArgs e)
        {
            //InvokeOperation<System.Nullable<int>> p = check.CreateTableTemp();           
            //p.Completed += new EventHandler(ht);
          //  System.Windows.Browser.HtmlPage.Window.Invoke("close");
            //EntityQuery<internet> Query = check.GetInternetsQuery();
            //LoadOperation<internet> Load = check.Load(Query, LoadOperationCoplete, null);

            //MessageBox.Show("ffsdf");
            //frmchart frm = new frmchart();
            //frm.Width = this.ActualWidth;
            //frm.Height = this.ActualHeight;
            //frm.Show();

            FunAndPro callF = new FunAndPro();
            this.txtusername.Text = callF.DecrytedString(txtpassword.Text);

            //frmdiachi frm = new frmdiachi();
            //frm.Show();
         

        }
예제 #13
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            FunAndPro callF = new FunAndPro();
            callF.GetDateTime();

            if (Convert.ToInt32(txttbdv.Text.Trim()) > 0)
            {
                MessageBox.Show("Chu y ! tien thue bao dich vu >0 !");
            }
            if (DateTime.Parse(dngaycat.DateTime.ToShortDateString()) < DateTime.Parse(App.Min_Date.ToShortDateString()) || DateTime.Parse(dngaycat.DateTime.ToShortDateString()) > DateTime.Parse(App.Current_d.ToShortDateString()))
            {
                MessageBox.Show("Ngày cắt, ngưng, thanh lý, không được nhỏ hơn 2 ngày hoặc lớn hơn so với ngày hiện tại !");
                dngaycat.Focus();
                return;
            }

            
            if (this.txtsdt.Text == "" || this.txttentb.Text == "" || this.txtdctb.Text == "" || this.txttendb.Text == "" || this.txtdcld.Text == "" || cmbtramvt.Text.Trim() == "" || cmbnhom.Text.Trim() == "" || cmbnganh.Text.Trim() == "" || this.txtcmnd.Text.Trim() == "" || this.cmbxa.Text.Trim() == "" || cmbtuyen.Text.Trim() == "" || cmbloaibd.Text.Trim() == "" || dngaycat.Text.Trim() == "")
            {
                MessageBox.Show("Nhập chưa đủ dữ liệu");
            }
            else
            {                                
                EntityQuery<ds_codinh> Query = dstb.GetDs_codinhQuery();
                LoadOp = dstb.Load(Query.Where(t => t.so_dt == this.txtsdt.Text && App.ma_huyen.Contains(t.ma_huyen)), LoadOpHD_Complete, true);
            }
        }
예제 #14
0
 private void OKButton_Click(object sender, RoutedEventArgs e)
 {
     string m_sdt, m_dv;
     bool m_mo;
     FunAndPro callF = new FunAndPro();
     callF.GetDateTime();
     if (txtsdt.Text.Trim() != "" && cmbloai.SelectedIndex >= 0)
     {
         m_sdt = txtsdt.Text.Trim();
         m_dv = cmbloai.GetKeyValue(cmbloai.SelectedIndex).ToString();
         if (rdomo.IsChecked == true)
             m_mo = false;
         else
             m_mo = true;
         EntityQuery<cat_mo> Query = dstb.GetCat_moQuery();
         LoadOperation<cat_mo> LoadOp = dstb.Load(Query.Where(p=>p.so_dt==m_sdt && p.ma_yc.Trim()==m_dv && p.mo==m_mo), LoadOp_Complete, null);
     }
     else
         MessageBox.Show("Nhập chưa đủ thông tin");
 }