使用stes实现取消的最佳方法是什么 [英] What is the best way to implement cancel using stes

查看:88
本文介绍了使用stes实现取消的最佳方法是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个程序,使用wpf(C#)作为客户端和wcf服务服务器端。

对于数据交换,我使用stes(自我跟踪实体)。





在我的数据库中,我有一个表客户端和一个表存在。数据库模型见下文



< img src =https://dl.dropboxusercontent.com/u/18695256/DB.PNG/>

数据库模型 [ ^ ]



在我的wpf应用程序中,我有一个包含客户列表和更新在线状态的列表框





当客户被选中他的个人信息时,他今天的存在显示。



< img src =https://dl.dropboxusercontent.com/u/18695256/MainWindow.PNG/>

窗口图像 [ ^ ]



我知道图片是用不同的语言但是它只是为了向您展示它的样子。



显示客户信息我只是从服务器获取信息并使用viewmodel显示状态和客户端信息。 (如果用户没有在线状态,我会创建一个新客户信息,并将客户信息广告并提供给在线课程。







我想实现一个取消方法。

我发现:

你可以通过制作一份深层副本来做到这一点:喜欢:通过序列化和反序列化克隆 [ ^ ]



或使ste跟踪所有原始值并在点击取消时重新滚动。< br $> b $ b



还有其他选择吗?

您最喜欢哪个选项?

I made a program that uses wpf(C#) as client side and wcf service server side.
For data exchange i use stes(self tracking entities).


In my database i have a table clients and a table presence. database model see below

<img src="https://dl.dropboxusercontent.com/u/18695256/DB.PNG" />
database model[^]

In my wpf application i have a listbox with a list of clients and an update presence side


when a client is selected his personal info, his presence of today is shown.

<img src="https://dl.dropboxusercontent.com/u/18695256/MainWindow.PNG" />
window image[^]

I know the image is in a different language but its just to show you how it looks like.

To show the clients info i just fetch the info from the server and use a viewmodel to show presence and client info. ( if the user does not have a presence yet i make a new one and ad the client info and clientid to the presence class.



I want to implement a cancel method.
I have found:
that you can do that by making a deep copy: with something like: Clone by serialize and deserialize[^]

or make the ste track all the original values and reroll when there is clicked on cancel.


Are there other options?
And what option do you find best?

推荐答案

这篇关于使用stes实现取消的最佳方法是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆