Example #1
0
 private void xtraTabControl2_CustomHeaderButtonClick(object sender, DevExpress.XtraTab.ViewInfo.CustomHeaderButtonEventArgs e)
 {
     if (sdd_ != "" && e.Button.Caption == "In bản khai")
     {
         if (IDNK == 0)
         {
             SplashScreenManager.ShowDefaultWaitForm("Đang tạo báo cáo", "Vui lòng chờ...");
             frmReport fr = new frmReport();
             fr.Text = "BẢN KHAI NHÂN KHẨU";
             BcBKNKnull re = new BcBKNKnull();
             fr.docView.PrintingSystem = re.PrintingSystem;
             re.CreateDocument();
             fr.ShowDialog();
             SplashScreenManager.CloseDefaultWaitForm();
         }
         else
         {
             Bientoancuc.inSua = true;
             Thoai_BcBKNhanKhau fr1 = new Thoai_BcBKNhanKhau(IDNK);
             fr1.ShowDialog();
         }
     }
     if (e.Button.Caption == "Lưu thông tin")
     {
         SplashScreenManager.ShowDefaultWaitForm("Đang tải", "Vui lòng chờ...");
         try
         {
             unitNHANKHAU.CommitChanges();
             unitQUATRINH.CommitChanges();
             unitQUANHE.CommitChanges();
             unitTIENAN.CommitChanges();
             unitDIENBIEN.CommitChanges();
             unitTAMVANG.CommitChanges();
             alertControl1.Show(this, "Thông báo", "Đã lưu");
         }
         catch (Exception)
         { }
         SplashScreenManager.CloseDefaultWaitForm();
     }
     else if (e.Button.Caption == "Xoá nhân khẩu")
     {
         SplashScreenManager.ShowDefaultWaitForm("Đang tải", "Vui lòng chờ...");
         if (XtraMessageBox.Show("Xoá nhân khẩu đang chọn?", "Xoá", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             foreach (var item in new XPQuery <NHANKHAU>(Session.DefaultSession).Where(o => o.ID == IDNK).ToList())
             {
                 item.Delete();
             }
             xpNHANKHAU.Reload();
             gridView3_FocusedRowChanged(null, null);
         }
         SplashScreenManager.CloseDefaultWaitForm();
     }
     else if (e.Button.Caption == "Làm mới")
     {
         xpNHANKHAU.Reload();
         alertControl1.Show(this, "Thông báo", "Đã làm mới");
     }
 }
Example #2
0
 void xtraTabControl1_CustomHeaderButtonClick(object sender, DevExpress.XtraTab.ViewInfo.CustomHeaderButtonEventArgs e)
 {
     if (e.Button.Index == 0)
     {
         SplashScreenManager.ShowDefaultWaitForm("Đang tạo báo cáo", "Vui lòng chờ...");
         frmReport fr = new frmReport();
         fr.Text = "BẢN KHAI NHÂN KHẨU";
         BcBKNKnull re = new BcBKNKnull();
         fr.docView.PrintingSystem = re.PrintingSystem;
         re.CreateDocument();
         fr.MdiParent = this;
         fr.Show();
         SplashScreenManager.CloseDefaultWaitForm();
     }
 }
Example #3
0
 void xtraTabControl2_CustomHeaderButtonClick(object sender, DevExpress.XtraTab.ViewInfo.CustomHeaderButtonEventArgs e)
 {
     if (e.Button.Index == 1)
     {
         frmReport fr = new frmReport();
         fr.Text = "BẢN KHAI NHÂN KHẨU";
         if (Bientoancuc.IDNK != 0)
         {
             Thoai_BcBKNhanKhau Bc = new Thoai_BcBKNhanKhau(Bientoancuc.IDNK);
             Bc.ShowDialog();
             if (Bc.DialogResult == DialogResult.OK)
             {
                 SplashScreenManager.ShowDefaultWaitForm("Đang tạo báo cáo", "Vui lòng chờ...");
                 frmReport fr1 = new frmReport();
                 BcBKNK    re  = new BcBKNK(Bientoancuc.IDNK, Bc.txtNguoiLap.Text, Convert.ToDateTime(Bc.dpkNgayLap.EditValue), Bc.txtDiaChi.Text);
                 if (Bc.txtNguoiLap.EditValue != null && Bc.txtNguoiLap.Text != "")
                 {
                     re.NguoiLap_ = Bc.txtNguoiLap.Text;
                 }
                 if (Bc.dpkNgayLap.EditValue != null)
                 {
                     re.NgayLap_ = Convert.ToDateTime(Bc.dpkNgayLap.EditValue);
                 }
                 if (Bc.txtDiaChi.EditValue != null && Bc.txtDiaChi.Text != "")
                 {
                     re.DiaChi_ = Bc.txtDiaChi.Text;
                 }
                 fr1.Text = "BẢN KHAI NHÂN KHẨU";
                 fr1.docView.PrintingSystem = re.PrintingSystem;
                 re.CreateDocument();
                 fr1.MdiParent = this;
                 fr1.Show();
                 SplashScreenManager.CloseDefaultWaitForm();
             }
         }
         else
         {
             SplashScreenManager.ShowDefaultWaitForm("Đang tạo báo cáo", "Vui lòng chờ...");
             BcBKNKnull re1 = new BcBKNKnull();
             fr.docView.PrintingSystem = re1.PrintingSystem;
             re1.CreateDocument();
             fr.MdiParent = this;
             fr.Show();
             SplashScreenManager.CloseDefaultWaitForm();
         }
     }
 }