//删除预约信息
        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 async Task <ActionResult> Post([FromBody] CustomerCare customerContent)
        {
            await _service.Create(customerContent);

            return(CreatedAtRoute(
                       "GetCustomerCare",
                       new { Id = customerContent.Id },
                       customerContent));
        }
Beispiel #3
0
        public string UpdateWithdrawalRecord(int withdrawalRecordId, int accid = 0, int status = 5)
        {
            string ip           = HttpContext.Request.UserHostAddress;
            int    operatorId   = 0;
            string operatorName = string.Empty;

            if (Session["logUser"] != null)
            {
                ManageUserModel uM = (ManageUserModel)Session["logUser"];
                operatorId   = uM.UserID;
                operatorName = uM.UserName;
            }
            return(CustomerCare.UpdateWithdrawalStatus(withdrawalRecordId, status, ip, operatorId, accid, operatorName));
        }
Beispiel #4
0
        //修改关怀信息状态
        public void EditCustomerCare(int id)
        {
            CustomerCare customerCare = db.CustomerCare.Find(id);

            if (customerCare.ProcessedOrNot == 0)
            {
                customerCare.ProcessedOrNot = 1;
                db.SaveChanges();
            }
            else
            {
                customerCare.ProcessedOrNot = 0;
                db.SaveChanges();
            }
        }
Beispiel #5
0
        public bool IsCustomerCareResponsive(out bool blnApplicable)
        {
            blnApplicable = true;
            if (CustomerCare.Equals(_responsiveness[0]) || CustomerCare.Equals(_responsiveness[1]))
            {
                return(true);
            }

            if (CustomerCare.Equals(_responsiveness.Last()))
            {
                //Not sure if this case is applicable
                blnApplicable = false;
                return(true);
            }
            return(false);
        }
        public async Task <ActionResult> Put(int id, [FromBody] CustomerCare customerCare)
        {
            try
            {
                CustomerCare customerCare1
                    = await _service.GetSingleById(id);

                await _service.Update(customerCare1, customerCare);

                return(Ok(new { StatusCode = (int)HttpStatusCode.OK, Data = customerCare }));
            }
            catch (Exception e)
            {
                return(StatusCode(500));
            }
        }
Beispiel #7
0
        public string GetCarePartitionPer(DateTime startTime, DateTime endTime, string usrName, int index)
        {
            TimeSpan ts = endTime - startTime;

            if (ts.TotalDays <= 1)
            {
                startTime = startTime.AddDays(-1);
            }
            if (ts.TotalDays > 31)
            {
                return("");
            }
            string returnJson = "";

            returnJson = CustomerCare.GetCarePartitionPer(startTime, endTime, usrName, index);

            return(returnJson);
        }
Beispiel #8
0
        //新增关怀
        public void AddCustomerCare()
        {
            List <ClientMdicalIformation> clientMdicalIformation = db.ClientMdicalIformation.ToList();
            List <CustomerCare>           customerCare           = db.CustomerCare.ToList();

            //查询所有体检记录
            foreach (var item in clientMdicalIformation)
            {
                //查询所有关怀所有记录
                foreach (var item2 in customerCare)
                {
                    //计算item体检信息的日期>30天的体检记录true / false
                    DateTime time     = item.InspectionTime;
                    DateTime dateTime = DateTime.Now;
                    //巧用C#里ToString的字符格式化更简便
                    DateTime time2 = DateTime.Parse(time.AddMonths(1).ToShortDateString());

                    //现实时间比计算后的时间更晚,结果大于0才通过
                    if (DateTime.Compare(dateTime, time2) > 0)
                    {
                        //判断item2体检id是否存在item的id 不存在就可以添加
                        if (db.CustomerCare.Where(p => p.ConclusionID == item.ConclusionID).Count() > 0)
                        {
                        }
                        else
                        {
                            CustomerCare customerCare1 = new CustomerCare();
                            customerCare1.ConclusionID   = item.ConclusionID;
                            customerCare1.DoctorID       = item.DoctorID;
                            customerCare1.ProcessedOrNot = 0;
                            db.CustomerCare.Add(customerCare1);
                            db.SaveChanges();
                        }
                    }
                }
            }
        }
Beispiel #9
0
 public string getWithdrawRecord(int pageIndex = 1, int withdrawStatus = -99, int payType = -99, string withdrawalNo = "", string accId = "", string start = "", string end = "")
 {
     return(CustomerCare.GetWithdrawalRecord(pageIndex, withdrawStatus, payType, withdrawalNo, accId, start, end));
 }
Beispiel #10
0
 /// <summary>
 /// 获取回访信息
 /// </summary>
 /// <param name="startTime"></param>
 /// <param name="endTime"></param>
 /// <returns></returns>
 public string getVisitInfo()
 {
     return(CustomerCare.getVisitinfo());
 }
Beispiel #11
0
 /// <summary>
 /// 获取订单数据
 /// </summary>
 /// <param name="startTime"></param>
 /// <param name="endTime"></param>
 /// <param name="dayCnt"></param>
 /// <param name="type"></param>
 /// <param name="person"></param>
 /// <returns></returns>
 public string getOrderInfo(DateTime startTime, DateTime endTime, int dayCnt, int type, string person)
 {
     return(CustomerCare.getOrderInfo(startTime, endTime, dayCnt, type, person));
 }
Beispiel #12
0
 /// <summary>
 /// 获取客服汇总数据
 /// </summary>
 /// <param name="startTime"></param>
 /// <param name="endTime"></param>
 /// <returns></returns>
 public string getServiceInfo(DateTime startTime, DateTime endTime)
 {
     return(CustomerCare.getServiceInfo(startTime, endTime));
 }
Beispiel #13
0
 /// <summary>
 /// 返回订单续费数据Json
 /// </summary>
 /// <param name="stDate"></param>
 /// <param name="edDate"></param>
 /// <param name="type"></param>
 /// <returns></returns>
 public string GetOrderRenewal(DateTime stDate, DateTime edDate, string type)
 {
     return(CustomerCare.GetOrderRenewal(stDate, edDate, type));
 }
Beispiel #14
0
 public string GetCareRetention(DateTime stDate, DateTime edDate, string dateType, string usrName)
 {
     return(CustomerCare.GetCareRetention(stDate, edDate, dateType, usrName));
 }
Beispiel #15
0
 /// <summary>
 /// 获取回访信息详情
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public string getVisitDetail(int type)
 {
     return(CustomerCare.getVisitDetail(type));
 }