private void BtnNew_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var frmReceiptOrder = new FrmReceiptOrder(Common.Enum.FormMode.New, Common.Constants.StoreOperation.WarehouseReceipts, null);
         frmReceiptOrder.ShowDialog();
         SetDataGrid();
     }
     catch (Exception ex)
     {
         AccountingKernel.Forms.Base.BaseWindow.ShowError(ex);
     }
 }
 private void MenuItem_Register(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
     try
     {
         var frmReceiptOrder = new FrmReceiptOrder(Common.Enum.FormMode.New, Common.Constants.StoreOperation.WarehouseReceipts, null);
         frmReceiptOrder.ShowDialog();
         SetDataGrid();
     }
     catch (Exception ex)
     {
         AccountingKernel.Forms.Base.BaseWindow.ShowError(ex);
     }
 }
 private void BtnEdit_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (DataGrid.SelectedValue == null)
         {
             throw new Exception(Localize.ex_no_record_selected);
         }
         var frmReceiptOrder = new FrmReceiptOrder(Common.Enum.FormMode.Edit, Common.Constants.StoreOperation.WarehouseReceipts, (DataGrid.SelectedValue as dynamic).Id);
         frmReceiptOrder.ShowDialog();
         SetDataGrid();
     }
     catch (Exception ex)
     {
         AccountingKernel.Forms.Base.BaseWindow.ShowError(ex);
     }
 }