public static ObjectOfTransaction ConverObjOfTransaction(ViewObjOfTransact objOfTransact)
        {
            return new ObjectOfTransaction
            {
                ObjectOfTransactionID = objOfTransact.ObjectOfTransactionID,
                UserID = objOfTransact.UserID,

                ObjectTypeID = (int)objOfTransact.ObjectType,
                ServiceTypeID = (int)objOfTransact.ServiceType,
                KindOfCalculatingID = (int)objOfTransact.KindOfCalculating,
                ObjectStateID = (int)objOfTransact.ObjectState,

                Cost = objOfTransact.Cost,
                Description = objOfTransact.Description
            };
        }
 private void Button_Click_Add(object sender, RoutedEventArgs e)
 {
     if (TabItem_Users.IsSelected)
     {
         var user = new ViewUser();
         var userWindow = new UserWindow(user);
         userWindow.ShowDialog();
         UpdateUsers();
     }
     else if(TabItem_ObjOfTransact.IsSelected)
     {
         var objOfTransact = new ViewObjOfTransact();
         var objOfTransactWindow = new ObjOfTransactWindow(objOfTransact);
         objOfTransactWindow.ShowDialog();
         UpdateObjectOfTransaction();
     }
     else if(TabItem_Deals.IsSelected)
     {
         var viewDeal = new ViewDeal();
         var dealWindow = new DealWindow(viewDeal);
         dealWindow.ShowDialog();
         UpdateDeals();
     }
 }
 public void DeleteObjectOfTransaction(ViewObjOfTransact objectOfTransaction)
 {
     DataManager.DeleteObjectOfTransactionFromDb(DbConverter.ConverObjOfTransaction(objectOfTransaction));
 }
 public void AddObjectOfTransaction(ViewObjOfTransact objectOfTransaction)
 {
     DataManager.AddObjectOfTransactionToDb(DbConverter.ConverObjOfTransaction(objectOfTransaction));
 }