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)
{
String buf;
Log.Debug("买气前读卡格式:");
MingHua.GetSnapShot(com, baud, out buf);
byte[] cardNo = System.Text.Encoding.GetEncoding(1252).GetBytes(kh);
Int32 syql = 0;//当前表剩余气量
Int32 klx = 0; //卡类型
Int32 orderamount = 0;
Int32 orderNum = 0;
byte[] cardid = new byte[20];
byte[] customeid = new byte[20];
Log.Debug("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)=("
+ com + "," + baud + "," + kmm + "," + kh
+ dqdm + "," + ql + "," + csql + "," + ccsql
+ cs + "," + ljgql + "," + bjql + "," + czsx
+ tzed + "," + sqrq + "," + cssqrq + "," + oldprice
+ newprice + "," + sxrq + "," + sxbj
+ ")");
int readresult = ReadGasCard(com, cardid, customeid, ref orderamount, ref orderNum, ref ljgql, ref syql, ref klx);
Log.Debug("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)=("
+ com + "," + baud + "," + kmm + "," + kh
+ dqdm + "," + ql + "," + csql + "," + ccsql
+ cs + "," + ljgql + "," + bjql + "," + czsx
+ tzed + "," + sqrq + "," + cssqrq + "," + oldprice
+ newprice + "," + sxrq + "," + sxbj
+ ")=" + readresult);
byte[] customeNo = customeid;
string khq = Encoding.ASCII.GetString(cardNo, 0, 8);
string yhhq = Encoding.ASCII.GetString(customeNo, 0, 10);
Log.Debug("sell gas start:"+"kh:"+khq+"--yhh:"+yhhq+"--cs:"+cs+"--ql:"+ql);
int result = StaticWriteGasCard(com, cardNo, customeNo, cs, ql);
Log.Debug("write gas card result=" + result);
Log.Debug("买气后读卡格式:");
String buf2;
MingHua.GetSnapShot(com, baud, out buf2);
Log.Debug(buf);
Log.Debug(buf2);
return result;
}
public int FormatGasCard(short com, int baud, string kmm, string kh, string dqdm)