ListView 拖拽
private void ListView1_MouseMove(object sender, MouseEventArgs e)
{
Patientappointment appointment = ListView1.SelectedItem as Patientappointment;
if (appointment != null)
{
SelectedAppointment = appointment;
if (e.LeftButton == MouseButtonState.Pressed)
{
DragDrop.DoDragDrop(ListView1, appointment, DragDropEffects.Link);
}
}
}
private void ListView1_PreviewDragOver(object sender, DragEventArgs e)
{
Patientappointment appointment = e.OriginalSource as Patientappointment;
e.Effects = appointment == null ? DragDropEffects.None : DragDropEffects.Link;
}
private void ListView2_PreviewDrop(object sender, DragEventArgs e)
{
if (selectedAppointment != null)
{
selectedAppointment.Status = "checkin";
AppointmentAction appointmentAction = new AppointmentAction();
appointmentAction.UpdatePatientappointment(selectedAppointment);
patientappointmentCollection.Remove(selectedAppointment);
PatientAction patientAction = new PatientAction();
Patientmain patientmain = patientAction.ReadPatientmain(selectedAppointment.Patientid);
if (patientmain != null)
{
Outpatient outpatient = new Outpatient();
outpatient.Outpatientid = Guid.NewGuid().ToString();
outpatient.Patientid = selectedAppointment.Patientid;
outpatient.Patientname = selectedAppointment.Patientname;
outpatient.Doctorid = selectedAppointment.Doctorid;
outpatient.Doctorname = selectedAppointment.Doctorname;
outpatient.Appointmentid = selectedAppointment.Appointmentid;
outpatient.Checkintime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
outpatient.Contactphone = selectedAppointment.Contactphone;
outpatient.Gender = patientmain.Gender;
outpatient.Age = DateTime.Now.Year - Convert.ToDateTime(patientmain.Birthday).Year + "";
outpatient.Createddate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
outpatient.Creatorid = SysGlobal.ActiveUser.UserID;
outpatient.Status = "checkin";
OutpatientAction outpatientAction = new OutpatientAction();
outpatientAction.AddOutpatient(outpatient);
outpatientCollection.Add(outpatient);
}
}
}
ListView 拖拽的更多相关文章
- android ListView和GridView拖拽移位具体实现及拓展
关于ListView拖拽移动位置,想必大家并不陌生,比较不错的软件都用到如此功能了.如:搜狐,网易,百度等,但是相比来说还是百度的用户体验较好,不偏心了,下面看几个示例: 首 ...
- android ListView和GridView拖拽移位实现代码
关于ListView拖拽移动位置,想必大家并不陌生,比较不错的软件都用到如此功能了.如:搜狐,网易,百度等,但是相比来说还是百度的用户体验较好,不偏心了,下面看几个示例: 首先 ...
- C#拖拽操作
C#的拖拽 本文将以Winform为例 有两个主要的事件: DragEnter 拖拽到区域中触发的事件 DragDrop 当拖拽落下的时候出发此事件 饮水思源 参考博客: http://www.cnb ...
- Android学习系列(12)--App列表之拖拽GridView
根据前面文章中ListView拖拽的实现原理,我们也是很容易实现推拽GridView的,下面我就以相同步骤实现基本的GridView拖拽效果. 因为GridView不用做分组处理,代码处理起来 ...
- 可拖拽的ListView
今天研究了一下可拖拽的ListView ,当ListView的数据不能充满整个模拟器的时候,系统自带的listview上拖下拽都不好使,显得很单调, 为了实现上拖下拽时也能实现滚动的效果,这时候就需要 ...
- ListView往TreView里面拖拽
ListView往TreView里面拖拽 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Class ...
- ListView列表拖拽排序
ListView列表拖拽排序能够參考Android源代码下的Music播放列表,他是能够拖拽的,源代码在[packages/apps/Music下的TouchInterceptor.java下]. 首 ...
- Android高级控件(六)——自定义ListView高仿一个QQ可拖拽列表的实现
Android高级控件(六)--自定义ListView高仿一个QQ可拖拽列表的实现 我们做一些好友列表或者商品列表的时候,居多的需求可能就是需要列表拖拽了,而我们选择了ListView,也是因为使用L ...
- QML学习笔记(七)— 实现可拖拽、编辑、选中的ListView
鼠标单击可选中当前项,头部呈绿色显示:按压当前项可进行拖拽更换列表项位置:点击数据可以进行编辑: GitHub:八至 作者:狐狸家的鱼 这里是自己定义的model,有些字体和颜色都是使用的全局属性, ...
随机推荐
- NOI.AC WC模拟赛
4C(容斥) http://noi.ac/contest/56/problem/25 同时交换一行或一列对答案显然没有影响,于是将行列均从大到小排序,每次处理限制相同的一段行列(呈一个L形). 问题变 ...
- CodeIgniter框架中关于URL重写(index.php)的二三事
最近,在做自己的个人网站时,采用了轻量级的php框架CodeIgniter.乍一看上去,代码清晰简洁,MVC模型非常容易维护.开发时我采用的工具是Netbeans IDE 8.0,当然,本文的内容和开 ...
- hdu 5316 Magician(2015多校第三场第1题)线段树单点更新+区间合并
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5316 题意:给你n个点,m个操作,每次操作有3个整数t,a,b,t表示操作类型,当t=1时讲a点的值改 ...
- Codeforces Round #353 (Div. 2) D. Tree Construction 模拟
D. Tree Construction 题目连接: http://www.codeforces.com/contest/675/problem/D Description During the pr ...
- BZOJ 1012: [JSOI2008]最大数maxnumber 单调队列/线段树/树状数组/乱搞
1012: [JSOI2008]最大数maxnumber Time Limit: 3 Sec Memory Limit: 162 MBSubmit: 4750 Solved: 2145[Submi ...
- UVALive 6662 TheLastAnt
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> ...
- weblogic安装使用: Could not Create the Java Virtual Machine
第一次使用weblogic,完全不明白是怎么一回事!找安装包花了大把时间!找到了不知道怎么安装 -- _ --||| 找了一篇安装文档<weblogic 安装部署手册.doc>, 位于:[ ...
- 华为S5300系列升级固件S5300SI-V100R005C00SPC100.cc
这个固件附带了web,注意,这个插件是升级V200的必经固件,所以必须升级为此固件之后才能往下升级. 升级小插曲: 1.升级的使用使用Windows,不要用Mac或者Linux,因为从Mac/Linu ...
- SPOJ 10628. Count on a tree (树上第k大,LCA+主席树)
10628. Count on a tree Problem code: COT You are given a tree with N nodes.The tree nodes are number ...
- How do I use Tasker to run a sync in FolderSync?
First of all the full version is required. The full version works as a Tasker plugin - when you ...