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