public static extern int ICReadXiMCard(ref int type, ref int flag, ref CICinf ic);
public int ReadGasCard(short com, int baud, ref string kh, ref int ql, ref decimal money, ref short cs, ref short bkcs,ref string dm) { int icdev= ICXiMInit( com, baud); int type = 0; int flag = 0; CICinf cf = new CICinf(); Log.Debug("XiMei ReadCard start "); int i = ICReadXiMCard(ref type, ref flag, ref cf); Log.Debug("XiMei ReadCard end and i is " + i + " quantity is " + cf.gas + " flag is " + flag+" cardid is "+cf.cardnum); kh = cf.cardnum.ToString(); cs = short.Parse(cf.cardntime.ToString()); ql = cf.gas/10; return i; }
public int WriteGasCard(short com, int baud, ref string kmm, string kh, string dqdm, int ql, int csql, int ccsql, short cs, int ljgql, int bjql, int czsx, int tzed, string sqrq, string cssqrq, int oldprice, int newprice, string sxrq, string sxbj) { int icdev = ICXiMInit(com, baud); int type = 0; int flag = 0; CICinf cf = new CICinf(); Log.Debug("XiMei ReadCard start "); int i = ICReadXiMCard(ref type, ref flag, ref cf); Log.Debug("XiMei ReadCard end and i is " + i + " quantity is " + cf.gas + " flag is " + flag + " cardid is " + cf.cardnum); int times = cs; Log.Debug("XiMei WriteGasCard Start and cardNo is " + kh + " cs is" + cs + " ql is " + ql); int ret = Sle4442_WriteCard_Consumer(cs , ql*10); Log.Debug("XiMei WriteGasCard end and ret is "+ret); return ret; }