/// <summary> /// 固定卡的临时收费 /// </summary> /// <param name="iccode"></param> /// <param name="fxLog"></param> /// <returns></returns> public int GetFixCardCurrentFee(string iccode, out CFixCardChargeLog fxLog) { fxLog = null; CICCard iccd = this.SelectByUserCode(iccode); if (iccd == null) { return(101); //不是本系统用卡 } if (iccd.Type != CICCard.EnmICCardType.Temp) { return(102); //该卡不是临时卡 } CLocation lct = new CWLocation().SelectLctFromICCode(iccode); if (lct == null) { return(103); //该卡没有存车 } fxLog = new CFixCardChargeLog(); fxLog.ICCode = iccd.Code; fxLog.InDate = lct.InDate; fxLog.RecivFee = new CWTariff().CalculateCardFee(DateTime.Now - fxLog.InDate); return(100); }
//查询固定卡收费 private void btnv_Click(object sender, EventArgs e) { try { txtFeeStandard.Text = ""; txtIccdType.Text = ""; txtCurrDue.Text = ""; nudmcnt.Value = 0; if (txtfixcd.Text.Trim() != "") { CICCard iccd = Program.mng.SelectByUserCode(txtfixcd.Text.Trim()); if (iccd != null) { string type = ""; switch (iccd.Type) { case EnmICCardType.Temp: type = "临时卡"; break; case EnmICCardType.Fixed: type = "定期卡"; break; case EnmICCardType.FixedLocation: type = "固定车位卡"; break; } txtIccdType.Text = type; txtCurrDue.Text = iccd.DueDtime.ToString(); btnFixFee.Enabled = true; //构建收费记录 tempFixLog = new CFixCardChargeLog(); tempFixLog.ICCode = iccd.Code; tempFixLog.ICType = iccd.Type; tempFixLog.DueDtime = iccd.DueDtime; rdMonth.Checked = true; lstTariffs = new List <CTariff>(Program.mng.SelectTariff()); //加载收费标准 if (lstTariffs != null) { CTariff tari = lstTariffs.Find(t => t.Type == tempFixLog.ICType && t.Unit == EnmFeeUnit.Month); if (tari != null) { txtFeeStandard.Text = tari.Fee.ToString(); } } } else { MessageBox.Show("该卡不是系统卡!"); } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
/// <summary> /// 更新缴费 /// </summary> /// <param name="nfcdlog"></param> /// <returns></returns> public int SetFixCardFee(CFixCardChargeLog nfcdlog) { try { CICCard iccd = this.SelectByUserCode(nfcdlog.ICCode); iccd.DueDtime = nfcdlog.DueDtime; CWData.myDB.UpdateICCardAndLog(iccd, nfcdlog); return(100); } catch (Exception e1) { new CWSException(); throw e1; } }