void HandlerPaymentRequest(string mac, string ip, string channelNo, string orderid)
 {
     bool result = paymentinfo.Exists("mac = @0", (string.IsNullOrEmpty(mac) ? ip : mac));
     if (!result)
     {
         paymentinfo model = new paymentinfo();
         model.ip = ip;
         model.mac = (string.IsNullOrEmpty(mac) ? ip : mac);
         model.date_created = DateTime.Now;
         model.channelNo = channelNo;
         model.orderId = orderid;
         model.ptype = 1;
         object obj = model.Insert();
      
         int id = -1;
         if (int.TryParse(obj.ToString(), out id))
         {
             if (id > 0)
             {
                 PrintSuccessJson(true.ToString().ToLower());
             }
             else
             {
                 PrintSuccessJson(false.ToString().ToLower());
             }
         }
         else
         {
             PrintSuccessJson(false.ToString().ToLower());
         }
     }
     else
     {
         PrintSuccessJson(false.ToString().ToLower());
     }
 }
        void HandlerPaymentFail(string mac, string ip, string channelNo, string orderid)
        {
            paymentinfo model = new paymentinfo();
            model.ip = ip;
            model.mac = mac;
            model.date_created = DateTime.Now;
            model.channelNo = channelNo;
            model.orderId = orderid;
            model.ptype = 3;
            object obj = model.Insert();

            int id = -1;
            if (int.TryParse(obj.ToString(), out id))
            {
                if (id > 0)
                {
                    PrintSuccessJson(true.ToString().ToLower());
                }
                else
                {
                    PrintSuccessJson(false.ToString().ToLower());
                }
            }
            else
            {
                PrintSuccessJson(false.ToString().ToLower());
            }
        }
 void HandlerPaymentSuccess(string mac, string ip, string channelNo, string orderid, decimal payMoney, string payType, bool isDisplay)
 {
     bool result = paymentinfo.Exists("mac = @0 and ptype=2", mac);
     if (!result)
     {
         paymentinfo model = new paymentinfo();
         model.ip = ip;
         model.mac = mac;
         model.date_created = DateTime.Now;
         model.channelNo = channelNo;
         model.orderId = orderid;
         model.ptype = 2;
         model.payMoney = payMoney;
         model.payType = payType;
         model.isdisplay = isDisplay;
         object obj = model.Insert();
         int id = -1;
         if (int.TryParse(obj.ToString(), out id))
         {
             if (id > 0)
             {
                 PrintSuccessJson(true.ToString().ToLower());
             }
             else
             {
                 PrintSuccessJson(false.ToString().ToLower());
             }
         }
         else
         {
             PrintSuccessJson(false.ToString().ToLower());
         }
     }
     else
     {
         PrintSuccessJson(true.ToString().ToLower());
     }
 }