public WriteRet WriteGasCard(
Stream param, //附加参数
string factory, //厂家
string kmm, //卡密码,写卡后返回新密码
string kh, //卡号
string dqdm, //地区代码,从气表管理里取
string ql, //气量
string csql, //上次购气量,有些表需要传
string ccsql, //上上次购气量,有些表需要传
string cs, //购气次数
string ljgql, //当前表累计购气量
string bjql, //报警气量
string czsx, //充值上限,可以在气表管理中设置
string tzed, //透支额度,可以在气表管理中设置
string sqrq, //售气日期,格式为YYYYMMDD
string cssqrq, //上次售气日期,格式为YYYYMMDD
string oldprice, //旧单价,价格管理中取
string newprice, //新单价,价格管理中取
string sxrq, //生效日期,价格管理中取
string sxbj //生效标记,0不生效,1生效,价格管理中取
)
{
Log.Debug("WriteGasCard(string factory, string kmm, string kh, string dqdm, Int32 ql, Int32 csql, Int32 ccsql, " +
" Int16 cs, Int32 ljgql, Int32 bjql, Int32 czsx, Int32 tzed, string sqrq, string cssqrq, " +
" Int32 oldprice, Int32 newprice, string sxrq, string sxbj, Stream param)="
+ factory + "," + kmm + "," + kh + "," + dqdm + "," + ql + "," + csql + ","
+ ccsql + "," + cs + "," + ljgql + "," + bjql + "," + czsx + "," + tzed + ","
+ sqrq + "," + cssqrq + "," + oldprice + "," + newprice + "," + sxrq + "," + sxbj + "," + param + ")");
WriteRet ret = new WriteRet();
try
{
ICard card = GetCard(factory);
SetCardNewParameters(card, param); //设置新增参数
Int32 iql = Int32.Parse(ql);
Int32 icsql = Int32.Parse(csql);
Int32 iccsql = Int32.Parse(ccsql);
short scs = short.Parse(cs);
Int32 iljgql = Int32.Parse(ljgql);
Int32 ibjql = Int32.Parse(bjql);
Int32 iczsx = Int32.Parse(czsx);
Int32 itzed = Int32.Parse(tzed);
Int32 ioldprice = Int32.Parse(oldprice);
Int32 inewprice = Int32.Parse(newprice);
int r = card.WriteGasCard(Port, Baud, ref kmm, kh, dqdm, iql, icsql, iccsql, scs, iljgql, ibjql, iczsx,
itzed, sqrq, cssqrq, ioldprice, inewprice, sxrq, sxbj);
if (r != 0)
{
if (r <= -19 || r > 0)
{
ret.Err = GetCardSpecificError(card, r);
}
else
{
ret.Err = Errors[-r - 1];
}
}
else
{
ret.Kmm = kmm;
}
Log.Debug("WriteGasCard(string factory, string kmm, string kh, string dqdm, Int32 ql, Int32 csql, Int32 ccsql, " +
" Int16 cs, Int32 ljgql, Int32 bjql, Int32 czsx, Int32 tzed, string sqrq, string cssqrq, " +
" Int32 oldprice, Int32 newprice, string sxrq, string sxbj, Stream param)="
+ factory + "," + kmm + "," + kh + "," + dqdm + "," + ql + "," + csql + ","
+ ccsql + "," + cs + "," + ljgql + "," + bjql + "," + czsx + "," + tzed + ","
+ sqrq + "," + cssqrq + "," + oldprice + "," + newprice + "," + sxrq + "," + sxbj + "," + param + ")=" + r);
return ret;
}
catch (Exception e)
{
Log.Debug("WriteGasCard()=" + e.Message);
ret.Exception = e.Message;
return ret;
}
}