Ejemplo n.º 1
0
    private static void SendMt(string userId, string serviceId, string commandCode, string message, string requestId)
    {
        var mtInfo = new MTInfo();
        var random = new Random();

        mtInfo.User_ID       = userId;
        mtInfo.Service_ID    = serviceId;
        mtInfo.Command_Code  = commandCode;
        mtInfo.Message_Type  = 0;
        mtInfo.Request_ID    = random.Next(100000000, 999999999).ToString();
        mtInfo.Total_Message = 1;
        mtInfo.Message_Index = 0;
        mtInfo.IsMore        = 0;
        mtInfo.Content_Type  = 0;
        mtInfo.Message       = message;

        SaveMtLog(userId, serviceId, commandCode, message, requestId, "VMG", 0);

        ZaloController.SmsMtInsertNew(mtInfo);
    }
Ejemplo n.º 2
0
        protected void HienThiNoiDung(Boolean thuchien)
        {
            pnlNoiDung.Visible = true;

            id = ConvertUtility.ToInt32(Request.QueryString["id"]);
            DataTable comXoSo     = XosoController.GetInfobyCompanyID(ConvertUtility.ToInt32(id));
            string    companycode = comXoSo.Rows[0]["company_comment"].ToString();

            string chitietGiaodich = "Ket qua xo so truc tiep: " + companycode + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);

            if (thuchien)
            {
                //insertMT
                mt              = new MTInfo();
                mt.User_ID      = Session["msisdn"].ToString();
                mt.Message      = "Ban da dang ky thanh cong dich vu lay ket qua truc tiep " + UnicodeUtility.UnicodeToKoDau(comXoSo.Rows[0]["company_name"].ToString()) + ". Cam on ban da su dung dich vu!";
                mt.Service_ID   = ConfigurationSettings.AppSettings.Get("kqchoxscommandcode");
                mt.Command_Code = ConfigurationSettings.AppSettings.Get("kqchoxscode");
                mt.Message_Type = (int)Constant.MessageType.FREE;
                Random random = new Random();
                mt.Request_ID    = random.Next(100000000, 999999999).ToString();
                mt.Total_Message = 1;
                mt.Message_Index = 0;
                mt.IsMore        = 0;
                mt.Content_Type  = 0;
                mt.ServiceType   = 47;//servicetype of kq cho xo so;
                MTController.SMS_MTInsert(mt);
                //insert mt waitting
                mtwaitting               = new MTWaittingInfo();
                mtwaitting.User_ID       = Session["msisdn"].ToString();
                mtwaitting.Message       = ConfigurationSettings.AppSettings.Get("kqchoxscode") + " " + companycode;
                mtwaitting.Service_ID    = ConfigurationSettings.AppSettings.Get("kqchoxscommandcode");
                mtwaitting.Command_Code  = ConfigurationSettings.AppSettings.Get("kqchoxscode");
                mtwaitting.Message_Type  = (int)Constant.MessageType.FREE;
                mtwaitting.Request_ID    = random.Next(100000000, 999999999).ToString();
                mtwaitting.Total_Message = 10;
                mtwaitting.Message_Index = 1;
                mtwaitting.IsMore        = 0;
                mtwaitting.Content_Type  = 0;
                mtwaitting.ServiceType   = 47;//dv  ket qua cho
                mtwaitting.UniqueId      = companycode;
                mtwaitting.ExpiredDate   = DateTime.Now.AddDays(10);
                mtwaitting.PartnerID     = string.Empty;
                mtwaitting.Operator      = Session["telco"].ToString();
                MTController.SMS_MTWaittingInsert(mtwaitting);
                //
                if (lang == "1")
                {
                    ltrTieuDe.Text  = "XỔ SỐ";
                    lblTen.Text     = "Kết quả xổ số trực tiếp";
                    ltrNoiDung.Text = "Bạn đã đăng ký thành công dịch vụ lấy kết quả trực tiếp " + comXoSo.Rows[0]["company_name"].ToString() + ".<br />Cảm ơn bạn đã sử dụng dịch vụ!";
                }
                else
                {
                    ltrTieuDe.Text  = "XO SO";
                    lblTen.Text     = "Ket qua xo so truc tiep";
                    ltrNoiDung.Text = "Ban da dang ky thanh cong dich vu lay ket qua truc tiep " + UnicodeUtility.UnicodeToKoDau(comXoSo.Rows[0]["company_name"].ToString()) + ".<br />Cam on ban da su dung dich vu!";
                };
                Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 11);
            }
            else
            {
                //Thông báo lỗi thanh toán
                if (lang == "1")
                {
                    ltrTieuDe.Text  = Resources.Resource.wThongBao;
                    ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan;
                }
                else
                {
                    ltrTieuDe.Text  = Resources.Resource.wThongBao_KD;
                    ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan_KD;
                }
                Transaction.Failure(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 11, messageReturn);
                //--Thông báo lỗi thanh toán
            }
            //log charging
            ILog logger = log4net.LogManager.GetLogger(Session["telco"].ToString());

            logger.Debug("--------------------------------------------------");
            logger.Debug("MSISDN:" + Session["msisdn"].ToString());
            logger.Debug("Dich vu: Xo so - Ket qua cho - parameter: " + price + " - Tinh: " + companycode + " - id: " + id);
            logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress);
            logger.Debug("Error:" + messageReturn);
            logger.Debug("Current Url:" + Request.RawUrl);
            //end log
        }
Ejemplo n.º 3
0
 public static void SmsMtInsertNew(MTInfo obj)
 {
     SqlHelper.ExecuteNonQuery(AppEnv.ConnectionStringVClip, "SMS_MT_Insert", obj.User_ID, obj.Message, obj.Service_ID, obj.Command_Code, obj.Message_Type, obj.Request_ID, obj.Total_Message, obj.Message_Index, obj.IsMore, obj.Content_Type, obj.ServiceType, obj.PartnerID, obj.Operator);
 }
Ejemplo n.º 4
0
        protected void HienThiNoiDung(Boolean thuchien)
        {
            pnlNoiDung.Visible = true;

            id = ConvertUtility.ToInt32(Request.QueryString["id"]);
            DataTable dtDetail = RTController.GetRingToneDetailByID(Session["telco"].ToString(), id);

            chitietGiaodich = "Nhạc: " + dtDetail.Rows[0]["SongNameUnicode"].ToString() + " -- id:" + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
            SoDT            = MobileUtils.ToSTDMobileNumber(SoDT);
            if (thuchien)
            {
                DataTable dtKhuyenMai = RTController.GetRingToneDetailRandom(Session["telco"].ToString(), id);
                string    khuyenmaiID = ConvertUtility.ToString(dtKhuyenMai.Rows[0]["W_RTItemID"]);
                lnkKhuyenMai.NavigateUrl = UrlProcess.GetGameDownloadItem(Session["telco"].ToString(), "2", khuyenmaiID, SecurityMethod.MD5Encrypt(khuyenmaiID));
                if (lang == "1")
                {
                    ltrTieuDe.Text = linkStr;
                    lblTen.Text    = dtDetail.Rows[0]["SongNameUnicode"].ToString();
                    //lnkDownload.Text = Resources.Resource.wBamDeTai;
                    ltrNoiDung.Text   = Resources.Resource.wTangThanhCong + " bản nhạc " + dtDetail.Rows[0]["SongNameUnicode"].ToString();
                    lnkKhuyenMai.Text = "Nhạc tặng: " + dtKhuyenMai.Rows[0]["SongNameUnicode"].ToString();
                }
                else
                {
                    ltrTieuDe.Text = linkStr_KD;
                    lblTen.Text    = dtDetail.Rows[0]["SongName"].ToString();
                    //lnkDownload.Text = Resources.Resource.wBamDeTai_KD;
                    ltrNoiDung.Text   = Resources.Resource.wTangThanhCong_KD + " ban nhac " + dtDetail.Rows[0]["SongName"].ToString();
                    lnkKhuyenMai.Text = "Nhac tang: " + dtKhuyenMai.Rows[0]["SongName"].ToString();
                };
                string url    = UrlProcess.GetGameDownloadItem(Session["telco"].ToString(), "2", id.ToString(), SecurityMethod.MD5Encrypt(id.ToString()));
                MTInfo mtInfo = new MTInfo();
                Random random = new Random();
                //Thông báo cho người được tặng
                mtInfo.User_ID       = SoDT;
                mtInfo.Service_ID    = ConfigurationSettings.AppSettings.Get("ringtonecommandcode");
                mtInfo.Command_Code  = ConfigurationSettings.AppSettings.Get("ringtonecode");
                mtInfo.Message_Type  = (int)Constant.MessageType.FREE;
                mtInfo.Request_ID    = random.Next(100000000, 999999999).ToString();
                mtInfo.Total_Message = 1;
                mtInfo.Message_Index = 0;
                mtInfo.IsMore        = 0;
                mtInfo.Content_Type  = 0;
                mtInfo.Message_Type  = (int)Constant.MessageType.FREE;
                mtInfo.Message       = "Ban nhan duoc qua tang nhac chuong " + dtDetail.Rows[0]["Code"].ToString() + " tu so dien thoai " + "0" + Session["msisdn"].ToString().Remove(0, 2);
                MTController.SMS_MTInsert(mtInfo);

                //MT thong bao cho nguoi gui tang biet
                mtInfo.Content_Type = 0;
                mtInfo.User_ID      = Session["msisdn"].ToString();
                mtInfo.Message      = "Ban da gui tang thanh cong nhac chuong " + dtDetail.Rows[0]["Code"].ToString() + " toi so dt " + SoDT;
                mtInfo.Message_Type = (int)Constant.MessageType.FREE;
                mtInfo.Request_ID   = random.Next(100000000, 999999999).ToString();
                MTController.SMS_MTInsert(mtInfo);

                //Build waplink send to customer and insert to MT table
                mtInfo.User_ID      = SoDT;
                mtInfo.Message      = "Tai nhac chuong duoc tang theo dia chi: " + url;
                mtInfo.Content_Type = 8;
                mtInfo.Message_Type = (int)Constant.MessageType.FREE;
                mtInfo.Request_ID   = random.Next(100000000, 999999999).ToString();
                MTController.SMS_MTInsert(mtInfo);

                Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, url, id.ToString(), chitietGiaodich, 2);
                RTController.SetDownloadCounter(Session["telco"].ToString(), id);
            }
            else
            {
                //Thông báo lỗi thanh toán
                if (lang == "1")
                {
                    ltrTieuDe.Text  = linkStr + " » " + Resources.Resource.wThongBao;
                    ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan;
                }
                else
                {
                    ltrTieuDe.Text  = linkStr_KD + " » " + Resources.Resource.wThongBao_KD;
                    ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan_KD;
                }
                Transaction.Failure(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 2, messageReturn);
                //--Thông báo lỗi thanh toán
            }
            //log charging
            ILog logger = log4net.LogManager.GetLogger(Session["telco"].ToString());

            logger.Debug("--------------------------------------------------");
            logger.Debug("MSISDN: " + Session["msisdn"].ToString());
            logger.Debug("So gui tang: " + SoDT);
            logger.Debug("Dich vu: Nhac chuong - parameter: " + price + " - Ten: " + dtDetail.Rows[0]["SongName"].ToString() + " - id: " + id);
            logger.Debug("Nhac chuong Url:" + lnkDownload.NavigateUrl);
            logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress);
            logger.Debug("Error:" + messageReturn);
            logger.Debug("Current Url:" + Request.RawUrl);
            //end log
        }
Ejemplo n.º 5
0
        protected void HienThiNoiDung(Boolean thuchien)
        {
            pnlNoiDung.Visible = true;

            id = ConvertUtility.ToInt32(Request.QueryString["id"]);
            string comcode = XosoController.GetInfobyCompanyID(id).Rows[0]["company_comment"].ToString();
            string comname = XosoController.GetInfobyCompanyID(id).Rows[0]["company_name"].ToString();

            string chitietGiaodich = "KQXS 20 ngày: " + comname + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);

            if (thuchien)
            {
                //insertMT
                mt              = new MTInfo();
                mt.User_ID      = Session["msisdn"].ToString();
                mt.Message      = "Ban da dang ky thanh cong dich vu lay ket qua xo so 20 ngay lien tiep tinh " + comname + ". Cam on ban da su dung dich vu!";
                mt.Service_ID   = AppEnv.GetSetting("xs20commandcode");
                mt.Command_Code = AppEnv.GetSetting("xs20code");
                mt.Message_Type = (int)Constant.MessageType.FREE;
                Random random = new Random();
                mt.Request_ID    = random.Next(100000000, 999999999).ToString();
                mt.Total_Message = 1;
                mt.Message_Index = 0;
                mt.IsMore        = 0;
                mt.Content_Type  = 0;
                mt.ServiceType   = 50;//servicetype of kq 20;
                MTController.SmsMtInsert(mt);

                //insert mt waitting
                mtwaitting               = new MTWaittingInfo();
                mtwaitting.User_ID       = Session["msisdn"].ToString();
                mtwaitting.Message       = AppEnv.GetSetting("xs20code") + " " + comcode;
                mtwaitting.Service_ID    = AppEnv.GetSetting("xs20commandcode");
                mtwaitting.Command_Code  = AppEnv.GetSetting("xs20code");
                mtwaitting.Message_Type  = (int)Constant.MessageType.FREE;
                mtwaitting.Request_ID    = random.Next(100000000, 999999999).ToString();
                mtwaitting.Total_Message = 20;
                mtwaitting.Message_Index = 1;
                mtwaitting.IsMore        = 0;
                mtwaitting.Content_Type  = 0;
                mtwaitting.ServiceType   = 50;//dv  ket qua 30 ngay
                mtwaitting.UniqueId      = comcode;
                mtwaitting.ExpiredDate   = DateTime.Now.AddDays(20);
                mtwaitting.PartnerID     = string.Empty;
                mtwaitting.Operator      = Session["telco"].ToString();
                MTController.SMS_MTXSWaittingInsert(mtwaitting);
                //
                //if (lang == "1")
                //{
                ltrTieuDe.Text  = linkStr;
                lblTen.Text     = "Xổ số 20 ngày liên tiếp";
                ltrNoiDung.Text = "Bạn đã đăng ký thành công dịch vụ lấy kết quả xổ số 20 ngày liên tiếp tỉnh " + comname + ".<br />Cảm ơn bạn đã sử dụng dịch vụ!";
                //}
                //else
                //{
                //    ltrTieuDe.Text = linkStr_KD;
                //    lblTen.Text = "Xo so 20 ngay lien tiep";
                //    ltrNoiDung.Text = "Ban da dang ky thanh cong dich vu lay ket qua xo so 20 ngay lien tiep tinh " + comname + ".<br />Cam on ban da su dung dich vu!";
                //}
                Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 12);
            }
            else
            {
                //Thông báo lỗi thanh toán
                //if (lang == "1")
                //{
                ltrTieuDe.Text  = linkStr + " » " + Resources.Resource.wThongBao;
                ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan;
                //}
                //else
                //{
                //    ltrTieuDe.Text = linkStr_KD + " » " + Resources.Resource.wThongBao_KD;
                //    ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan_KD;
                //}

                Transaction.Failure(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 12, messageReturn);

                //--Thông báo lỗi thanh toán
            }

            //log charging
            ILog logger = LogManager.GetLogger(Session["telco"].ToString());

            logger.Debug("--------------------------------------------------");
            logger.Debug("MSISDN:" + Session["msisdn"]);
            logger.Debug("Dich vu: Xo so - Ket qua 20 ngay - parameter: " + price + " - Tinh: " + comname + " - id: " + id);
            logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress);
            logger.Debug("Error:" + messageReturn);
            logger.Debug("Current Url:" + Request.RawUrl);
            //end log
        }
Ejemplo n.º 6
0
        protected void HienThiNoiDung(Boolean thuchien)
        {
            pnlNoiDung.Visible = true;

            id = ConvertUtility.ToInt32(Request.QueryString["id"]);
            DataTable dtDetail = GameController.GetGameDetailByID(Session["telco"].ToString(), id);

            chitietGiaodich = "Game: " + dtDetail.Rows[0]["GameNameUnicode"].ToString() + " -- id:" + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
            SoDT            = MobileUtils.ToSTDMobileNumber(SoDT);
            if (thuchien)
            {
                ltrTieuDe.Text = linkStr;
                if (lang == "1")
                {
                    lblTen.Text     = dtDetail.Rows[0]["GameNameUnicode"].ToString();
                    ltrNoiDung.Text = Resources.Resource.wTangThanhCong + " game " + dtDetail.Rows[0]["GameNameUnicode"].ToString() + " (" + dtDetail.Rows[0]["Game_Code"].ToString() + ")";
                }
                else
                {
                    lblTen.Text     = dtDetail.Rows[0]["GameName"].ToString();
                    ltrNoiDung.Text = Resources.Resource.wTangThanhCong_KD + " game " + dtDetail.Rows[0]["GameName"].ToString() + " (" + dtDetail.Rows[0]["Game_Code"].ToString() + ")";
                };
                string url;
                //if (",1,2,3,6,12,".LastIndexOf("," + ConvertUtility.ToString(dtDetail.Rows[0]["Partner_ID"]) + ",") == -1)
                //{
                //    url = UrlProcess.GetGameDownloadItem(Session["telco"].ToString(), "3", id.ToString(), SecurityMethod.MD5Encrypt(id.ToString()));
                //}
                //else
                //{
                //    GameUrl.MOReceiver urlservice = new WapXzone_VNM.GameUrl.MOReceiver();
                //    url = urlservice.ReturnWapUrlForGame(ConvertUtility.ToInt32(dtDetail.Rows[0]["GID"]));
                //    if (url.IndexOf("http://") == -1)
                //    {
                //        url = "http://" + url;
                //    }
                //}
                VMGGame.MOReceiver urlservice = new VMGGame.MOReceiver();
                url = urlservice.VMG_ReturnUrlForGame(ConvertUtility.ToString(dtDetail.Rows[0]["GID"]), 0, ConvertUtility.ToString(Session["msisdn"]), ConvertUtility.ToInt32(dtDetail.Rows[0]["Partner_ID"]), "XZONE", "WAP", Session["telco"].ToString(), "WAP.XZONE.VN", "", "");
                int indexofhttp = url.IndexOf("http://");
                if (indexofhttp == -1)
                {
                    url = "http://" + url;
                }
                else
                {
                    url = url.Substring(indexofhttp);
                }

                MTInfo mtInfo = new MTInfo();
                Random random = new Random();
                mtInfo.Service_ID    = ConfigurationSettings.AppSettings.Get("gamecommandcode");
                mtInfo.Command_Code  = ConfigurationSettings.AppSettings.Get("gamecode");
                mtInfo.Message_Type  = (int)Constant.MessageType.FREE;
                mtInfo.Total_Message = 1;
                mtInfo.Message_Index = 0;
                mtInfo.IsMore        = 0;
                if (freecate == false)
                {
                    //Thông báo cho người được tặng
                    mtInfo.User_ID      = SoDT;
                    mtInfo.Request_ID   = random.Next(100000000, 999999999).ToString();
                    mtInfo.Content_Type = 0;
                    mtInfo.Message_Type = (int)Constant.MessageType.FREE;
                    mtInfo.Message      = "Ban nhan duoc qua tang game " + dtDetail.Rows[0]["GameName"].ToString() + " tu so dien thoai " + "0" + ConvertUtility.ToString(Session["msisdn"]).Remove(0, 2);
                    MTController.SmsMtInsert(mtInfo);

                    //MT thong bao cho nguoi gui tang biet
                    mtInfo.Content_Type = 0;
                    mtInfo.User_ID      = Session["msisdn"].ToString();
                    mtInfo.Message      = "Ban da gui tang thanh cong game " + dtDetail.Rows[0]["GameName"].ToString() + " toi so dt " + SoDT;
                    mtInfo.Message_Type = (int)Constant.MessageType.FREE;
                    mtInfo.Request_ID   = random.Next(100000000, 999999999).ToString();
                    MTController.SmsMtInsert(mtInfo);
                }
                //Build waplink send to customer and insert to MT table
                mtInfo.User_ID      = SoDT;
                mtInfo.Message      = "Tai game duoc tang theo dia chi: " + url;
                mtInfo.Content_Type = 8;
                mtInfo.Message_Type = (int)Constant.MessageType.FREE;
                mtInfo.Request_ID   = random.Next(100000000, 999999999).ToString();
                MTController.SmsMtInsert(mtInfo);
                if (freecate == false)
                {
                    Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, url, id.ToString(), chitietGiaodich, 3);
                    GameController.SetDownloadCounter(Session["telco"].ToString(), id);
                }
            }
            else
            {
                //Thông báo lỗi thanh toán
                if (lang == "1")
                {
                    ltrTieuDe.Text  = Resources.Resource.wThongBao;
                    ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan;
                }
                else
                {
                    ltrTieuDe.Text  = Resources.Resource.wThongBao_KD;
                    ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan_KD;
                }
                Transaction.Failure(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 3, messageReturn);
                //--Thông báo lỗi thanh toán
            }
            if (freecate == false)
            {
                //log charging
                ILog logger = log4net.LogManager.GetLogger(Session["telco"].ToString());
                logger.Debug("--------------------------------------------------");
                logger.Debug("MSISDN: " + Session["msisdn"].ToString());
                logger.Debug("So gui tang: " + SoDT);
                logger.Debug("Dich vu: Game - parameter: " + price + " - Ten: " + dtDetail.Rows[0]["GameName"].ToString() + " - id: " + id);
                logger.Debug("Game Url:" + ConvertUtility.ToString(lnkDownload.NavigateUrl));
                logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress);
                logger.Debug("Error:" + messageReturn);
                logger.Debug("Current Url:" + Request.RawUrl);
                //end log
            }
        }
Ejemplo n.º 7
0
        protected void HienThiNoiDung(Boolean thuchien)
        {
            pnlNoiDung.Visible = true;

            id = ConvertUtility.ToInt32(Request.QueryString["id"]);
            DataTable soicau          = XosoController.GetSoicauInfoBycompanyID(id);
            string    chitietGiaodich = "Soi cau: " + soicau.Rows[0]["Content"].ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);

            //Neu ton tai soi cau
            if (soicau.Rows.Count > 0)
            {
                if (thuchien)
                {
                    //insertMT
                    mt              = new MTInfo();
                    mt.User_ID      = Session["msisdn"].ToString();
                    mt.Message      = soicau.Rows[0]["Content"].ToString();;
                    mt.Service_ID   = ConfigurationSettings.AppSettings.Get("xssoicaucommandcode");
                    mt.Command_Code = ConfigurationSettings.AppSettings.Get("xssoicode");
                    mt.Message_Type = (int)Constant.MessageType.FREE;
                    Random random = new Random();
                    mt.Request_ID    = random.Next(100000000, 999999999).ToString();
                    mt.Total_Message = 1;
                    mt.Message_Index = 0;
                    mt.IsMore        = 0;
                    mt.Content_Type  = 0;
                    MTController.SMS_MTInsert(mt);
                    //
                    if (lang == "1")
                    {
                        ltrTieuDe.Text  = "XỔ SỐ";
                        lblTen.Text     = "Soi cầu";
                        ltrNoiDung.Text = soicau.Rows[0]["Content"].ToString();;
                    }
                    else
                    {
                        ltrTieuDe.Text  = "XO SO";
                        lblTen.Text     = "Soi cau";
                        ltrNoiDung.Text = soicau.Rows[0]["Content"].ToString();;
                    };
                    Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 10);
                }
            }
            else
            {
                //Thông báo lỗi thanh toán
                if (lang == "1")
                {
                    ltrTieuDe.Text  = Resources.Resource.wThongBao;
                    ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan;
                }
                else
                {
                    ltrTieuDe.Text  = Resources.Resource.wThongBao_KD;
                    ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan_KD;
                }
                Transaction.Failure(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 10, messageReturn);
                //--Thông báo lỗi thanh toán
            }
            //log charging
            ILog logger = log4net.LogManager.GetLogger(Session["telco"].ToString());

            logger.Debug("--------------------------------------------------");
            logger.Debug("MSISDN:" + Session["msisdn"].ToString());
            logger.Debug("Dich vu: Xo so - Soi cau - parameter: " + price + " - id: " + id);
            logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress);
            logger.Debug("Error:" + messageReturn);
            logger.Debug("Current Url:" + Request.RawUrl);
            //end log
        }
Ejemplo n.º 8
0
        protected void HienThiNoiDung(Boolean thuchien, Boolean isLog)
        {
            pnlNoiDung.Visible = true;

            gameid = Request.QueryString["id"];//ThethaoController.GetSport_GameDetailBySportID(ConvertUtility.ToInt32(Request.QueryString["id"])).Rows[0]["PK_Game_ID"].ToString();
            DataTable sportinfo = ThethaoController.GetSport_GameDetailByID(gameid);

            //string chitietGiaodich = "Ket qua cho tran dau: " + sportinfo.Rows[0]["Team_Name1"].ToString() + " - " + sportinfo.Rows[0]["Team_Name2"].ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
            string chitietGiaodich = "Ket qua cho tran dau: " + sportinfo.Rows[0]["Team_Name1"] + " - " + sportinfo.Rows[0]["Team_Name2"];

            if (thuchien)
            {
                //insertMT
                string smscontent = "Bạn đã đăng ký thành công dịch vụ Kết quả chờ trận đấu " + sportinfo.Rows[0]["Team_Name1"].ToString() + " - " + sportinfo.Rows[0]["Team_Name2"].ToString() + ". Cảm ơn bạn đã sử dụng dịch vụ.";
                mt              = new MTInfo();
                mt.User_ID      = Session["msisdn"].ToString();
                mt.Message      = UnicodeUtility.UnicodeToKoDau(smscontent);
                mt.Service_ID   = ConfigurationSettings.AppSettings.Get("kqchocommandcode");
                mt.Command_Code = ConfigurationSettings.AppSettings.Get("kqchocode");
                mt.Message_Type = (int)Constant.MessageType.FREE;
                Random random = new Random();
                mt.Request_ID    = random.Next(100000000, 999999999).ToString();
                mt.Total_Message = 1;
                mt.Message_Index = 0;
                mt.IsMore        = 0;
                mt.Content_Type  = 0;
                mt.ServiceType   = 4;//servicetype of kq cho;
                MTController.SmsMtInsert(mt);
                //insert mt waitting
                mtwaitting               = new MTWaittingInfo();
                mtwaitting.User_ID       = Session["msisdn"].ToString();
                mtwaitting.Message       = "";
                mtwaitting.Service_ID    = ConfigurationSettings.AppSettings.Get("kqchocommandcode");
                mtwaitting.Command_Code  = ConfigurationSettings.AppSettings.Get("kqchocode");
                mtwaitting.Message_Type  = (int)Constant.MessageType.FREE;
                mtwaitting.Request_ID    = random.Next(100000000, 999999999).ToString();
                mtwaitting.Total_Message = 10;
                mtwaitting.Message_Index = 1;
                mtwaitting.IsMore        = 0;
                mtwaitting.Content_Type  = 0;
                mtwaitting.ServiceType   = 4;//dv  ket qua cho
                mtwaitting.UniqueId      = gameid;
                mtwaitting.ExpiredDate   = DateTime.Now.AddDays(10);
                mtwaitting.PartnerID     = string.Empty;
                mtwaitting.Operator      = AppEnv.CheckFreeContentMsisdn();
                MTController.SMS_MTWaittingInsert(mtwaitting);
                //insert wap transaction

                //
                if (lang == "1")
                {
                    ltrTieuDe.Text  = "BÓNG ĐÁ";
                    lblTen.Text     = "Kết quả chờ trận đấu";
                    ltrNoiDung.Text = smscontent;
                }
                else
                {
                    ltrTieuDe.Text  = "BONG DA";
                    lblTen.Text     = "Ket qua cho tran dau";
                    ltrNoiDung.Text = UnicodeUtility.UnicodeToKoDau(smscontent);
                }

                if (isLog)
                {
                    Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), gameid, chitietGiaodich, 8);
                }
            }
            else
            {
                //Thông báo lỗi thanh toán
                if (lang == "1")
                {
                    ltrTieuDe.Text  = Resources.Resource.wThongBao;
                    ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan;
                }
                else
                {
                    ltrTieuDe.Text  = Resources.Resource.wThongBao_KD;
                    ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan_KD;
                }

                if (isLog)
                {
                    Transaction.Failure(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), gameid, chitietGiaodich, 8, messageReturn);
                }
                //--Thông báo lỗi thanh toán
            }

            if (isLog)
            {
                //log charging
                ILog logger = log4net.LogManager.GetLogger(Session["telco"].ToString());
                logger.Debug("--------------------------------------------------");
                logger.Debug("MSISDN: " + Session["msisdn"].ToString());
                logger.Debug("Dich vu: Ket qua cho (truc tiep) " + gameid);
                logger.Debug("Chi tiet: " + chitietGiaodich);
                logger.Debug("IP: " + HttpContext.Current.Request.UserHostAddress);
                logger.Debug("Error: " + messageReturn);
                logger.Debug("Current Url: " + Request.RawUrl);
                //end log
            }
        }