コード例 #1
0
        private void CancelInvoice()
        {
            try
            {
                if (string.IsNullOrEmpty(txtComment.Text))
                {
                    txtComment.Focus();
                    throw new Exception($"ถ้ายกเลิกเอกสาร กรุณาระบุเหตุผลที่ยกเลิก");
                }
                var invoice = new Invoice
                {
                    InvoiceNo     = txtInvoiceNo.Text,
                    InvoiceDate   = dtpInvoiceDate.Value,
                    RefDocumentNo = txtOrderNo.Text,
                    Comments      = txtComment.Text,
                    Active        = false,
                    ModifiedBy    = "system"
                };

                InvoiceController.Cancel(invoice);
            }
            catch (Exception)
            {
                throw;
            }
        }