コード例 #1
0
        private void BtnEdit_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (grid_asnad.SelectedValue == null)
                {
                    throw new Exception(Localize.ex_no_record_selected);
                }

                Guid documentId = (grid_asnad.SelectedValue as dynamic).Id;
                var  document   = Business.GetAccountingDocumentBusiness().GetById(documentId);
                if (document.AIdStatus != Common.Constants.DocumentStatus.Draft)
                {
                    throw new Exception(Localize.ex_invalid_record_status);
                }

                var frmDocument = new frmDocument(Common.Enum.FormMode.Edit, document);
                frmDocument.ShowDialog();
                SetDataGrid();
            }
            catch (Exception ex)
            {
                AccountingKernel.Forms.Base.BaseWindow.ShowError(ex);
            }
        }
コード例 #2
0
 private void mnu_reg_Click_1(object sender, RoutedEventArgs e)
 {
     try
     {
         var frmDocument = new frmDocument(Common.Enum.FormMode.New, null);
         frmDocument.ShowDialog();
         SetDataGrid();
     }
     catch
     {
         throw;
     }
 }