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,有些字体和颜色都是使用的全局属性, ...
随机推荐
- Android 使用ViewPager 做的半吊子的图片轮播
Android 使用ViewPager 做的半吊子的图片轮播 效果图 虽然不咋样,但是最起码的功能是实现了,下面我们来一步步的实现它. 界面 下面我们来分析一下界面的构成 整体的布局: 因为我们要做出 ...
- 减少TIME_WAIT连接状态
减少TIME_WAIT连接状态.网络上已经有不少相关的介绍,大多是建议: shell> sysctl net.ipv4.tcp_tw_reuse=1 shell> sysctl net.i ...
- centos 7 部署k8s集群
架构图: 前期准备 systemctl stop firewalldsystemctl disable firewalld yum -y install ntp systemctl start ntp ...
- 你的跑步姿势正确吗? 教你正确跑步姿势 & 常识
转载!!!!!搞IT必须运动一下 前言: 最近两年跑步的人越来越多,跑步在大部分人的观念中都是毫无技术含量,只要迈开腿就行了,其实这也是造成大多数跑步人士伤病的根源.对跑步的认知不足,跑步是一项看起来 ...
- 浅析SDWebImage
浅析SDWebImage 在日常的开发过程中,如果去优雅的访问网络的图片并去管理每个工程必须要面对的问题,如果想要在工程里面提供易用.简洁.方便管理的解决方案还是很有挑战的,毕竟还要兼顾图片文件的缓存 ...
- WinlogonHack获取系统密码
实验环境: win03 sp1 Gina.dll与Msgina.dll Gina.dll在NT/2000中交互式的登陆支持是由WinLogon调用Gina.dll实现的,Gina.dll提供了一个交互 ...
- android实现gif图播放、暂停、继续播放
之前做过一个项目,在android上实现gif图的播放以及点击屏幕弹出窗口显示gif图片的暂停,之前一直用gifView的jar包实现gif图片的显示,但是在gif暂停.继续播放这块没有找到好的解决方 ...
- bzoj 1209
三维凸包裸题. 1.通过volume计算有向体积,判断点与面的位置关系. 2.噪声 /********************************************************* ...
- POJ 3320 Jessica's Reading Problem 尺取法/map
Jessica's Reading Problem Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7467 Accept ...
- ROS知识(9)----安装Turtlebot2和远程控制Turtlebot2
安装turtlebot2,场景为:turtlebot2上搭载着一台电脑主机A,该电脑作为主机Master,有自带的电源和3D传感器,roscore在该台机器上启动.pc电脑远程连接A,和A通讯,pc不 ...