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 PintCardCode = 0;
short PboolCard = 0;
StringBuilder PstrCustomer16Id = new StringBuilder(16);
StringBuilder PstrCardId = new StringBuilder(8);
StringBuilder PstrOtherCardId = new StringBuilder(8);
StringBuilder PstrOperatorId = new StringBuilder(8);
int PlongEnableUseGas = 0;
int PlongReturnGas = 0;
int PlongBuyGasNumber = 0;
int PlongAlarmGas = 0;
int PlongCardNumber = 0;
int rs = PSTestCard(com , baud, ref PintCardCode, ref PboolCard, PstrCustomer16Id, PstrCardId, ref PlongEnableUseGas,
ref PlongReturnGas, ref PlongBuyGasNumber, ref PlongAlarmGas, ref PlongCardNumber, PstrOtherCardId,
PstrOperatorId, 88888888);
int lrccn = PlongBuyGasNumber + 1;
int PintCheckErrorNumber = 0;
int pccn = PlongCardNumber;
StringBuilder kmm1 = new StringBuilder("888888");
StringBuilder yhh = PstrCustomer16Id;
StringBuilder kh1 = new StringBuilder(kh);
Log.Debug("PengSheng Write GasCard and ql is " + ql);
if (ql > 0)
{
Log.Debug("sellgas ql=" + ql + ",bkcs=" + pccn);
rs = PSCustomerCardBuyGas(com, baud, yhh, kh1, ql, ref PlongReturnGas, ref lrccn, ref bjql, pccn, 88888888, kmm1, ref PintCheckErrorNumber);
Log.Debug("sell gas end rs=" + rs + ",err=" + PintCheckErrorNumber);
return rs;
}
else
{
rs = PSCustomerCardBuyGas(com , baud, yhh, kh1, -PlongEnableUseGas, ref PlongReturnGas, ref lrccn, ref bjql, pccn, 88888888, kmm1, ref PintCheckErrorNumber);
Log.Debug("ret is "+rs);
return rs;
}
}