private void BtnNew_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var frmOrder = new FrmOrder(Common.Enum.FormMode.New, Common.Constants.StoreOperation.WarehouseReceipts, null);
         frmOrder.ShowDialog();
         SetDataGrid();
     }
     catch (Exception ex)
     {
         AccountingKernel.Forms.Base.BaseWindow.ShowError(ex);
     }
 }
 private void MenuItem_Register(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
     try
     {
         var frmOrder = new FrmOrder(Common.Enum.FormMode.New, Common.Constants.StoreOperation.WarehouseReceipts, null);
         frmOrder.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 frmOrder = new FrmOrder(Common.Enum.FormMode.Edit, Common.Constants.StoreOperation.WarehouseReceipts, (DataGrid.SelectedValue as dynamic).Id);
         frmOrder.ShowDialog();
         SetDataGrid();
     }
     catch (Exception ex)
     {
         AccountingKernel.Forms.Base.BaseWindow.ShowError(ex);
     }
 }