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

  • 相关阅读:
    51单片机寄存器组的设置(转)
    51单片机堆栈深入剖析(转)
    do{...}while(0)的妙用(转)
    优化C/C++代码的小技巧(转)
    Struts2返回json
    详略。。设计模式1——单例。。。。studying
    [深入理解Android卷一全文-第十章]深入理解MediaScanner
    《python源代码剖析》笔记 Python虚拟机框架
    jQuery Validation让验证变得如此easy(三)
    mysql高可用架构方案之中的一个(keepalived+主主双活)
  • 原文地址:https://www.cnblogs.com/quietwalk/p/3531610.html
Copyright © 2011-2022 走看看