示例#1
0
 private void btnPhieuChi_Click(object sender, EventArgs e)
 {
     try
     {
         var frmDetail = new FrmXtraFormPaymentVoucherDetail();
         frmDetail.ActionMode          = ActionModeVoucherEnum.None;
         frmDetail.KeyValue            = KeyCash;
         frmDetail.MasterBindingSource = new BindingSource();
         frmDetail.CurrentPosition     = 1;
         frmDetail.ShowDialog();
     }
     catch (Exception)
     {
         XtraMessageBox.Show("Chứng từ đã bị xóa!", ResourceHelper.GetResourceValueByName("ResExceptionCaption"));
     }
 }
        private void btnShowVoucher_Click(object sender, EventArgs e)
        {
            if (RefNo == "" || RefNo == null)
            {
                XtraMessageBox.Show(@"Không còn chừng từ để hủy tính",
                                    ResourceHelper.GetResourceValueByName("ResDetailContent"),
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                btnCancelSalary.Enabled = false;
                btnShowVoucher.Enabled  = false;
                return;
            }



            var keyCash    = salaryVouchersPresenter.GetEmployeePayroll_VoucherID(RefNo, (int)RefType.PaymentCash).ToString();     //salaryVouchersPresenter.KeyCashFromSalary(PostedDate, RefNo, RefTypeId);
            var keyDeposit = salaryVouchersPresenter.GetEmployeePayroll_VoucherID(RefNo, (int)RefType.PaymentDeposite).ToString(); //salaryVouchersPresenter.KeyDepositFromSalary(PostedDate, RefNo, RefTypeId);

            if (keyCash != "0" && keyDeposit != "0")
            {
                FrmXtraShowVoucherForSalary frm = new FrmXtraShowVoucherForSalary();
                frm.KeyCash    = keyCash;
                frm.KeyDeposit = keyDeposit;
                frm.ShowDialog();
            }
            if (keyCash == "0" && keyDeposit != "0")
            {
                var frmDetail = new FrmXtraPaymentDepositDetail();
                frmDetail.ActionMode          = ActionModeVoucherEnum.None;
                frmDetail.KeyValue            = keyDeposit;
                frmDetail.MasterBindingSource = new BindingSource();
                frmDetail.CurrentPosition     = 1;
                frmDetail.ShowDialog();
            }

            if (keyCash != "0" && keyDeposit == "0")
            {
                var frmDetail = new FrmXtraFormPaymentVoucherDetail();
                frmDetail.ActionMode          = ActionModeVoucherEnum.None;
                frmDetail.KeyValue            = keyCash;
                frmDetail.MasterBindingSource = new BindingSource();
                frmDetail.CurrentPosition     = 1;
                frmDetail.ShowDialog();
            }
        }