zoukankan      html  css  js  c++  java
  • 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);
    }
    }
    }

  • 相关阅读:
    Visual Studio 2019 开发 Python 及
    Delphi 的环境配置
    Delphi 的 TMS 控件安装方法
    网络爬虫-书籍与框架
    建筑行业(项目管理) BI 数据可视化分析案例
    DeepNude(一健脱衣)的算法以及通用图像生成的理论与实践研究
    matlab生成HEX文件-任意信号 大于64K长度
    SDRAM总结
    function [ binary,decimal ] = num2binary16( number )
    任意时钟分频
  • 原文地址:https://www.cnblogs.com/quietwalk/p/3531610.html
Copyright © 2011-2022 走看看