public CICCard() { meType = EnmICCardType.Temp; meStatus = EnmICCardStatus.Normal; mCDtime = DateTime.Now; msAddrs = ""; }
/// <summary> /// 卡类型文本改变触发 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CboCardType_SelectedIndexChanged(object sender, EventArgs e) { try { this.CboFeeTypeTariff.Items.Clear(); EnmICCardType eType = CStaticClass.ConvertICCardType(this.CboCardType.Text); if (EnmICCardType.Temp == eType) { this.CboFeeTypeTariff.Items.AddRange(new object[] { "小时卡" }); SetTempHourControl(true); } else { this.CboFeeTypeTariff.Items.AddRange(new object[] { "月卡", "季卡", "年卡" }); SetTempHourControl(false); } } catch (TimeoutException) { MessageBox.Show("The service operation timed out. ", "超时", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (FaultException exception) { MessageBox.Show(CStaticClass.GetExceptionInfo(exception), "SOAP错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (CommunicationException exception) { MessageBox.Show("There was a communication problem. " + CStaticClass.GetExceptionInfo(exception), "通信错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception exception) { MessageBox.Show(CStaticClass.GetExceptionInfo(exception), "应用程序异常", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <summary> /// 固定卡时收费标准“卡类型”值 /// </summary> public void SetCboCardType(EnmICCardType cardType) { this.CboCardType.Items.Clear(); switch (cardType) { case EnmICCardType.Temp: // 临时卡 { this.CboCardType.Items.AddRange(new object[] { "临时卡" }); break; } case EnmICCardType.Fixed: { this.CboCardType.Items.AddRange(new object[] { "定期卡", "固定车位卡" }); break; } case EnmICCardType.FixedLocation: { this.CboCardType.Items.AddRange(new object[] { "定期卡", "固定车位卡" }); break; } default: { this.CboCardType.Items.AddRange(new object[] { "临时卡", "定期卡", "固定车位卡" }); break; } } }
//ID不可用 public CICCard(string sCard, string sPCard, EnmICCardType etype, EnmICCardStatus estatus, DateTime losstime, DateTime duetime, int oweddays, int uid, string pnmd, DateTime cdt, string address, DateTime disposetime) : base(0, sCard) { mPhysicCode = sPCard; meType = etype; meStatus = estatus; mLosstime = losstime; mDuetime = duetime; mOwedDays = oweddays; mnUid = uid; //固定卡时,用户ID msPlatNumber = pnmd; mCDtime = cdt; //创建卡时间 msAddrs = address; mdDDtime = disposetime; //注销时间 }
public ActionResult FindCustomList(int?pageSize, int?pageIndex, string sortOrder, string sortName, string queryName, string queryValue) { #region CWICCard cwiccd = new CWICCard(); List <Customer> custLst = cwiccd.FindCustList(cust => true); List <CustomerModel> models = new List <CustomerModel>(); foreach (Customer cust in custLst) { CustomerModel model = new CustomerModel(); model.ID = cust.ID; model.UserName = cust.UserName; model.PlateNum = cust.PlateNum; model.Type = cust.Type; model.Warehouse = cust.Warehouse; model.LocAddress = cust.LocAddress; model.MobilePhone = cust.MobilePhone; model.Deadline = cust.Deadline.ToString(); model.FamilyAddress = cust.FamilyAddress; ICCard iccd = cwiccd.Find(ic => ic.CustID == cust.ID); if (iccd != null) { model.UserCode = iccd.UserCode; model.Status = iccd.Status; } models.Add(model); } List <CustomerModel> firstQuery = new List <CustomerModel>(); if (queryName != "0" && !string.IsNullOrEmpty(queryValue)) { #region if (queryName == "UserCode") { firstQuery = models.Where(md => md.UserCode.Contains(queryValue)).ToList(); } else if (queryName == "Type") { EnmICCardType type = EnmICCardType.Init; if (queryValue.Contains("临时")) { type = EnmICCardType.Temp; } else if (queryValue.Contains("定期")) { type = EnmICCardType.Periodical; } else if (queryValue.Contains("固定")) { type = EnmICCardType.FixedLocation; } else if (queryValue.ToUpper().Contains("VIP")) { type = EnmICCardType.VIP; } firstQuery = models.Where(md => md.Type == type).ToList(); } else if (queryName == "UserName") { firstQuery = models.Where(md => md.UserName.Contains(queryValue)).ToList(); } else if (queryName == "FamilyAddress") { firstQuery = models.Where(md => md.FamilyAddress.Contains(queryValue)).ToList(); } else if (queryName == "MobilePhone") { firstQuery = models.Where(md => md.MobilePhone.Contains(queryValue)).ToList(); } else if (queryName == "LocAddress") { firstQuery = models.Where(md => md.LocAddress == queryValue).ToList(); } else if (queryName == "PlateNum") { firstQuery = models.Where(md => md.PlateNum.Contains(queryValue)).ToList(); } #endregion } else { firstQuery.AddRange(models); } #region 排序 只允许几个字段可以排序 List <CustomerModel> sortList = new List <CustomerModel>(); if (!string.IsNullOrEmpty(sortName)) { if (sortName == "ID") { if (sortOrder.ToLower() == "asc") { var sort = from cu in firstQuery orderby cu.ID ascending select cu; sortList.AddRange(sort); } else { var sort = from cu in firstQuery orderby cu.ID descending select cu; sortList.AddRange(sort); } } else if (sortName == "Type") { if (sortOrder.ToLower() == "asc") { var sort = from cu in firstQuery orderby(int) cu.Type ascending select cu; sortList.AddRange(sort); } else { var sort = from cu in firstQuery orderby(int) cu.Type descending select cu; sortList.AddRange(sort); } } else if (sortName == "LocAddress") { if (sortOrder.ToLower() == "asc") { var sort = from cu in firstQuery orderby cu.LocAddress ascending select cu; sortList.AddRange(sort); } else { var sort = from cu in firstQuery orderby cu.LocAddress descending select cu; sortList.AddRange(sort); } } else if (sortName == "UserCode") { if (sortOrder.ToLower() == "asc") { var sort = from cu in firstQuery orderby cu.UserCode ascending select cu; sortList.AddRange(sort); } else { var sort = from cu in firstQuery orderby cu.UserCode descending select cu; sortList.AddRange(sort); } } else { sortList.AddRange(firstQuery); } } else { sortList.AddRange(firstQuery); } #endregion #endregion #region 分页 int index = 1; int size = 10; if (pageSize != null) { size = (int)pageSize; } if (pageIndex != null) { index = (int)pageIndex; } int total = firstQuery.Count; List <CustomerModel> last = sortList.Skip((index - 1) * size).Take(size).ToList(); #endregion var value = new { total = total, rows = last }; Task.Factory.StartNew(() => { #region 除没有绑定用户的指纹(垃圾指纹) CWFingerPrint cwfinger = new CWFingerPrint(); List <FingerPrint> noCustFPrintLst = cwfinger.FindList(fp => fp.CustID == 0); foreach (FingerPrint print in noCustFPrintLst) { cwfinger.Delete(print.ID, false); } #endregion }); return(Json(value)); }
/// <summary> /// 固定卡时收费标准“卡类型”值 /// </summary> public void SetCboCardType(EnmICCardType cardType, int nTariffID) { m_currentICCardType = cardType; m_nTariffID = nTariffID; }