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

  • 相关阅读:
    leetcode5 Longest Palindromic Substring
    leetcode17 Letter Combinations of a Phone Number
    leetcode13 Roman to Integer
    leetcode14 Longest Common Prefix
    leetcode20 Valid Parentheses
    leetcode392 Is Subsequence
    leetcode121 Best Time to Buy and Sell Stock
    leetcode198 House Robber
    leetcode746 Min Cost Climbing Stairs
    tomcat下使用druid配置jnid数据源
  • 原文地址:https://www.cnblogs.com/quietwalk/p/3531610.html
Copyright © 2011-2022 走看看