Пример #1
0
        // 满员方案拆分为票
        private void WriteTickets()
        {
            DataTable dt = new DAL.Views.V_SchemeSchedules().Open(ConnectionString, " ID, LotteryID, PlayTypeID, LotteryNumber, Multiple, Money", "Buyed = 0 and PrintOutType = 103 and (GetDate() between StartTime and EndTime) and Schedule >= 100 and not [ID] in (select SchemeID from T_SchemesSendToCenter)", "[ID]");

            if (dt == null)
            {
                msg.Send("读取方案错误(WriteTickets)。");
                log.Write("读取方案错误(WriteTickets)。");
                return;
            }

            DAL.Tables.T_Schemes t_Schemes = new DAL.Tables.T_Schemes();
            ElectronTicketBase.ElectronTicketTwo ElectronTicket = new ElectronTicketBase.ElectronTicketTwo();
            foreach (DataRow dr in dt.Rows)
            {
                List <string> TicekList    = ElectronTicket.ToResault(Convert.ToInt32(dr["PlayTypeID"].ToString()), dr["LotteryNumber"].ToString());
                string        LotterNumber = null;
                long          SchemeID     = Shove._Convert.StrToLong(dr["ID"].ToString(), -1);

                for (int j = 0; j < TicekList.Count; j++)
                {
                    LotterNumber += TicekList[j].ToString() + ",";
                }

                int     PlayTypeID = Shove._Convert.StrToInt(dr["PlayTypeID"].ToString(), -1);
                int     Multiple   = Shove._Convert.StrToInt(dr["Multiple"].ToString(), -1);
                decimal Money      = Convert.ToDecimal(dr["Money"].ToString());

                if ((SchemeID < 0) || (PlayTypeID < 0) || (Multiple < 1))
                {
                    msg.Send("读取方案错误(WriteTickets)。方案号:" + SchemeID.ToString());
                    log.Write("读取方案错误(WriteTickets)。方案号:" + SchemeID.ToString());

                    continue;
                }

                string TicketXML = "<Tickets>";
                TicketXML += "<Ticket LotteryNumber=\"" + LotterNumber + "\" Multiple=\"" + Multiple + "\" Money=\"" + Money + "\" />";
                TicketXML += "</Tickets>";

                int    ReturnValue       = 0;
                string ReturnDescription = "";

                int Result = DAL.Procedures.P_SchemesSendToCenterAdd(ConnectionString, SchemeID, PlayTypeID, TicketXML, ref ReturnValue, ref ReturnDescription);

                if ((Result < 0) || (ReturnValue < 0))
                {
                    msg.Send("票写入错误(WriteTickets):方案号:" + SchemeID.ToString() + "," + ReturnDescription);
                    log.Write("票写入错误(WriteTickets):方案号:" + SchemeID.ToString() + "," + ReturnDescription);
                }
            }
        }
Пример #2
0
        // 满员方案拆分为票
        private void WriteTickets()
        {
            DataTable dt = new DAL.Views.V_SchemeSchedules().Open(ConnectionString, "ID, LotteryID, PlayTypeID, LotteryNumber, Multiple, Money, (case LotteryID when 29 then -29 else LotteryID end) as LotteryID_2", "Buyed = 0 and (GetDate() between StartTime and EndTime) and BuyedShare >= Share and isnull(Identifiers, '') = '' and PrintOutType = 102 and State = 1 and dateadd(mi, 1, StateUpdateTime) <= GetDate() and LotteryID = 29", "LotteryID_2, UserType desc, [ID]");

            if (dt == null)
            {
                msg.Send("读取方案错误(WriteTickets)。");
                log.Write("读取方案错误(WriteTickets)。");

                return;
            }

            DAL.Tables.T_Schemes t_Schemes = new DAL.Tables.T_Schemes();

            foreach (DataRow dr in dt.Rows)
            {
                long SchemeID = Shove._Convert.StrToLong(dr["ID"].ToString(), -1);
                int LotteryID = Shove._Convert.StrToInt(dr["LotteryID"].ToString(), -1);
                string LotterNumber = dr["LotteryNumber"].ToString();
                int PlayTypeID = Shove._Convert.StrToInt(dr["PlayTypeID"].ToString(), -1);
                int Multiple = Shove._Convert.StrToInt(dr["Multiple"].ToString(), -1);

                if ((SchemeID < 0) || (LotteryID < 0) || (PlayTypeID < 0) || (Multiple < 1))
                {
                    msg.Send("读取方案错误(WriteTickets)。方案号:" + SchemeID.ToString());
                    log.Write("读取方案错误(WriteTickets)。方案号:" + SchemeID.ToString());

                    continue;
                }

                double Money = 0;
                SLS.Lottery.Ticket[] Tickets = null;

                try
                {
                    Tickets = new SLS.Lottery()[LotteryID].ToElectronicTicket_HPSH(PlayTypeID, LotterNumber, Multiple, 200, ref Money);
                }
                catch (Exception e)
                {
                    msg.Send("拆票错误(WriteTickets)。方案号:" + SchemeID.ToString() + "," + e.Message);
                    log.Write("拆票错误(WriteTickets)。方案号:" + SchemeID.ToString() + "," + e.Message);

                    continue;
                }

                if (Tickets == null)
                {
                    msg.Send("分解票错误(WriteTickets)。方案号:" + SchemeID.ToString());
                    log.Write("分解票错误(WriteTickets)。方案号:" + SchemeID.ToString());

                    continue;
                }

                if (Money != Shove._Convert.StrToDouble(dr["Money"].ToString(), -1))
                {
                    msg.Send("异常警告!!!!(WriteTickets)。方案号: " + SchemeID.ToString() + " 的购买金额与实际票的金额不符合!!!!");
                    log.Write("异常警告!!!!(WriteTickets)。方案号: " + SchemeID.ToString() + " 的购买金额与实际票的金额不符合!!!!");

                    SMS.Eucp.Gateway.CallResult SmsResult = segg.Send("13537697101", "异常警告!!!!(WriteTickets)。方案号: " + SchemeID.ToString() + " 的购买金额与实际票的金额不符合!!!!");

                    if (SmsResult.Code < 0)
                    {
                        log.Write("Send is Fail: " + SmsResult.Description);
                    }

                    SmsResult = segg.Send("13612833534", "异常警告!!!!(WriteTickets)。方案号: " + SchemeID.ToString() + " 的购买金额与实际票的金额不符合!!!!");

                    continue;
                }

                int TicketPlayTypeID = Tickets[0].PlayTypeID;

                string TicketXML = "<Tickets>";

                foreach (SLS.Lottery.Ticket ticket in Tickets)
                {
                    TicketXML += "<Ticket LotteryNumber=\"" + ticket.Number + "\" Multiple=\"" + ticket.Multiple + "\" Money=\"" + ticket.Money + "\" />";
                }

                TicketXML += "</Tickets>";

                int ReturnValue = 0;
                string ReturnDescription = "";

                int Result = DAL.Procedures.P_SchemesSendToCenterAdd(ConnectionString, SchemeID, TicketPlayTypeID, TicketXML, ref ReturnValue, ref ReturnDescription);

                if ((Result < 0) || (ReturnValue < 0))
                {
                    msg.Send("票写入错误(WriteTickets):方案号:" + SchemeID.ToString() + "," + ReturnDescription);
                    log.Write("票写入错误(WriteTickets):方案号:" + SchemeID.ToString() + "," + ReturnDescription);
                }
            }
        }
Пример #3
0
        //把方案拆分成票,并写入数据库
        private void WriteTickets()
        {
            DataTable dt = new DAL.Views.V_SchemeSchedules().Open(ConnectionString, "ID, LotteryID, PlayTypeID, LotteryNumber, Multiple, Money", "Buyed = 0 and PrintOutType = 101 and (GetDate() between StartTime and EndTime) and Schedule >= 100 and not [ID] in (select SchemeID from T_SchemesSendToCenter)", "[ID]");

            if (dt == null)
            {
                log.Write("向恒朋-重庆电子票网关发送数据出错:读取方案错误。");

                return;
            }

            foreach (DataRow dr in dt.Rows)
            {
                long SchemeID = Shove._Convert.StrToLong(dr["ID"].ToString(), -1);
                int LotteryID = Shove._Convert.StrToInt(dr["LotteryID"].ToString(), -1);
                string LotterNumber = dr["LotteryNumber"].ToString();
                int PlayTypeID = Shove._Convert.StrToInt(dr["PlayTypeID"].ToString(), -1);
                int Multiple = Shove._Convert.StrToInt(dr["Multiple"].ToString(), -1);

                if ((SchemeID < 0) || (LotteryID < 0) || (PlayTypeID < 0) || (Multiple < 1))
                {
                    log.Write("向恒朋-重庆电子票网关发送数据出错:读取方案错误。方案号:" + SchemeID.ToString());

                    continue;
                }

                double Money = 0;
                SLS.Lottery.Ticket[] Tickets = new SLS.Lottery()[LotteryID].ToElectronicTicket_HPCQ(PlayTypeID, LotterNumber, Multiple, 200, ref Money);

                if (Tickets == null)
                {
                    log.Write("向恒朋-重庆电子票网关发送数据出错:读取方案错误。方案号:" + SchemeID.ToString());

                    continue;
                }

                if (Money != Shove._Convert.StrToDouble(dr["Money"].ToString(), -1))
                {
                    log.Write("向恒朋-重庆电子票网关发送数据出错:异常警告!!!!。方案号:" + SchemeID.ToString() + "的购买金额与实际票的金额不符合!!!!");

                    continue;
                }

                int Count = 0;

                foreach (SLS.Lottery.Ticket ticket in Tickets)
                {
                    int TicketID = -1;
                    //long ID = -1;
                    string ReturnDescription = "";

                    Count++;

                    if (TicketID < 0)
                    {
                        log.Write("向恒朋-重庆电子票网关发送数据出错:部分票写入错误:" + ReturnDescription + ",方案号:" + SchemeID.ToString());

                        continue;
                    }
                }
            }
        }
Пример #4
0
        // 满员方案拆分为票
        private void WriteTickets()
        {
            DataTable dt = new DAL.Views.V_SchemeSchedules().Open(ConnectionString, "ID, LotteryID, PlayTypeID, LotteryNumber, Multiple, Money, (case LotteryID when 29 then -29 else LotteryID end) as LotteryID_2", "Buyed = 0 and (GetDate() between StartTime and EndTime) and BuyedShare >= Share and isnull(Identifiers, '') = '' and PrintOutType = 102 and State = 1 and dateadd(mi, 1, StateUpdateTime) <= GetDate() and LotteryID = 29", "LotteryID_2, UserType desc, [ID]");

            if (dt == null)
            {
                msg.Send("读取方案错误(WriteTickets)。");
                log.Write("读取方案错误(WriteTickets)。");

                return;
            }

            DAL.Tables.T_Schemes t_Schemes = new DAL.Tables.T_Schemes();

            foreach (DataRow dr in dt.Rows)
            {
                long   SchemeID     = Shove._Convert.StrToLong(dr["ID"].ToString(), -1);
                int    LotteryID    = Shove._Convert.StrToInt(dr["LotteryID"].ToString(), -1);
                string LotterNumber = dr["LotteryNumber"].ToString();
                int    PlayTypeID   = Shove._Convert.StrToInt(dr["PlayTypeID"].ToString(), -1);
                int    Multiple     = Shove._Convert.StrToInt(dr["Multiple"].ToString(), -1);

                if ((SchemeID < 0) || (LotteryID < 0) || (PlayTypeID < 0) || (Multiple < 1))
                {
                    msg.Send("读取方案错误(WriteTickets)。方案号:" + SchemeID.ToString());
                    log.Write("读取方案错误(WriteTickets)。方案号:" + SchemeID.ToString());

                    continue;
                }

                double Money = 0;
                SLS.Lottery.Ticket[] Tickets = null;

                try
                {
                    Tickets = new SLS.Lottery()[LotteryID].ToElectronicTicket_HPSH(PlayTypeID, LotterNumber, Multiple, 200, ref Money);
                }
                catch (Exception e)
                {
                    msg.Send("拆票错误(WriteTickets)。方案号:" + SchemeID.ToString() + "," + e.Message);
                    log.Write("拆票错误(WriteTickets)。方案号:" + SchemeID.ToString() + "," + e.Message);

                    continue;
                }

                if (Tickets == null)
                {
                    msg.Send("分解票错误(WriteTickets)。方案号:" + SchemeID.ToString());
                    log.Write("分解票错误(WriteTickets)。方案号:" + SchemeID.ToString());

                    continue;
                }

                if (Money != Shove._Convert.StrToDouble(dr["Money"].ToString(), -1))
                {
                    msg.Send("异常警告!!!!(WriteTickets)。方案号: " + SchemeID.ToString() + " 的购买金额与实际票的金额不符合!!!!");
                    log.Write("异常警告!!!!(WriteTickets)。方案号: " + SchemeID.ToString() + " 的购买金额与实际票的金额不符合!!!!");

                    SMS.Eucp.Gateway.CallResult SmsResult = segg.Send("13537697101", "异常警告!!!!(WriteTickets)。方案号: " + SchemeID.ToString() + " 的购买金额与实际票的金额不符合!!!!");

                    if (SmsResult.Code < 0)
                    {
                        log.Write("Send is Fail: " + SmsResult.Description);
                    }

                    SmsResult = segg.Send("13612833534", "异常警告!!!!(WriteTickets)。方案号: " + SchemeID.ToString() + " 的购买金额与实际票的金额不符合!!!!");

                    continue;
                }

                int TicketPlayTypeID = Tickets[0].PlayTypeID;

                string TicketXML = "<Tickets>";

                foreach (SLS.Lottery.Ticket ticket in Tickets)
                {
                    TicketXML += "<Ticket LotteryNumber=\"" + ticket.Number + "\" Multiple=\"" + ticket.Multiple + "\" Money=\"" + ticket.Money + "\" />";
                }

                TicketXML += "</Tickets>";

                int    ReturnValue       = 0;
                string ReturnDescription = "";

                int Result = DAL.Procedures.P_SchemesSendToCenterAdd(ConnectionString, SchemeID, TicketPlayTypeID, TicketXML, ref ReturnValue, ref ReturnDescription);

                if ((Result < 0) || (ReturnValue < 0))
                {
                    msg.Send("票写入错误(WriteTickets):方案号:" + SchemeID.ToString() + "," + ReturnDescription);
                    log.Write("票写入错误(WriteTickets):方案号:" + SchemeID.ToString() + "," + ReturnDescription);
                }
            }
        }
Пример #5
0
        //把方案拆分成票,并写入数据库
        private void WriteTickets()
        {
            DataTable dt = new DAL.Views.V_SchemeSchedules().Open(ConnectionString, "ID, LotteryID, PlayTypeID, LotteryNumber, Multiple, Money", "Buyed = 0 and PrintOutType = 101 and (GetDate() between StartTime and EndTime) and Schedule >= 100 and not [ID] in (select SchemeID from T_SchemesSendToCenter)", "[ID]");

            if (dt == null)
            {
                log.Write("向恒朋-重庆电子票网关发送数据出错:读取方案错误。");

                return;
            }

            foreach (DataRow dr in dt.Rows)
            {
                long   SchemeID     = Shove._Convert.StrToLong(dr["ID"].ToString(), -1);
                int    LotteryID    = Shove._Convert.StrToInt(dr["LotteryID"].ToString(), -1);
                string LotterNumber = dr["LotteryNumber"].ToString();
                int    PlayTypeID   = Shove._Convert.StrToInt(dr["PlayTypeID"].ToString(), -1);
                int    Multiple     = Shove._Convert.StrToInt(dr["Multiple"].ToString(), -1);

                if ((SchemeID < 0) || (LotteryID < 0) || (PlayTypeID < 0) || (Multiple < 1))
                {
                    log.Write("向恒朋-重庆电子票网关发送数据出错:读取方案错误。方案号:" + SchemeID.ToString());

                    continue;
                }

                double Money = 0;
                SLS.Lottery.Ticket[] Tickets = new SLS.Lottery()[LotteryID].ToElectronicTicket_HPCQ(PlayTypeID, LotterNumber, Multiple, 200, ref Money);

                if (Tickets == null)
                {
                    log.Write("向恒朋-重庆电子票网关发送数据出错:读取方案错误。方案号:" + SchemeID.ToString());

                    continue;
                }

                if (Money != Shove._Convert.StrToDouble(dr["Money"].ToString(), -1))
                {
                    log.Write("向恒朋-重庆电子票网关发送数据出错:异常警告!!!!。方案号:" + SchemeID.ToString() + "的购买金额与实际票的金额不符合!!!!");

                    continue;
                }

                int Count = 0;

                foreach (SLS.Lottery.Ticket ticket in Tickets)
                {
                    int TicketID = -1;
                    //long ID = -1;
                    string ReturnDescription = "";

                    Count++;

                    if (TicketID < 0)
                    {
                        log.Write("向恒朋-重庆电子票网关发送数据出错:部分票写入错误:" + ReturnDescription + ",方案号:" + SchemeID.ToString());

                        continue;
                    }
                }
            }
        }