예제 #1
0
        /// <summary>
        /// 发送接收纸币指令,需要连续不断发送此指令
        /// </summary>
        /// <returns>读取的纸币金额</returns>
        public int GetInMoney(string Machineno, string OperatorID)
        {
            int moneycount = 0;

            StringBuilder sbinput   = new StringBuilder("<invoke name=\"BILLACCEPTORSTACKMONEYDETAIL\"><arguments></arguments></invoke>");
            string        strResult = XuHuiInterface_DLL.XmlTcp(sbinput, 0);

            Skynet.LoggingService.LogService.GlobalInfoMessage("调用XmlTcp获取存钞明细方法返回:" + strResult + ",输出参数:" + sbinput.ToString());

            System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
            doc.LoadXml(sbinput.ToString());
            System.Xml.XmlNode xnd = doc.SelectSingleNode("/return/arguments/string[@id='STACKMONEY']");
            if (xnd != null)
            {
                if (!string.IsNullOrEmpty(xnd.InnerText))
                {
                    //防止快速存钞后,方法返回结果出现多张信息,以|分割后,再循环操作
                    string[] mSaveResults = xnd.InnerText.Split('|');

                    LogService.GlobalInfoMessage("存钞函数返回结果" + xnd.InnerText);

                    foreach (var variable in mSaveResults)
                    {
                        //string[] arrstr = xnd.InnerText.Split(',');
                        string[] arrstr = variable.Split(',');
                        moneycount = Convert.ToInt32(arrstr[0]);
                        if (arrstr.Length >= 2)
                        {
                            LogService.GlobalInfoMessage("卡号:" + arrstr[1] + "存入明细金额:" + moneycount + ",存入时间:" + arrstr[2]);

                            AutoInMoneyRecordData theAutoInMoneyRecordData = new AutoInMoneyRecordData();
                            theAutoInMoneyRecordData.Cardno         = arrstr[1];
                            theAutoInMoneyRecordData.Inmoney        = moneycount;
                            theAutoInMoneyRecordData.Machineno      = Machineno;
                            theAutoInMoneyRecordData.Operatorcodeno = OperatorID;
                            theAutoInMoneyRecordData.Operatortime   = Convert.ToDateTime(arrstr[2]);
                            AutoInMoneyRecordFacade theAutoInMoneyRecordFacade = new AutoInMoneyRecordFacade();
                            theAutoInMoneyRecordFacade.Insert(theAutoInMoneyRecordData);
                        }
                        else
                        {
                            LogService.GlobalInfoMessage("存入金额:" + moneycount);
                        }
                    }
                }
            }
            return(moneycount);
        }
예제 #2
0
        private void QueryData()
        {
            _mSquareAccountsPresenter.GetBeginTime();

            label2.Text = "起始时间:" + SquareAccountsPresenter.MBeginTime;

            label4.Text = "终止时间:" + SquareAccountsPresenter.MEndTime;

            DataSet dataPre = _mSquareAccountsPresenter.GetPreData(SysOperatorInfo.OperatorID, Convert.ToDateTime(SquareAccountsPresenter.MBeginTime), Convert.ToDateTime(SquareAccountsPresenter.MEndTime), 1, true);
            //gridControl1.DataSource = dataPre.Tables[0];

            int mAmount = _mSquareAccountsPresenter.getTotalBankCardTransactions(SysOperatorInfo.OperatorID,
                                                                                 Convert.ToDateTime(SquareAccountsPresenter.MBeginTime),
                                                                                 Convert.ToDateTime(SquareAccountsPresenter.MEndTime));

            label7.Text = mAmount.ToString();

            backgroundWorker1.RunWorkerAsync();

            AutoInMoneyRecordFacade theAutoInMoneyRecordFacade = new AutoInMoneyRecordFacade();
            DataSet dsInmoney = theAutoInMoneyRecordFacade.GetInMoneyInfoByOperatorID(AutoHostConfig.Machineno, SysOperatorInfo.OperatorID, DateTime.Today);

            lblInMoney.Text       = dsInmoney.Tables[0].Compute("SUM(INMONEY)", "").ToString();
            gdcInmoney.DataSource = dsInmoney.Tables[0];

            CardSavingFacade theCardSavingFacade = new CardSavingFacade();
            DataSet          dsCardSaving        = theCardSavingFacade.GetAddMoneyRecord(DateTime.Today, SysOperatorInfo.OperatorID, "现金");

            //foreach (DataRow row in dsInmoney.Tables[0].Rows)
            //{
            //    int intlenght = row["CARDNO"].ToString().Length;
            //    if (intlenght > 10)
            //    {
            //        row["CARDNO1"] = row["CARDNO"].ToString().Substring(0, 6) + "*".PadLeft(intlenght - 10) + row["CARDNO"].ToString().Substring(intlenght - 4, 4);
            //    }
            //}
            //gdcAddMoney.DataSource = dsCardSaving.Tables[0];
            lblCardSaving.Text = dsCardSaving.Tables[0].Compute("SUM(ADDMONEY)", "").ToString();
        }