public int WriteNewCard(short com, int baud, ref string kmm, short kzt, string kh, string dqdm, string yhh, string tm, int ql, int csql, int ccsql, short cs, int ljgql, short bkcs, int ljyql, int bjql, int czsx, int tzed, string sqrq, string cssqrq, int oldprice, int newprice, string sxrq, string sxbj)
{
byte[] mm = new byte[16] {0, 0, 0, 0, 0, 0, 0, 0, 0 ,0 ,0, 0,0,0,0,0};
byte[] cardNO = System.Text.Encoding.GetEncoding(1252).GetBytes(kh);
byte[] bdqdm = System.Text.Encoding.GetEncoding(1252).GetBytes("9A00");
byte[] byhh = new byte[10];
byte[] btm = new byte[8];
byte[] bsqrq = new byte[8] { 0, 0, 0, 0, 0, 0, 0, 0 };
byte[] bsxrq = new byte[8] { 0, 0, 0, 0, 0, 0, 0, 0 };
byte[] bsxbj = new byte[8] { 0, 0, 0, 0, 0, 0, 0, 0 };
Log.Debug("start write new card");
//发卡前先格式化卡
int ret = StaticFormatGasCard(com, baud, mm, 1, cardNO, bdqdm);
Log.Debug("format card end ret=" + ret);
ret = StaticWriteNewCard(com, baud, mm, 1, kzt, cardNO, bdqdm, byhh, btm,
ql * 10, cs, ljgql, bkcs, ljyql, bjql, czsx, tzed, bsqrq, 0, 0, bsxrq, bsxbj);
Log.Debug("write card end ret=" + ret);
return ret;
}