• 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);
    }
    }
    }

  • 相关阅读:
    聊聊用机器人做无人驾驶
    透过国外初创公司看高精度地图难题
    百度Apollo无人驾驶入门课程下载
    关于高精度地图定义的探讨
    camera理论基础和工作原理
    FPGA配置OV5640摄像头及RGB图像数据采集
    详细的摄像头模组工作原理!!!
    摄像头PIN脚功能作用
    详解摄像头各个引脚的作用关系
    Linux下UDP的组播接收和发送的简单例子
  • 原文地址:https://www.cnblogs.com/quietwalk/p/3531610.html
Copyright © 2020-2023  润新知