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,有些字体和颜色都是使用的全局属性, ...
随机推荐
- Python 面向对象编程——类定义与对象
<类定义与对象声明> 面向对象最重要的概念就是类(Class)和实例(Instance),必须牢记类是抽象的模板,比如Student类,而实例是根据类创建出来的一个个具体的“对象”,每个对 ...
- 【Python3】【贪心】hdu4296 Buildings
题意: n个板,每个板有重量和强度w和s,还有PDV值(上面的总重量-该板的强度) 对于某种叠放方式,PDV的最大值为其代表值 求该值的最小值 考虑只有两个板的情况:a和b,很显然下面的比上面的容 ...
- 给HTML初学者的三十条最佳实践
Nettuts +运营最困难的方面是为很多技能水平不同的用户提供服务.如果我们发布太多高级教程,我的新手用户将无法从中受益.相反也是如此.我们尽我们最大的努力,但如果你觉得你被忽略了请联系我们.这个网 ...
- CF1060C Maximum Subrectangle【乘法分配律】【最大子矩阵】
CF1060C Maximum Subrectangle 题意翻译 现在给出一个长度为N的a数列,一个长度为M的b数列. 现在需要构造出一个矩阵c,其中ci,j=ai×bj.再给出一个x,请在矩 ...
- Html的学习随笔
在<head>的<style>中定义样式,有#号,比如#header就是定义一种名为header的样式,后面用id=header来调用:而无#号,比如直接就是header,那后 ...
- Linux下Nginx+多Tocat下的负载均衡环境的简单搭建
本文主要分为四个部分: 1.Nginx的搭建:2.JDK+Tomcat的搭建:3.静态HTML的访问配置:4.负载均衡的配置 ===================================== ...
- Jmeter实现登录、创建BUG、解决bug的手写脚本
一.登录 1. 打开jmeter.添加线程组,命名为test,如下图: 2. 添加HTTp默认请求 1)服务器名称或IP:这里只能填写域名或IP地址 2)端口号:配 ...
- hibernate核心配置
# hibernate核心配置 注意: - hibernate.cfg.xml默认放在src目录下(这样可以自动加载该文件) - 必须配置的参数: * 数据库的四大参数和方言 - 可选配置的参 ...
- [Node.js]OS模块
摘要 Node.js有很多工具模块,比如os,path,net,dns,domain模块.这里先介绍os模块的使用方法.os模块提供了一些基本的系统操作函数. os模块 引入os模块 var os=r ...
- Monotouch/WCF: How to consume the wcf service without svcutil
Becuase monotouch compile to native code, so it has some limitation such as dynamic invoke is not al ...