|
satc wrote: You don't know nothing about this Correct, thanks to the double negative.
You'll need to save the entire "state" and keep that in a stack. If you want that for tables, that means that all affected tables (and their content) become your state.
That would also only work if the state is accessed from a single location. If multiple people change state from different machines, then they will both have an incomplete list of changes, or they will affect each other.
Dave is right, the idea as a design is wrong.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Quote: Dave is right, the idea as a design is wrong.
Be more clear :
- Is wrong ?
- Is difficult to make ?
- Can't be done at all ?
- It's unusable even if can be realized ?
|
|
|
|
|
satc wrote: - Is wrong ? Yes. A undo/redo pattern applies to a current unit of work, ie, the 'dirty' document that the user is currently editing. Consider that record to be locked, and "stopping editing", moving to the next record becomes "saving a file".
satc wrote: - Is difficult to make ? Depends on how far you are willing to go. Do you want a set of tables that is edited by multiple users? Imagine user A undoing the changes of user B.
satc wrote: - Can't be done at all ? Sure it can be done; capture the entire state of your database as a single memento-item. If your database is 2 Gb, that means 2 Gb per undo/redo step
Do your users really need the functionality that bad? How would you have user A and B negotatiate about whom is right?
satc wrote: - It's unusable even if can be realized ? "Undo/redo" is aiming at the thing you are editing; it is limited to your Word/Excel/MSPaint/Whatever file/document, not to ALL documents on the network. That would create havoc, which does not count as a unique selling point
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Quote: Sure it can be done; capture the entire state of your database as a single memento-item. If your database is 2 Gb, that means 2 Gb per undo/redo step
This idea is an attempt to show the possible solution for this problem as bad as possible.
Why should I make an entire state of database for some hundreds records that are being changed ?
|
|
|
|
|
satc wrote: This idea is an attempt to show the possible solution for this problem So far I did not see one.
satc wrote: Why should I make an entire state of database for some hundreds records that are
being changed ? That is the easiest way to allow for unknown operations on the data whilst still being able to step "back" or "forward" to different states. If you have a better solution, please article it
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Never retreat! Advance! Advance! Advance!
I suspect you will need to devise a schema that allows you to keep all versions of the record so an older version can be re-activated when necessary, but it should be a very uncommon thing to do.
|
|
|
|
|
This Undo/Redo should function only when the database I "open" ( I mean when someone is using it). When the application is closed , all the data that take care of tis function should be deleted , and when the application is open again the story start from beginning.
( I say I want to mimic Word , so as long as the document is open , can be Undo/Redo step by step , when the document is closed , and re-opened , the olds Undo/Redo are lost.)
|
|
|
|
|
Hello !
I'm using entity framework.
I have a bindingsource bound to entity.
First when I fill the bindingsource I use this :
Bindingsource.Datasource=(From t in context.MyTable1 where t.vl>5 select t).Tolist
Now , let's suppose that for some of the bindingsource's items the vl's value is change to a value lower than 5.
How can I refresh my bindingsource in order to be correct with the condition specified on my first expression ( t.vl>5). In other words how to remove these items with vl<5 from the bindingsource ( but of course without deleting them from datasource , and without querying the database again).
Thank you !
|
|
|
|
|
The way you've bound your data, you have no choice but to execute the query again.
Instead of doing the filtering in the query (your where clause) let the query return all the records instead and let the UI control displaying your data handle the filtering, if it supports doing such a thing. You don't tell us anything about your display control so it's impossible to say.
|
|
|
|
|
I found the Bindingsource.RemoveAt or BindingSource.Removecurrent.
If I use these commands , the item is removed from bindingsource .
But my question is : If after I call context.savechanges , these items will be removed from database too ?
If no , then I've found the solution.
|
|
|
|
|
Your first post made it sound like you were trying to remove these items from the grid by filtering.
Now you're talking about updating the database, removing these items from the database?
Which is it?
In order for items to be deleted, you have to retrieve the items to be deleted from the database so they are being tracked by Entity Framework. You then, in Entity Frameworks object tracker, tag those objects to be deleted, one by one. Then you can call SaveChanges() and they will be deleted from the database.
You seriously need to pickup a book on Entity Framework and work through it. You're asking a bunch of questions that would have been answered already had you gone through the book.
|
|
|
|
|
My question is simple :
On a bindingsource , the methods Removeat and RemoveCurrent , only remove the items from the bindingsource , or mark them for deletions even from database ?
|
|
|
|
|
It affects only the data bound to the binding source. In your case, that would be a List<> of objects.
What you're doing will not affect the database at all.
|
|
|
|
|
The application has about 30 forms, some forms have menubars.
All forms and controls are singleton pattern.
I want to search all controls in the application to find a control instance with the specific string name, like, "MenuLogin".
I tried Me.Controls, but it only contain the controls of the current form.
Thanks
|
|
|
|
|
You'll have to keep a collection of all Forms in the application, then implement a method on each Form that searches that Form for the control you want.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Assuming the forms you want to search are currently open, then you can use the Application.OpenForms collection[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Some are opened, some are not
|
|
|
|
|
I'm not quiet sure if I understood the question in the right way.
I suggest :
You iterate through the Application.OpenForms-collection to get the Forms of your Project.
This collection return you a Form. Inside each Form you iterate through the Form.Controls-collection and look for your control.
modified 23-Jun-15 4:40am.
|
|
|
|
|
How can i use freeze Pane for first row in excel by vb.net using EPPlus.dll for excel.
|
|
|
|
|
From the ExcelWorksheet object, access the View property. On the returned ExcelWorksheetView object, call the FreezePanes(row, column) method, passing in the row and column of the first cell which is not frozen.
For example, to freeze the first row, you would need to pass in 2 to the row parameter:
sheet.View.FreezePanes(2, 1)
One of the samples on the site demonstrates this:
https://epplus.codeplex.com/SourceControl/latest#SampleApp/Sample6.cs[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks it's work
|
|
|
|
|
how i can get data to text box and i replace to my list view like transaction on POS thanks pleasehelp us
|
|
|
|
|
Not a good question at all.
We have no idea what you mean by "get data to textbox". It could be as simple as MyTextBox.Text = "something" but we have no idea what your actual problem is.
As for the rest of your "question", it doesn't make any sense at all. More detail is going to be needed to figure out what you're trying to do.
|
|
|
|
|
Currently I'm using VB6 and Crystal Report 10 as my report Designer.
I can connect VB6 and Crystal report and view the report from access database.
My challenge is, I want to filter the report and view a specific data, for example, I want to view Employees that were employed between a specified date range (eg between 01/03/2014 - 31/12/2014)
And also a specific employee (by Name) Date of employment
from access database.
How can I do this ....?
Please Help.
|
|
|
|
|
You need to apply a filter to the Crystal Report - this book chapter[^] will point you in the right direction
|
|
|
|