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 拖拽的更多相关文章

  1. android ListView和GridView拖拽移位具体实现及拓展

    关于ListView拖拽移动位置,想必大家并不陌生,比较不错的软件都用到如此功能了.如:搜狐,网易,百度等,但是相比来说还是百度的用户体验较好,不偏心了,下面看几个示例:              首 ...

  2. android ListView和GridView拖拽移位实现代码

    关于ListView拖拽移动位置,想必大家并不陌生,比较不错的软件都用到如此功能了.如:搜狐,网易,百度等,但是相比来说还是百度的用户体验较好,不偏心了,下面看几个示例:             首先 ...

  3. C#拖拽操作

    C#的拖拽 本文将以Winform为例 有两个主要的事件: DragEnter 拖拽到区域中触发的事件 DragDrop 当拖拽落下的时候出发此事件 饮水思源 参考博客: http://www.cnb ...

  4. Android学习系列(12)--App列表之拖拽GridView

    根据前面文章中ListView拖拽的实现原理,我们也是很容易实现推拽GridView的,下面我就以相同步骤实现基本的GridView拖拽效果.     因为GridView不用做分组处理,代码处理起来 ...

  5. 可拖拽的ListView

    今天研究了一下可拖拽的ListView ,当ListView的数据不能充满整个模拟器的时候,系统自带的listview上拖下拽都不好使,显得很单调, 为了实现上拖下拽时也能实现滚动的效果,这时候就需要 ...

  6. ListView往TreView里面拖拽

    ListView往TreView里面拖拽       unit Unit1; interface uses   Windows, Messages, SysUtils, Variants, Class ...

  7. ListView列表拖拽排序

    ListView列表拖拽排序能够參考Android源代码下的Music播放列表,他是能够拖拽的,源代码在[packages/apps/Music下的TouchInterceptor.java下]. 首 ...

  8. Android高级控件(六)——自定义ListView高仿一个QQ可拖拽列表的实现

    Android高级控件(六)--自定义ListView高仿一个QQ可拖拽列表的实现 我们做一些好友列表或者商品列表的时候,居多的需求可能就是需要列表拖拽了,而我们选择了ListView,也是因为使用L ...

  9. QML学习笔记(七)— 实现可拖拽、编辑、选中的ListView

    鼠标单击可选中当前项,头部呈绿色显示:按压当前项可进行拖拽更换列表项位置:点击数据可以进行编辑: GitHub:八至 作者:狐狸家的鱼 这里是自己定义的model,有些字体和颜色都是使用的全局属性, ...

随机推荐

  1. [HNOI2011]数学作业 --- 矩阵优化

    [HNOI2011]数学作业 题目描述: 小 C 数学成绩优异,于是老师给小 C 留了一道非常难的数学作业题: 给定正整数 N 和 M ,要求计算\(Concatenate(1..N)\; Mod\; ...

  2. BZOJ.4919.[Lydsy1706月赛]大根堆(线段树合并/启发式合并)

    题目链接 考虑树退化为链的情况,就是求一个最长(严格)上升子序列. 对于树,不同子树间是互不影响的.仿照序列上的LIS,对每个点x维护一个状态集合,即合并其子节点后的集合,然后用val[x]替换掉第一 ...

  3. Vue+Express实现前后端分离

    先说明一下缘由,因为自己前段时间在实习,实习期间为了参与项目开发,粗略学习了下Vue.Vuex.Vue-Router,大致会一些基础的.这里也快要做毕业设计了,趁着放假回来的这两天,学习下Node的相 ...

  4. Python编码规则

    1. 命名规则 1.1 变量名.包名.模块名 变量名通常有字母.数字和下划线组成,且首字母必须是字母或下划线,并且不能使用python的保留字:包名.模块名通常用小写字母 1.2 类名.对象名 类名首 ...

  5. Codeforces Round #360 (Div. 1) D. Dividing Kingdom II 暴力并查集

    D. Dividing Kingdom II 题目连接: http://www.codeforces.com/contest/687/problem/D Description Long time a ...

  6. windows下tomcat的安装配置

    一.下载相应的JDK以及tomcat的版本 JDK:jdk-8u131-windows-x64 tomcat:apache-tomcat-8.5.23-windows-x64.zip 二.JDK的安装 ...

  7. THE CUSTOMISER

    http://www.wanga.com/cu.php The Customiser incorporates all of the features of Magic Mouse. It also ...

  8. Linux 网络协议栈 图解

    http://www.cnblogs.com/sammyliu/p/5225623.html

  9. http://bbs.chinaunix.net/thread-169061-1-1.html

    http://bbs.chinaunix.net/thread-169061-1-1.html

  10. mybatis逆向工程--自动生成实体代码(mybatis-generator)

    随便找个目录,  添加文件, 如图 主要是两个jar包,  generator的下载路径:   https://github.com/mybatis/generator/releases   驱动包随 ...