Example #1
0
        protected void btnReg_Click(object sender, EventArgs e)
        {
            pnlNoiDung.Visible = true;
            int id = ConvertUtility.ToInt32(Request.QueryString["id"]);

            if (id > 0)
            {
                DataTable tblServices = WapController.S2_94xGetServiceInfo(id);
                if (tblServices == null || tblServices.Rows.Count < 1)
                {
                    return;
                }
                if (tblServices.Rows[0]["status"].ToString() != "3")
                {
                    return;
                }


                string dangkyThanhCong = string.Empty;
                string doubleDangKy    = string.Empty;
                string tenDichVu       = string.Empty;

                string regisSystax = tblServices.Rows[0]["Register_Syntax"].ToString().Split('|')[0];

                if (Session["msisdn"] != null && Session["msisdn"].ToString() != "")
                {
                    ltrTieuDe.Text  = "Đăng ký " + tblServices.Rows[0]["Product_Name"].ToString();
                    tenDichVu       = tblServices.Rows[0]["Product_Name"].ToString();
                    dangkyThanhCong = tblServices.Rows[0]["Right_Syntax_MT"].ToString();
                    doubleDangKy    = tblServices.Rows[0]["Double_Register_MT"].ToString();
                    string result = AppEnv.RegisterService(AppEnv.GetSetting("S2ShortCode"), "0", Session["msisdn"].ToString(), "DK", regisSystax);//Andy Service S2_94x

                    string[] arrResult = result.Split('|');

                    if (arrResult[0] == "1")//DK THANH CONG
                    {
                        ltrNoiDung.Text = dangkyThanhCong;
                    }
                    else if (arrResult[0] == "0")//DOUBE DK
                    {
                        ltrNoiDung.Text = doubleDangKy;
                    }
                    else if (arrResult[0] == "-1")//DK THAT BAI - SAI CU PHAP
                    {
                        ltrNoiDung.Text = "Đăng ký không thành công. Vui lòng thử lại <br /> Hoặc soạn tin <b> " + regisSystax + "</b> gửi <b>" + AppEnv.GetSetting("S2ShortCode") + "</b>";
                    }
                }
                else
                {
                    ltrNoiDung.Text = "Hệ thống không xác định được số điện thoại của bạn <br /> Vui lòng truy cập bằng 3G/GPRS <br /> Hoặc soạn tin <b> " + regisSystax + "</b> gửi <b>" + AppEnv.GetSetting("S2ShortCode") + "</b>";
                }
            }
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string Telco   = "Other";
            int    IsWifi  = 1;
            string user_id = "khach";

            if (!Page.IsPostBack)
            {
                if (AppEnv.GetSetting("TestFlag") == "1")
                {
                    Session["telco"] = Constant.T_Vietnamobile;
                    //Session["msisdn"] = "0987765522";
                }
                //Session["msisdn"] = "841866728649";
                if (Session["msisdn"] == null)
                {
                    int    is3g   = 0;
                    string msisdn = MobileUtils.GetMSISDN(out is3g);
                    if (!string.IsNullOrEmpty(msisdn) && MobileUtils.CheckOperator(msisdn, "vietnammobile"))
                    {
                        Session["telco"]  = Constant.T_Vietnamobile;
                        Session["msisdn"] = msisdn;
                    }
                    else
                    {
                        Session["msisdn"] = null;
                        Session["telco"]  = Constant.T_Undefined;
                    }
                }

                pnlNoiDung.Visible = true;

                int id = ConvertUtility.ToInt32(Request.QueryString["id"]);
                if (id > 0)
                {
                    DataTable tblServices = WapController.S2_94xGetServiceInfo(id);
                    if (tblServices == null || tblServices.Rows.Count < 1)
                    {
                        return;
                    }
                    //if (tblServices.Rows[0]["status"].ToString() != "3")
                    //{
                    //    return;
                    //}


                    string dangkyThanhCong = string.Empty;
                    string doubleDangKy    = string.Empty;
                    string tenDichVu       = string.Empty;

                    string regisSystax = tblServices.Rows[0]["Register_Syntax"].ToString().Split('|')[0];

                    if (Session["msisdn"] != null && Session["msisdn"].ToString() != "")
                    {
                        Telco   = "VNM";
                        IsWifi  = 0;
                        user_id = Session["msisdn"].ToString();

                        ltrTieuDe.Text  = "Đăng ký " + tblServices.Rows[0]["Product_Name"].ToString();
                        tenDichVu       = tblServices.Rows[0]["Product_Name"].ToString();
                        lblTen1.Text    = tenDichVu;
                        dangkyThanhCong = tblServices.Rows[0]["Right_Syntax_MT"].ToString();
                        doubleDangKy    = tblServices.Rows[0]["Double_Register_MT"].ToString();
                        if (AppEnv.GetSetting("DK1chamVNMtest").ToString() == "1")
                        {
                            pnlConfirm.Visible = false;
                            string result = AppEnv.RegisterService(AppEnv.GetSetting("S2ShortCode"), "0", Session["msisdn"].ToString(), "DK", regisSystax);//Andy Service S2_94x

                            string[] arrResult = result.Split('|');

                            if (arrResult[0] == "1")//DK THANH CONG
                            {
                                ltrNoiDung.Text = dangkyThanhCong;
                            }
                            else if (arrResult[0] == "0")//DOUBE DK
                            {
                                ltrNoiDung.Text = doubleDangKy;
                            }
                            else if (arrResult[0] == "-1")//DK THAT BAI - SAI CU PHAP
                            {
                                ltrNoiDung.Text = "Đăng ký không thành công. Vui lòng thử lại <br /> Hoặc soạn tin <b> " + regisSystax + "</b> gửi <b>" + AppEnv.GetSetting("S2ShortCode") + "</b>";
                            }
                        }
                        else
                        {
                            pnlConfirm.Visible = true;
                        }
                    }
                    else
                    {
                        Response.Redirect("http://wap.vietnamobile.com.vn/tin-tuc.aspx");
                        //ltrNoiDung.Text = "Hệ thống không xác định được số điện thoại của bạn <br /> Vui lòng truy cập bằng 3G/GPRS <br /> Hoặc soạn tin <b> " + regisSystax + "</b> gửi <b>" + AppEnv.GetSetting("S2ShortCode") + "</b>";
                        //ltrNoiDung.Text = "<font size=3> Để đăng ký dịch vụ " + tblServices.Rows[0]["Service_Name"].ToString() + " của Vietnamobile, Quý Khách vui lòng soạn tin <b> " + regisSystax + "</b> gửi <b>" + AppEnv.GetSetting("S2ShortCode") + "</b></font>";
                        //if (id == 800 || id == 812||id==813)
                        //{
                        //    Response.Redirect("/Video/Default.aspx?lang=1&display=home&w=320");
                        //}
                        //else
                        //{
                        //    ltrNoiDung.Text = "<font size=3> Để đăng ký dịch vụ " + tblServices.Rows[0]["Service_Name"].ToString() + " của Vietnamobile, Quý Khách vui lòng soạn tin <b> " + regisSystax + "</b> gửi <b>" + AppEnv.GetSetting("S2ShortCode") + "</b></font>";
                        //}
                    }
                    #region Device_Log
                    try
                    {
                        if (Application["wurflFileProcessor"] == null)
                        {
                            string s_path = HttpContext.Current.Request.MapPath("..\\WURFL_Data\\wurfl.xml");
                            Application["wurflFileProcessor"] = new wurflApi.deviceFileProcessor(s_path);
                        }
                        wurflApi.deviceFileProcessor o_deviceFileProcessor = (Application["wurflFileProcessor"] as wurflApi.deviceFileProcessor);
                        // prepare capability getter
                        wurflApi.capabilitiesGetter o_capabilityGetter = new wurflApi.capabilitiesGetter(ref o_deviceFileProcessor);
                        o_capabilityGetter.prepareNavigatorModelCapabilities(Request);
                        User_AgentInfo _info = new User_AgentInfo();
                        _info.device_os         = o_capabilityGetter.getCapability("device_os");
                        _info.mobile_browser    = o_capabilityGetter.getCapability("mobile_browser");
                        _info.resolution_width  = o_capabilityGetter.getCapability("resolution_width");
                        _info.resolution_height = o_capabilityGetter.getCapability("resolution_height");
                        _info.model_name        = o_capabilityGetter.getCapability("model_name");
                        _info.brand_name        = o_capabilityGetter.getCapability("brand_name");
                        //WapController.VmgAds94x_Log_Insert(HttpContext.Current.Request.UserAgent, _info.model_name, _info.brand_name, _info.device_os, _info.mobile_browser, _info.resolution_width, _info.resolution_height, Telco, IsWifi, 1, Request.Url.AbsoluteUri, id.ToString(), HttpContext.Current.Request.UserHostAddress, "0", "MSISDN", Session["msisdn"].ToString(), "Request", 1, id);
                        WapController.VmgAds94x_Log_Insert(HttpContext.Current.Request.UserAgent, _info.model_name, _info.brand_name, _info.device_os, _info.mobile_browser, _info.resolution_width, _info.resolution_height, Telco, IsWifi, 1, Request.Url.AbsoluteUri, id.ToString(), HttpContext.Current.Request.UserHostAddress, "0", "MSISDN", user_id, "Request", 1, id);
                    }
                    catch (Exception ex)
                    {
                    }
                    #endregion
                }
                else

                {
                    Response.Redirect("http://wap.vietnamobile.com.vn/Wap/Default.aspx?lang=1&w=320");
                }
            }
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string msisdn;
            string Telco  = "Other";
            int    IsWifi = 1;

            if (!Page.IsPostBack)
            {
                int    type          = ConvertUtility.ToInt32(Request.QueryString["type"]);
                int    id            = ConvertUtility.ToInt32(Request.QueryString["id"]);
                string transactionID = Request.QueryString["transactionID"];
                int    is3g          = 0;

                msisdn = MobileUtils.GetMSISDN(out is3g);
                #region Device_Log
                if (Application["wurflFileProcessor"] == null)
                {
                    string s_path = HttpContext.Current.Request.MapPath("..\\WURFL_Data\\wurfl.xml");
                    Application["wurflFileProcessor"] = new wurflApi.deviceFileProcessor(s_path);
                }
                wurflApi.deviceFileProcessor o_deviceFileProcessor = (Application["wurflFileProcessor"] as wurflApi.deviceFileProcessor);
                // prepare capability getter
                wurflApi.capabilitiesGetter o_capabilityGetter = new wurflApi.capabilitiesGetter(ref o_deviceFileProcessor);
                o_capabilityGetter.prepareNavigatorModelCapabilities(Request);
                User_AgentInfo _info = new User_AgentInfo();
                _info.device_os         = o_capabilityGetter.getCapability("device_os");
                _info.mobile_browser    = o_capabilityGetter.getCapability("mobile_browser");
                _info.resolution_width  = o_capabilityGetter.getCapability("resolution_width");
                _info.resolution_height = o_capabilityGetter.getCapability("resolution_height");
                _info.model_name        = o_capabilityGetter.getCapability("model_name");
                _info.brand_name        = o_capabilityGetter.getCapability("brand_name");
                //BasePage.AddDevice(HttpContext.Current.Request.UserAgent, _info.model_name, _info.brand_name, _info.device_os, _info.mobile_browser, _info.resolution_width, _info.resolution_height);
                #endregion
                #region Redirect to VNM
                if (string.IsNullOrEmpty(transactionID))
                {
                    //int is3g = 0;
                    msisdn = MobileUtils.GetMSISDN(out is3g);
                    //msisdn = msisdn != "" ? msisdn : "841864950687";
                    string uniqueID = WapController.UnixTimeStampUTC().ToString();
                    #region Log nhận diện SDT

                    if (msisdn != "")
                    {
                        Telco  = "VNM";
                        IsWifi = 0;
                    }
                    //WapController.VmgAds94x_Log_Insert(HttpContext.Current.Request.UserAgent, _info.model_name, _info.brand_name, _info.device_os, _info.mobile_browser, _info.resolution_width, _info.resolution_height, Telco, IsWifi, 1, Request.Url.AbsoluteUri, id.ToString(), HttpContext.Current.Request.UserHostAddress, type.ToString(), "MSISDN", msisdn, "Request", 1, id);
                    //WapController.VmgAds94x_Log_Insert(HttpContext.Current.Request.UserAgent, uniqueID, _info.brand_name, _info.device_os, _info.mobile_browser, _info.resolution_width, _info.resolution_height, Telco, IsWifi, 1, "http://wap.vietnamobile.com.vn/wap/registerall.aspx?type=3&id=13", id.ToString(), "113.185.25.115", type.ToString(), "MSISDN", msisdn, "Request", 1, id);
                    #endregion

                    //dang ky 949
                    if (!string.IsNullOrEmpty(msisdn))
                    {
                        //string uniqueID = WapController.UnixTimeStampUTC().ToString();
                        if (type == 1)
                        {
                            //visport
                            WapController.WapRegisterConfirm_Insert(uniqueID, msisdn, 1, -1, "Dịch vụ Visport", "Dịch vụ Visport");
                            string url = RedirectToTelco(msisdn, "Dịch vụ Visport", "979", "5000", "Dịch vụ Visport", "01", "1", "http://visport.vn", uniqueID);
                            Response.Redirect(url);
                        }
                        else if (type == 2)
                        {
                            //game portal
                            WapController.WapRegisterConfirm_Insert(uniqueID, msisdn, 2, -2, "Dịch vụ Gameportal", "Dịch vụ Gameportal");
                            string url = RedirectToTelco(msisdn, "Dịch vụ Gameportal", "2288", "10000", "Dịch vụ Gameportal", "07", "1", "http://vmgame.vn/", uniqueID);
                            Response.Redirect(url);
                        }
                        else
                        {
                            if (id > 0)
                            {
                                DataTable tblServices = WapController.S2_94xGetServiceInfo(id);
                                if (tblServices == null || tblServices.Rows.Count < 1)
                                {
                                    return;
                                }
                                string ProductName    = tblServices.Rows[0]["Product_Name"].ToString();
                                string Price          = tblServices.Rows[0]["Charging_Price"].ToString();
                                int    PeriodLength   = ConvertUtility.ToInt32(tblServices.Rows[0]["PeriodLength"].ToString());
                                string NoChargeLength = tblServices.Rows[0]["NoChargeLength"].ToString();
                                WapController.WapRegisterConfirm_Insert(uniqueID, msisdn, 3, id, ProductName, ProductName);
                                string url = RedirectToTelco(msisdn, ProductName, "949", Price, ProductName, PeriodLength == 7 ? "07" : "01", NoChargeLength, "http://wap.vietnamobile.com.vn", uniqueID);

                                Response.Redirect(url);
                            }
                        }
                    }
                }
                else
                {
                    //Lấy thông tin khác hàng theo transactionID và đăng ký dịch vụ tương ứng
                    DataTable dt = WapController.WapRegisterConfirm_GetInfo(transactionID);
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        int Service_type = ConvertUtility.ToInt32(dt.Rows[0]["Type"].ToString());
                        if (Service_type == 1)
                        {
                            Response.Redirect("http://visport.vn/Wap/DangKy.aspx");
                        }
                        else if (Service_type == 2)
                        {
                            Response.Redirect("http://vmgame.vn/home/landing?pk=DK");
                        }
                        else
                        {
                            if (msisdn != "")
                            {
                                msisdn = "VNM";
                                IsWifi = 0;
                            }
                            //WapController.VmgAds94x_Log_Insert(HttpContext.Current.Request.UserAgent, transactionID.ToString(), _info.brand_name, _info.device_os, _info.mobile_browser, _info.resolution_width, _info.resolution_height, Telco, IsWifi, 1, Request.Url.AbsoluteUri, id.ToString(), HttpContext.Current.Request.UserHostAddress, type.ToString(), "REGISTER", msisdn, "Request", 1, id);
                            int Service_ID = ConvertUtility.ToInt32(dt.Rows[0]["Service_ID"].ToString());
                            Response.Redirect("http://wap.vietnamobile.com.vn/sub/DK.aspx?id=" + Service_ID);
                        }
                    }
                }
                #endregion
            }
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (AppEnv.GetSetting("TestFlag") == "1")
                {
                    Session["telco"]  = Constant.T_Vietnamobile;
                    Session["msisdn"] = "0987765522";
                }

                if (Session["msisdn"] == null)
                {
                    int    is3g   = 0;
                    string msisdn = MobileUtils.GetMSISDN(out is3g);
                    if (!string.IsNullOrEmpty(msisdn) && MobileUtils.CheckOperator(msisdn, "vietnammobile"))
                    {
                        Session["telco"]  = Constant.T_Vietnamobile;
                        Session["msisdn"] = msisdn;
                    }
                    else
                    {
                        Session["msisdn"] = null;
                        Session["telco"]  = Constant.T_Undefined;
                    }
                }

                pnlNoiDung.Visible = true;

                int id = ConvertUtility.ToInt32(Request.QueryString["id"]);
                if (id > 0)
                {
                    DataTable tblServices = WapController.S2_94xGetServiceInfo(id);
                    if (tblServices == null || tblServices.Rows.Count < 1)
                    {
                        return;
                    }
                    if (tblServices.Rows[0]["status"].ToString() != "3")
                    {
                        return;
                    }


                    string dangkyThanhCong = string.Empty;
                    string doubleDangKy    = string.Empty;
                    string tenDichVu       = string.Empty;

                    string regisSystax = tblServices.Rows[0]["Register_Syntax"].ToString().Split('|')[0];

                    if (Session["msisdn"] != null && Session["msisdn"].ToString() != "")
                    {
                        ltrTieuDe.Text  = "Đăng ký " + tblServices.Rows[0]["Product_Name"].ToString();
                        tenDichVu       = tblServices.Rows[0]["Product_Name"].ToString();
                        lblTen1.Text    = tenDichVu;
                        dangkyThanhCong = tblServices.Rows[0]["Right_Syntax_MT"].ToString();
                        doubleDangKy    = tblServices.Rows[0]["Double_Register_MT"].ToString();
                        if (WapController.IsRightServiceID(AppEnv.GetSetting("DK1chamVNMtest"), id.ToString()))
                        {
                            pnlConfirm.Visible = false;
                            string result = AppEnv.RegisterService(AppEnv.GetSetting("S2ShortCode"), "0", Session["msisdn"].ToString(), "DK", regisSystax);//Andy Service S2_94x

                            string[] arrResult = result.Split('|');

                            if (arrResult[0] == "1")//DK THANH CONG
                            {
                                ltrNoiDung.Text = dangkyThanhCong;
                            }
                            else if (arrResult[0] == "0")//DOUBE DK
                            {
                                ltrNoiDung.Text = doubleDangKy;
                            }
                            else if (arrResult[0] == "-1")//DK THAT BAI - SAI CU PHAP
                            {
                                ltrNoiDung.Text = "Đăng ký không thành công. Vui lòng thử lại <br /> Hoặc soạn tin <b> " + regisSystax + "</b> gửi <b>" + AppEnv.GetSetting("S2ShortCode") + "</b>";
                            }
                        }
                        else
                        {
                            pnlConfirm.Visible = true;
                        }
                    }
                    else
                    {
                        ltrNoiDung.Text = "Hệ thống không xác định được số điện thoại của bạn <br /> Vui lòng truy cập bằng 3G/GPRS <br /> Hoặc soạn tin <b> " + regisSystax + "</b> gửi <b>" + AppEnv.GetSetting("S2ShortCode") + "</b>";
                    }
                }
            }
        }