Exemplo n.º 1
0
        //删除回访记录
        public void DeleteCustomerReturnVisit(int id)
        {
            CustomerReturnVisit customerReturnVisit = db.CustomerReturnVisit.Find(id);

            db.CustomerReturnVisit.Remove(customerReturnVisit);
            db.SaveChanges();
        }
Exemplo n.º 2
0
        //删除预约信息
        public void DeleteCustomerAppointment(int id)
        {
            //删除预约表
            List <CustomerAppointment> customerAppointment = db.CustomerAppointment.Where(p => p.CustomerAppointmentID == id).ToList();

            if (customerAppointment.Count > 0)
            {
                foreach (var item in customerAppointment)
                {
                    //利用所有的预约id去查有没有体检信息,有则删除体检信息
                    ClientMdicalIformation clientMdicalIformation = db.ClientMdicalIformation.Where(p => p.CustomerAppointmentID == item.CustomerAppointmentID).ToList().FirstOrDefault();
                    if (clientMdicalIformation != null)
                    {
                        //删除客户回访信息
                        List <CustomerReturnVisit> customerReturnVisit = db.CustomerReturnVisit.Where(p => p.ConclusionID == clientMdicalIformation.ConclusionID).ToList();
                        if (customerReturnVisit.Count > 0)
                        {
                            foreach (var item1 in customerReturnVisit)
                            {
                                CustomerReturnVisit customerReturnVisit1 = db.CustomerReturnVisit.Where(p => p.ConclusionID == item1.ConclusionID).ToList().FirstOrDefault();
                                db.CustomerReturnVisit.Remove(customerReturnVisit1);
                                db.SaveChanges();
                            }
                        }

                        //删除客户关怀信息
                        List <CustomerCare> customerCare = db.CustomerCare.Where(p => p.ConclusionID == clientMdicalIformation.ConclusionID).ToList();
                        if (customerCare.Count() > 0)
                        {
                            foreach (var item2 in customerCare)
                            {
                                int          customerCareid = item2.CustomerCareID;
                                CustomerCare customerCare1  = db.CustomerCare.Where(p => p.ConclusionID == item2.ConclusionID).ToList().FirstOrDefault();
                                db.CustomerCare.Remove(customerCare1);
                                db.SaveChanges();
                            }
                        }

                        //删除体检信息之后才能删除内外科
                        db.ClientMdicalIformation.Remove(clientMdicalIformation);
                        db.SaveChanges();
                        //删除外科体检信息
                        int SurgicalExaminationID = clientMdicalIformation.SurgicalExaminationID;
                        SurgicalExamination surgicalExamination = db.SurgicalExamination.Find(SurgicalExaminationID);
                        db.SurgicalExamination.Remove(surgicalExamination);
                        db.SaveChanges();
                        //删除内科体检信息
                        int MedicalExaminationID = clientMdicalIformation.MedicalExaminationID;
                        MedicalExamination medicalExamination = db.MedicalExamination.Find(MedicalExaminationID);
                        db.MedicalExamination.Remove(medicalExamination);
                        db.SaveChanges();

                        //删除预约记录
                        CustomerAppointment customerAppointment1 = db.CustomerAppointment.Find(item.CustomerAppointmentID);
                        db.CustomerAppointment.Remove(customerAppointment1);
                        db.SaveChanges();
                    }
                }
            }
        }
        //修改户回访
        public ActionResult EditCustomerReturnVisit(int id)
        {
            ViewBag.UserDoctorList         = Bll.selectUserDoctorList();
            ViewBag.ClientMdicalIformation = Bll.SelectClientMdicalIformation();
            CustomerReturnVisit customerReturnVisit = Bll.SelectCustomerReturnVisit(id);

            return(View(customerReturnVisit));
        }
 //修改户回访
 public ActionResult EditCustomerReturnVisit(CustomerReturnVisit customerReturnVisit)
 {
     Bll.EditCustomerReturnVisit(customerReturnVisit);
     return(RedirectToAction("CustomerReturnVisit"));
 }
Exemplo n.º 5
0
 //修改回访记录
 public void EditCustomerReturnVisit(CustomerReturnVisit customerReturnVisit)
 {
     Dal.EditCustomerReturnVisit(customerReturnVisit);
 }
Exemplo n.º 6
0
 //增加回访记录
 public void AddCustomerReturnVisit(CustomerReturnVisit customerReturnVisit)
 {
     Dal.AddCustomerReturnVisit(customerReturnVisit);
 }
Exemplo n.º 7
0
 //增加回访记录
 public void AddCustomerReturnVisit(CustomerReturnVisit customerReturnVisit)
 {
     db.CustomerReturnVisit.Add(customerReturnVisit);
     db.SaveChanges();
 }
Exemplo n.º 8
0
 //修改回访记录
 public void EditCustomerReturnVisit(CustomerReturnVisit customerReturnVisit)
 {
     db.Entry(customerReturnVisit).State = System.Data.Entity.EntityState.Modified;
     db.SaveChanges();
 }