public bool RateSubmit(string WindowUser, string WindowNo, string RateId, string attitude, string quality, string efficiency, string honest) { try { //先不判断重复 BCallModel cl = new BCallBLL().GetModelByHandleId(RateId); BEvaluateModel ev = new BEvaluateModel(); ev.ID = new BEvaluateBLL().GetMaxId(); ev.type = 1; ev.handId = cl.ID; ev.unitSeq = cl.unitSeq; ev.windowNumber = WindowNo; ev.handleTime = DateTime.Now; ev.custCardId = cl.idCard; ev.name = cl.qNmae; ev.windowUser = WindowUser; ev.approveSeq = cl.busiSeq; ev.evaluateAttitude = int.Parse(attitude); ev.evaluateEfficiency = int.Parse(efficiency); ev.evaluateHonest = int.Parse(honest); ev.evaluateQuality = int.Parse(quality); new BEvaluateBLL().Insert(ev); } catch (Exception ex) { File.AppendAllText(AppDomain.CurrentDomain.BaseDirectory + "log.txt", ex.Message + (ex.InnerException == null ? "" : ("\r\n" + ex.InnerException.Message))); return(false); } return(true); }
private void button4_Click(object sender, EventArgs e) { BEvaluateBLL eBll = new BEvaluateBLL(); var obj = eBll.GetSatisfied(2, DateTime.Parse("2017-01-01"), DateTime.Now); var objx = eBll.GetSatisfied(1, DateTime.Parse("2017-01-01"), DateTime.Now); BCallBLL cBll = new BCallBLL(); var obj2 = cBll.GetWaitFor(DateTime.Parse("2017-01-01"), DateTime.Now); var obj3 = eBll.GetEvaluate(DateTime.Parse("2017-01-01"), DateTime.Now); var obj4 = eBll.GetFavorableComment(DateTime.Parse("2017-01-01"), DateTime.Now); }
private void button4_Click(object sender, EventArgs e) { BEvaluateBLL eBll = new BEvaluateBLL(); var obj = eBll.GetSatisfied(2, DateTime.Parse("2017-01-01"), DateTime.Now); var objx = eBll.GetSatisfied(1, DateTime.Parse("2017-01-01"), DateTime.Now); BCallBLL cBll = new BCallBLL(); var obj2 = cBll.GetWaitFor(DateTime.Parse("2017-01-01"), DateTime.Now); var obj3 = eBll.GetEvaluate(DateTime.Parse("2017-01-01"), DateTime.Now); var obj4 = eBll.GetFavorableComment(DateTime.Parse("2017-01-01"), DateTime.Now); var obj5 = eBll.GetWorkPercent(1, DateTime.Parse("2018-11-01"), DateTime.Parse("2018-11-11"), null, null); this.richTextBox1.Text = new JavaScriptSerializer().Serialize(obj5); }
public SWaitTimeController() { this.bll = new BCallBLL("MySQL", this.AreaNo); }
//获取当前排队信息 private object GetQueueById(int Id) { var qBll = new BQueueBLL(); object obj = new object(); var model = qBll.GetModel(Id); if (model == null) { return(new { method = "GetQueueInfo", code = 0, desc = "无此编号的排队数据", result = new { } }); } var areaWindowStr = GetAreaWindowsStr(model.unitSeq, model.busTypeSeq); var isGreen = GetVipLever(model); var list = qBll.GetModelList(model.busTypeSeq, model.unitSeq, 0).Where(q => q.ID < model.ID).ToList(); int waitNo = list.Count;//计算等候人数 if (model.state == 1) { //已叫号/已处理 var call = new BCallBLL().GetModel(f => f.qId == Id && f.state != 2); if (call == null) { return(new { method = "GetQueueInfo", code = 0, desc = "无此编号的叫号数据", result = new { } }); } else { var currentState = call.ticketTime.Date != DateTime.Now.Date ? "已过期" : (call.state == -1 || call.state == 1) ? "已完成" : "已叫号"; obj = new { method = "GetQueueInfo", code = 1, desc = "处理成功", result = new { id = model.ID, area = areaWindowStr[0], windowStr = areaWindowStr[1], currentState = currentState, windowNo = "", waitCount = waitNo, unitSeq = model.unitSeq, unitName = model.unitName, busySeq = model.busTypeSeq, busyName = model.busTypeName, ticketNumber = model.ticketNumber, ticketTime = model.ticketTime.ToString("yyyy-MM-dd HH:mm:ss"), reserveSeq = model.reserveSeq, cardId = model.idCard, vip = isGreen, wxId = model.wxId } }; } } else { //排队中 obj = new { method = "GetQueueInfo", code = 1, desc = "处理成功", result = new { id = model.ID, area = areaWindowStr[0], windowStr = areaWindowStr[1], currentState = "排队中", windowNo = "", waitCount = waitNo, unitSeq = model.unitSeq, unitName = model.unitName, busySeq = model.busTypeSeq, busyName = model.busTypeName, ticketNumber = model.ticketNumber, ticketTime = model.ticketTime.ToString("yyyy-MM-dd HH:mm:ss"), reserveSeq = model.reserveSeq, cardId = model.idCard, vip = isGreen, wxId = model.wxId } }; } return(obj); }
//推送提醒 public object PushNotify(string Id) { var qBll = new BQueueBLL(); var oId = Convert.ToInt32(Id); object obj = new object(); var model = qBll.GetModel(oId); if (model == null) { return(new { method = "PushNotify", code = 0, desc = "无此编号的排队数据,排队已失效,请核查", result = new { } }); } else { if (model.state == 0) { return(new { method = "PushNotify", code = 0, desc = "该排队数据已失效,请核查", result = new { } }); } } var list = qBll.GetModelList(model.busTypeSeq, model.unitSeq, 0); var cModel = new BCallBLL().GetModel(f => f.qId == oId && f.state != 2); var areaWindowStr = GetAreaWindowsStr(model.unitSeq, model.busTypeSeq); var waitNo = 1; //返回该条数据以及三条待叫号数据 var objresult = new { method = "PushNotify", code = 1, desc = "处理成功", result = new { currentQueue = new { state = "已叫号", id = model.ID, ticketNumber = model.ticketNumber, windowName = cModel.windowNumber, unitSeq = model.unitSeq, unitName = model.unitName, busySeq = model.busTypeSeq, busyName = model.busTypeName, reserveSeq = model.reserveSeq, area = areaWindowStr[0], windowStr = areaWindowStr[1], cardId = model.idCard, vip = GetVipLever(model), wxId = model.wxId, }, waitQueue = list.OrderBy(o => o.ID).Take(3).Select(s => new { id = s.ID, area = areaWindowStr[0], windowStr = areaWindowStr[1], currentState = "排队中", windowNo = "", waitCount = waitNo++, unitSeq = s.unitSeq, unitName = s.unitName, busySeq = s.busTypeSeq, busyName = s.busTypeName, ticketNumber = s.ticketNumber, ticketTime = s.ticketTime.ToString("yyyy-MM-dd HH:mm:ss"), reserveSeq = s.reserveSeq, cardId = s.idCard, vip = GetVipLever(s), wxId = s.wxId }).ToList() } }; return(objresult); }