Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["LastPage"] = Request.RawUrl;
            lang = ConvertUtility.ToInt32(Request.QueryString["lang"]);
            if (!IsPostBack)
            {
                width = ConvertUtility.ToInt32(Request.QueryString["w"]);
                if (width == 0)
                {
                    width = (int)Constant.DefaultScreen.Standard;
                }
                ltrWidth.Text = "<meta content=\"width=" + width + "; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;\" name=\"viewport\" />";
            }
            if (string.IsNullOrEmpty(Request.QueryString["display"]))
            {
                display = "home";
            }
            else
            {
                display = Request.QueryString["display"];
            }
            switch (display)
            {
            case "home":
                plContent.Controls.Add(LoadControl("../Video/UserControlNew/Video4Bongda.ascx"));
                plContent.Controls.Add(LoadControl("UserControlNew/Gold.ascx"));
                break;

            case "newsdetail":
                plContent.Controls.Add(LoadControl("UserControlNew/BongDaTinTuc.ascx"));
                break;

            case "list":
                plContent.Controls.Add(LoadControl("UserControlNew/List.ascx"));
                break;

            case "cgd":
                plContent.Controls.Add(LoadControl("UserControlNew/Category.ascx"));
                break;

            case "bxh":
                plContent.Controls.Add(LoadControl("UserControlNew/BangXepHang.ascx"));
                break;

            case "ltd":
                plContent.Controls.Add(LoadControl("UserControlNew/LichThiDau.ascx"));
                break;

            case "ltdhn":
                plContent.Controls.Add(LoadControl("UserControlNew/LichThiDauHomNay.ascx"));
                break;

            case "kqtd":
                plContent.Controls.Add(LoadControl("UserControlNew/KetQuaThiDau.ascx"));
                break;

            case "kqtdhn":
                plContent.Controls.Add(LoadControl("UserControlNew/KetQuaThiDauHomNay.ascx"));
                break;

            case "tvdb":
                plContent.Controls.Add(LoadControl("UserControlNew/TuVanDacBiet.ascx"));
                break;
            }
        }
Ejemplo n.º 2
0
 protected void btnKhong_Click(object sender, EventArgs e)
 {
     Response.Redirect(ConvertUtility.ToString(Session["LastPage"]));
 }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lang  = Request.QueryString["lang"];
            width = ConvertUtility.ToInt32(Request.QueryString["w"]);
            id    = ConvertUtility.ToInt32(Request.QueryString["id"]);
            level = Request.QueryString["l"];
            if (level == "3")
            {
                price      = ConfigurationSettings.AppSettings.Get("hoangdaothangprice");
                ProductId  = "RELAXADVISESEX";
                ProductKey = "ADVISE_SEX";
            }
            else
            {
                price      = ConfigurationSettings.AppSettings.Get("hoangdaoprice");
                ProductId  = "RELAXADVISEBOOK";
                ProductKey = "ADVISE_BOOK";
            }

            telCo = AppEnv.CheckFreeContentTelco();

            linkStr    = "<a href=\"../" + UrlProcess.GetWallpaperHomeUrl(lang, width.ToString()).Replace("~/", "") + "\" >TỬ VI<a>";
            linkStr_KD = "<a href=\"../" + UrlProcess.GetWallpaperHomeUrl(lang, width.ToString()).Replace("~/", "") + "\" >TU VI<a>";
            //string chitietGiaodich = "Hoang dao: level:" + level + " -- id:" + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);

            if (!IsPostBack)
            {
                if (width == 0)
                {
                    width = (int)Constant.DefaultScreen.Standard;
                }
                ltrWidth.Text = "<meta content=\"width=" + width.ToString() + "; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;\" name=\"viewport\" />";

                #region Free Content

                if (AppEnv.GetSetting("FreeContent") == "1")
                {
                    HienThiNoiDung(true, false);
                    return;
                }

                #endregion

                #region OLD

                if (Session["transactionid_old"] != null)
                {// Nếu có transactionid_old >> thuê bao mobifone đã thực hiện thanh toán
                    messageReturn = ConvertUtility.ToString(Session["debit_status"]);
                    if (ConvertUtility.ToString(Session["debit_status"]) == "0")
                    {// Thanh toán thành công >> trả nội dung
                        HienThiNoiDung(true, true);
                    }
                    else
                    {// Thanh toán không thành công >> thông báo lỗi
                        HienThiNoiDung(false, true);
                    }
                    Session["transactionid_old"] = null;
                }
                else
                {
                    if (telCo == Constant.T_Mobifone)
                    {
                        string content = Session["cpid"].ToString() + "&" + Constant.hoangdao + level + id.ToString() + "&" + price + "&" + Session["transactionid"].ToString();
                        Response.Redirect(ConfigurationSettings.AppSettings.Get("vms3g") + "?link=" + Server.UrlEncode(EAS.EncryptData(content, ConfigurationSettings.AppSettings.Get("vmskey"))));
                    }
                    //
                    if (telCo == "Undefined")
                    {
                        pnlSMS.Visible = true;
                        if (lang == "1")
                        {
                            ltrHuongdan.Text = linkStr + " » " + Resources.Resource.wHuongDan;
                            switch (level)
                            {
                            case "1":
                                ltrSMS.Text = "Soạn tin <b>HRD &lt;dd*mm&gt;</b> gửi <b>8279</b> để xem hoàng đạo theo ngày. Ví dụ bạn sinh ngày 07 tháng 11, soạn: HRD 07*11 gửi 8279" + Resources.Resource.wChon3G;
                                break;

                            case "2":
                                ltrSMS.Text = "Soạn tin <b>HRW &lt;dd*mm&gt;</b> gửi <b>8279</b> để xem hoàng đạo theo tuần. Ví dụ bạn sinh ngày 07 tháng 11, soạn HRW 07*11 gửi 8279" + Resources.Resource.wChon3G;
                                break;

                            case "3":
                                ltrSMS.Text = "Soạn tin <b>HRM &lt;dd*mm&gt;</b> gửi <b>8579</b> để xem hoàng đạo theo tháng. Ví dụ bạn sinh ngày 07 tháng 11, soạn: HRM 07*11 gửi 8579" + Resources.Resource.wChon3G;
                                break;
                            }
                        }
                        else
                        {
                            ltrHuongdan.Text = linkStr_KD + " » " + Resources.Resource.wHuongDan_KD;
                            switch (level)
                            {
                            case "1":
                                ltrSMS.Text = "Soan tin <b>HRD &lt;dd*mm&gt;</b> gui <b>8279</b> de xem hoang dao theo ngay. Vi du ban sinh ngay 07 thang 11, soan: HRD 07*11 gui 8279" + Resources.Resource.wChon3G_KD;
                                break;

                            case "2":
                                ltrSMS.Text = "Soan tin <b>HRW &lt;dd*mm&gt;</b> gui <b>8279</b> de xem hoang dao theo tuan. Vi du ban sinh ngay 07 thang 11, soan: HRW 07*11 gui 8279" + Resources.Resource.wChon3G_KD;
                                break;

                            case "3":
                                ltrSMS.Text = "Soan tin <b>HRM &lt;dd*mm&gt;</b> gui <b>8579</b> de xem hoang dao theo thang. Vi du ban sinh ngay 07 thang 11, soan: HRM 07*11 gui 8579" + Resources.Resource.wChon3G_KD;
                                break;
                            }
                        }
                    }
                    else
                    {
                        //pnlThongBao.Visible = true;
                        //if (lang == "1")
                        //{
                        //    ltrTitle.Text = linkStr + " » " + Resources.Resource.wThongBao;
                        //    //ltrThongBao.Text = Resources.Resource.wXacNhanDichVu.Replace("xxx", price);
                        //    ltrThongBao.Text = Resources.Resource.wXacNhanDichVu + "tử vi hoàng đạo";
                        //    btnCo.Text = Resources.Resource.btnCo;
                        //    btnKhong.Text = Resources.Resource.btnKhong;
                        //}
                        //else
                        //{
                        //    ltrTitle.Text = linkStr_KD + " » " + Resources.Resource.wThongBao_KD;
                        //    //ltrThongBao.Text = Resources.Resource.wXacNhanDichVu_KD.Replace("xxx", price);
                        //    ltrThongBao.Text = Resources.Resource.wXacNhanDichVu_KD + "tu vi hoang dao";
                        //    btnCo.Text = Resources.Resource.btnCo_KD;
                        //    btnKhong.Text = Resources.Resource.btnKhong_KD;
                        //}

                        pnlThongBao.Visible = false;
                        switch (Session["telco"].ToString())
                        {
                        case "Vietnamobile":
                            var charging = new Library.VNMCharging.VNMChargingGW();

                            messageReturn = charging.NavigatePaymentVnm(Session["msisdn"].ToString(), ProductId, ProductKey, price, "D", "Tu vi", Request.QueryString["id"]);

                            if (messageReturn == AppEnv.GetSetting("NotEnoughMoney"))    //Not Enough Money
                            {
                                messageReturn = AppEnv.VnmChargingOptimizeNotEnoughMoney(Session["msisdn"].ToString(), ProductId, ProductKey, price, "D", "Tu vi", Request.QueryString["id"], out logPrice);
                                price         = logPrice;
                            }

                            if (messageReturn == AppEnv.GetSetting("SystemOverload"))     //System Over Load
                            {
                                messageReturn = AppEnv.VnmChargingSystemOverload(Session["msisdn"].ToString(), ProductId, ProductKey, price, "D", "Tu vi", Request.QueryString["id"]);
                            }

                            if (!string.IsNullOrEmpty(messageReturn) && messageReturn == "1")
                            {    // Thanh toán thành công >> trả nội dung
                                HienThiNoiDung(true, true);
                            }
                            else
                            {    // Thanh toán không thành công >> thông báo lỗi
                                HienThiNoiDung(false, true);
                            }
                            break;
                        }
                    }
                }

                #endregion
            }
        }
Ejemplo n.º 4
0
        protected void HienThiNoiDung(Boolean thuchien, Boolean isLog)
        {
            pnlNoiDung.Visible = true;

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

            //chitietGiaodich = "Video view: " + dtDetail.Rows[0]["VTitle_Unicode"].ToString() + " -- id:" + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
            chitietGiaodich = "Video view: " + dtDetail.Rows[0]["VTitle_Unicode"] + " -- id:" + id.ToString();

            if (thuchien)
            {
                //if (lang == "1")
                //{
                ltrTieuDe.Text   = linkStr;
                lblTen.Text      = dtDetail.Rows[0]["VTitle_Unicode"].ToString();
                lnkDownload.Text = Resources.Resource.wBamDeXem + "video";
                ltrNoiDung.Text  = Resources.Resource.wMuaThanhCong + " video " + dtDetail.Rows[0]["VTitle_Unicode"].ToString();
                //}
                //else
                //{
                //    ltrTieuDe.Text = linkStr;
                //    lblTen.Text = dtDetail.Rows[0]["VTitle"].ToString();
                //    lnkDownload.Text = Resources.Resource.wBamDeXem_KD + "video";
                //    ltrNoiDung.Text = Resources.Resource.wMuaThanhCong_KD + " video " + dtDetail.Rows[0]["VTitle"].ToString();
                //};
                if (HttpContext.Current.Request.UserAgent != null)
                {
                    if (HttpContext.Current.Request.UserAgent.ToLower().Contains("safari"))
                    {
                        lnkDownload.NavigateUrl = ConfigurationSettings.AppSettings.Get("vnmviewIphone") + dtDetail.Rows[0]["SmartPhonePath"].ToString().Replace("~/", "/");
                    }
                    else
                    {
                        lnkDownload.NavigateUrl = ConfigurationSettings.AppSettings.Get("vnmview") + dtDetail.Rows[0]["SmartPhonePath"].ToString().Replace("~/Upload/Video", "");
                    }
                }
                else
                {
                    lnkDownload.NavigateUrl = ConfigurationSettings.AppSettings.Get("vnmview") + dtDetail.Rows[0]["VMobilePath"].ToString().Replace("~/Upload/Video", "");
                }
                // Response.Write(lnkDownload.NavigateUrl);
                //lnkDownload.NavigateUrl = ConfigurationSettings.AppSettings.Get("vnmview") + dtDetail.Rows[0]["VMobilePath"].ToString().Replace("~/Upload/Video", "");

                if (isLog)
                {
                    Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, lnkDownload.NavigateUrl, id.ToString(), chitietGiaodich, 5);
                }

                VideoController.SetDownloadCounter(AppEnv.CheckFreeContentTelco(), 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 + " » " + Resources.Resource.wThongBao_KD;
                //    ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan_KD;
                //}

                if (isLog)
                {
                    Transaction.Failure(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 5, messageReturn);
                }


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

            if (isLog)
            {
                //log charging
                ILog logger = LogManager.GetLogger(Session["telco"].ToString());
                logger.Debug("--------------------------------------------------");
                logger.Debug("MSISDN:" + Session["msisdn"]);
                logger.Debug("Dich vu: Video - parameter: " + price + " - Ten: " + dtDetail.Rows[0]["VTitle"].ToString() + " - id: " + id);
                logger.Debug("Video Url:" + lnkDownload.NavigateUrl);
                logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress);
                logger.Debug("Error:" + messageReturn);
                logger.Debug("Current Url:" + Request.RawUrl);
                //end log
            }
        }
        protected void rptCategory_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemIndex < 0)
            {
                return;
            }
            DataRowView curData       = (DataRowView)e.Item.DataItem;
            Literal     ltrGiaiDau    = (Literal)e.Item.FindControl("ltrGiaiDau");
            Repeater    rptLichThiDau = (Repeater)e.Item.FindControl("rptLichThiDau");
            int         totalrecord;
            DataTable   dtItem = ThethaoController.GetAllGameToDayByCompetitionID_LTD_Live(ConvertUtility.ToInt32(curData["W_CompetitionID"]), 20, 1, out totalrecord);

            if (lang == 1)
            {
                ltrGiaiDau.Text = curData["NameUnicode"].ToString();
            }
            else
            {
                ltrGiaiDau.Text = curData["Name"].ToString();
            }
            if (dtItem.Rows.Count > 0)
            {
                rptLichThiDau.DataSource     = dtItem;
                rptLichThiDau.ItemDataBound += new RepeaterItemEventHandler(rptlist_ItemDataBound);
                rptLichThiDau.DataBind();
            }
        }
Ejemplo n.º 6
0
        protected void btnUpdateAll_Click(object sender, EventArgs e)
        {
            try
            {
                foreach (DataGridItem item in dgrUserRole.Items)
                {
                    int      user_id    = ConvertUtility.ToInt32(item.Cells[0].Text);
                    int      command_id = ConvertUtility.ToInt32(item.Cells[1].Text);
                    int      portal_id  = ConvertUtility.ToInt32(item.Cells[2].Text);
                    CheckBox chkView    = (CheckBox)item.FindControl("chkView");
                    CheckBox chkAdd     = (CheckBox)item.FindControl("chkAdd");
                    CheckBox chkUpdate  = (CheckBox)item.FindControl("chkEdit");
                    CheckBox chkDelete  = (CheckBox)item.FindControl("chkDelete");
                    CheckBox chkWeb     = (CheckBox)item.FindControl("chkWeb");
                    CheckBox chkWap     = (CheckBox)item.FindControl("chkWap");
                    CheckBox chkSMS     = (CheckBox)item.FindControl("chkSMS");
                    CheckBox chkXzone   = (CheckBox)item.FindControl("chkXzone");
                    try
                    {
                        DataTable dtUserCommands = CommandController.GetCommandsForUserNotGroup(user_id, ConvertUtility.ToInt32(dropPortal.SelectedValue));
                        DataRow[] rowItems       = dtUserCommands.Select("CommandParentID = " + command_id);

                        foreach (DataRow row in rowItems)
                        {
                            UserController.UpdateUserPermissionByPortalID(ConvertUtility.ToInt32(row["UserID"]), ConvertUtility.ToInt32(row["CommandID"]), portal_id, chkWeb.Checked, chkWap.Checked, chkSMS.Checked, chkXzone.Checked, chkView.Checked, true, true, true);
                        }
                        try
                        {
                            UserController.UpdateUserPermissionByPortalID(user_id, command_id, portal_id, chkWeb.Checked, chkWap.Checked, chkSMS.Checked, chkXzone.Checked, chkView.Checked, chkAdd.Checked, chkUpdate.Checked, chkDelete.Checked);
                        }
                        catch (Exception ex)
                        {
                            throw ex;
                        }
                    }
                    catch
                    {
                        lblUpdateStatus1.Text = MiscUtility.MSG_UPDATE_ERROR;
                    }
                }
                lblUpdateStatus1.Text = MiscUtility.MSG_UPDATE_SUCCESS;
                new DataCaching().RemoveAll();
            }
            catch
            {
                lblUpdateStatus1.Text = MiscUtility.MSG_UPDATE_ERROR;
            }
            lblUpdateStatus.Text = "";
        }
Ejemplo n.º 7
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            DataTable dtUsers = UserController.GetKetQuaDanhGia(ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue));

            DataTable dtUsersTemp = dtUsers.Clone();

            dtUsersTemp.Columns.Add("MucDoHoanThanh", typeof(double));
            dtUsersTemp.Columns.Add("XepLoai", typeof(string));
            dtUsersTemp.Columns.Add("Rank", typeof(string));

            double tbKetquaHTKHHD       = 0;
            double tbDiemPhoiHop        = 0;
            double tbDiemSangTao        = 0;
            double tbDiemKyLuat         = 0;
            double tbDiemMucDoHoanThanh = 0;

            foreach (DataRow item in dtUsers.Rows)
            {
                double KetquaHTKHHD = ConvertUtility.ToDouble(item["KetquaHTKHHD"]);
                double DiemPhoiHop  = ConvertUtility.ToDouble(item["DiemPhoiHop"]);
                double DiemSangTao  = ConvertUtility.ToDouble(item["DiemSangTao"]);
                double DiemKyLuat   = ConvertUtility.ToDouble(item["DiemKyLuat"]);

                if (DiemSangTao == 0)
                {
                    DiemSangTao = 100;
                }
                if (DiemPhoiHop == 0)
                {
                    DiemPhoiHop = 100;
                }

                tbKetquaHTKHHD += KetquaHTKHHD;
                tbDiemPhoiHop  += DiemPhoiHop;
                tbDiemSangTao  += DiemSangTao;
                tbDiemKyLuat   += DiemKyLuat;

                double tong = KetquaHTKHHD * 75 / 100;
                tong += DiemPhoiHop * 10 / 100;
                tong += DiemSangTao * 5 / 100;
                tong += DiemKyLuat * 10 / 100;
                tong  = Math.Round(tong, 1);

                tbDiemMucDoHoanThanh += tong;

                DataRow row = dtUsersTemp.NewRow();
                row["ID"]             = item["ID"];
                row["Ten"]            = item["Ten"];
                row["KetquaHTKHHD"]   = item["KetquaHTKHHD"];
                row["DiemPhoiHop"]    = DiemPhoiHop;
                row["DiemSangTao"]    = DiemSangTao;
                row["DiemKyLuat"]     = item["DiemKyLuat"];
                row["MucDoHoanThanh"] = tong;//.ToString().Substring(0, tong.ToString().IndexOf(',')) + "," + tong.ToString().Substring(tong.ToString().IndexOf(',') + 1,1);
                row["XepLoai"]        = GetXepLoai(tong);

                dtUsersTemp.Rows.Add(row);
            }

            DataTable dtBoPhan = RankDt(dtUsersTemp, "MucDoHoanThanh");

            foreach (DataRow item in dtUsersTemp.Rows)
            {
                item["Rank"]        = dtBoPhan.Select(" ID='" + item["ID"] + "'")[0]["RankTemp"];
                item["DiemSangTao"] = dtBoPhan.Select(" ID='" + item["ID"] + "'")[0]["DiemSangTao"];
                item["DiemPhoiHop"] = dtBoPhan.Select(" ID='" + item["ID"] + "'")[0]["DiemPhoiHop"];
            }

            dgrBoPhan.DataSource    = dtUsersTemp;
            dgrBoPhan.RowDataBound += new GridViewRowEventHandler(dgrBoPhan_RowDataBound);
            dgrBoPhan.DataBind();

            lblTotalTop.Text = lblTotalBottom.Text = dtUsers.Rows.Count.ToString();
            int i = dtUsers.Rows.Count;

            lblTBKetQuaKHHD.Text     = Math.Round(tbKetquaHTKHHD / i, 1).ToString() + "%";
            tblTBDiemPhoiHop.Text    = Math.Round(tbDiemPhoiHop / i, 1).ToString() + "%";
            lblTBDiemSangTao.Text    = Math.Round(tbDiemSangTao / i, 1).ToString() + "%";
            lblTBKyLuat.Text         = Math.Round(tbDiemKyLuat / i, 1).ToString() + "%";
            lblTBMucDoHoanThanh.Text = Math.Round(tbDiemMucDoHoanThanh / i, 1).ToString() + "%";
        }
Ejemplo n.º 8
0
        protected void HienThiNoiDung(Boolean thuchien)
        {
            pnlNoiDung.Visible = true;

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

            chitietGiaodich = "Phần mềm: " + dtDetail.Rows[0]["AppNameUnicode"].ToString() + " -- id:" + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
            if (thuchien)
            {
                if (lang == "1")
                {
                    ltrTieuDe.Text   = linkStr;
                    lblTen.Text      = dtDetail.Rows[0]["AppNameUnicode"].ToString();
                    lnkDownload.Text = Resources.Resource.wBamDeTai;
                    ltrNoiDung.Text  = Resources.Resource.wMuaThanhCong + " phần mềm " + dtDetail.Rows[0]["AppNameUnicode"].ToString();
                }
                else
                {
                    ltrTieuDe.Text   = linkStr_KD;
                    lblTen.Text      = dtDetail.Rows[0]["AppName"].ToString();
                    lnkDownload.Text = Resources.Resource.wBamDeTai_KD;
                    ltrNoiDung.Text  = Resources.Resource.wMuaThanhCong_KD + " phan mem " + dtDetail.Rows[0]["AppName"].ToString();
                };
                string url;
                try
                {
                    VMGGame.MOReceiver urlservice = new VMGGame.MOReceiver();
                    url = urlservice.VMG_ReturnUrlForApplication(ConvertUtility.ToString(dtDetail.Rows[0]["AppID"]), 0, Session["msisdn"].ToString(), 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);
                    }
                }
                catch { url = ""; }
                lnkDownload.NavigateUrl = url;
                //lnkDownload.NavigateUrl = UrlProcess.GetGameDownloadItem(Session["telco"].ToString(), "4", id.ToString(), SecurityMethod.MD5Encrypt(id.ToString()));
                Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, lnkDownload.NavigateUrl, id.ToString(), chitietGiaodich, 4);
                PhanmemController.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, 4, 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: Phan mem - parameter: " + price + " - Ten: " + dtDetail.Rows[0]["AppName"].ToString() + " - id: " + id);
            logger.Debug("Phan mem Url:" + lnkDownload.NavigateUrl);
            logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress);
            logger.Debug("Error:" + messageReturn);
            logger.Debug("Current Url:" + Request.RawUrl);
            //end log
        }
Ejemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            price      = ConfigurationSettings.AppSettings.Get("appprice");
            lang       = Request.QueryString["lang"];
            hotro      = Request.QueryString["hotro"];
            width      = ConvertUtility.ToInt32(Request.QueryString["w"]);
            id         = ConvertUtility.ToInt32(Request.QueryString["id"]);
            telCo      = Session["telco"].ToString();
            linkStr    = "<a href=\"../" + UrlProcess.GetAppHomeUrlNew(lang, width.ToString(), hotro).Replace("~/", "") + "\" >PHẦN MỀM<a>";
            linkStr_KD = "<a href=\"../" + UrlProcess.GetAppHomeUrlNew(lang, width.ToString(), hotro).Replace("~/", "") + "\" >PHAN MEM<a>";

            if (!IsPostBack)
            {
                if (width == 0)
                {
                    width = (int)Constant.DefaultScreen.Standard;
                }
                ltrWidth.Text = "<meta content=\"width=" + width.ToString() + "; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;\" name=\"viewport\" />";

                DataTable dtDetail = PhanmemController.GetAPPDetailByID(Session["telco"].ToString(), id);
                if (dtDetail.Rows[0]["Web_Name"].ToString() == "Vmg_zone")
                {
                    price = "15000";
                }
                if (telCo == Constant.T_Mobifone)
                {
                    string content = Session["cpid"].ToString() + "&" + Constant.ungdungchung + id.ToString() + "&" + price + "&" + Session["transactionid"].ToString();
                    Response.Redirect(ConfigurationSettings.AppSettings.Get("vms3g") + "?link=" + Server.UrlEncode(EAS.EncryptData(content, ConfigurationSettings.AppSettings.Get("vmskey"))));
                }
                //
                if (telCo == "Undefined")
                {
                    pnlSMS.Visible = true;
                    if (lang == "1")
                    {
                        ltrHuongdan.Text = linkStr + " » " + Resources.Resource.wHuongDan;
                        ltrSMS.Text      = "Soạn tin <b>" + ConfigurationSettings.AppSettings.Get("appcode") + " " + dtDetail.Rows[0]["AppID"].ToString() + "</b> gửi <b>" + ConfigurationSettings.AppSettings.Get("appcommandcode") + "</b> để tải phần mềm <b>" + dtDetail.Rows[0]["AppNameUnicode"].ToString() + "</b> về máy" + Resources.Resource.wChon3G;
                    }
                    else
                    {
                        ltrHuongdan.Text = linkStr_KD + " » " + Resources.Resource.wHuongDan_KD;
                        ltrSMS.Text      = "Soan tin <b>" + ConfigurationSettings.AppSettings.Get("appcode") + " " + dtDetail.Rows[0]["AppID"].ToString() + "</b> gui <b>" + ConfigurationSettings.AppSettings.Get("appcommandcode") + "</b> de tai phan mem <b>" + dtDetail.Rows[0]["AppName"].ToString() + "</b> ve may" + Resources.Resource.wChon3G_KD;
                    }
                }
                else
                {
                    //pnlThongBao.Visible = true;
                    //if (lang == "1")
                    //{
                    //    ltrTitle.Text = linkStr + " » " + Resources.Resource.wThongBao;
                    //    //ltrThongBao.Text = Resources.Resource.wXacNhanDichVu.Replace("xxx", price);
                    //    ltrThongBao.Text = Resources.Resource.wXacNhanDichVu + "phần mềm " + dtDetail.Rows[0]["AppNameUnicode"].ToString();
                    //    btnCo.Text = Resources.Resource.btnCo;
                    //    btnKhong.Text = Resources.Resource.btnKhong;
                    //}
                    //else
                    //{
                    //    ltrTitle.Text = linkStr_KD + " » " + Resources.Resource.wThongBao_KD;
                    //    //ltrThongBao.Text = Resources.Resource.wXacNhanDichVu_KD.Replace("xxx", price);
                    //    ltrThongBao.Text = Resources.Resource.wXacNhanDichVu_KD + "phan mem " + dtDetail.Rows[0]["AppName"].ToString();
                    //    btnCo.Text = Resources.Resource.btnCo_KD;
                    //    btnKhong.Text = Resources.Resource.btnKhong_KD;
                    //}
                    pnlThongBao.Visible = false;
                    switch (Session["telco"].ToString())
                    {
                    case "Vietnamobile":
                        WapXzone_VNM.Library.VNMCharging.VNMChargingGW charging = new WapXzone_VNM.Library.VNMCharging.VNMChargingGW();

                        //messageReturn = charging.PaymentVNM(Session["msisdn"].ToString(), price, "D", "APP", Request.QueryString["id"].ToString());
                        //messageReturn = charging.PaymentVNM(Session["msisdn"].ToString(), "APPDOWN", "APP_DOWN");

                        messageReturn = charging.NavigatePaymentVnm(Session["msisdn"].ToString(), "APPDOWN", "APP_DOWN", price, "D", "APP", Request.QueryString["id"]);

                        if (messageReturn == "1")
                        {    // Thanh toán thành công >> trả nội dung
                            HienThiNoiDung(true);
                        }
                        else
                        {    // Thanh toán không thành công >> thông báo lỗi
                            HienThiNoiDung(false);
                        }
                        break;
                    }
                }
            }
        }
Ejemplo n.º 10
0
        public void rptPage_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            int curdata = ConvertUtility.ToInt32(e.Item.DataItem);

            if (curdata == pagesize || curdata == totalpage)
            {
                Literal ltrGach = (Literal)e.Item.FindControl("ltrGach");
                ltrGach.Visible = false;
            }
            Label  ltrPage = (Label)e.Item.FindControl("ltrPage");
            string url     = Request.AppRelativeCurrentExecutionFilePath.Replace("~/Hinhnen/", "") + queryparam + e.Item.DataItem;


            if ((e.Item.ItemIndex + 1) == curpage)
            {
                ltrPage.Text = "<span class=\"link-non-orange\">" + ConvertUtility.ToString(e.Item.DataItem) + "</span>";
            }
            else
            {
                if (curpage > numberpage)
                {
                    if (ConvertUtility.ToInt32(e.Item.DataItem) == curpage)
                    {
                        ltrPage.Text = "<span class=\"link-non-orange\">" + ConvertUtility.ToString(e.Item.DataItem) + "</span>";
                    }
                    else
                    {
                        ltrPage.Text = "<a class=\"link-non-black\" href=\"" + url + "\" >" + ConvertUtility.ToString(e.Item.DataItem) + " </a>";
                    }
                }
                else
                {
                    ltrPage.Text = "<a class=\"link-non-black\" href=\"" + url + "\" >" + ConvertUtility.ToString(e.Item.DataItem) + " </a>";
                }
            }
        }
Ejemplo n.º 11
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            #region Check authenticate

            UserInfo userInfo = UserController.GetUser(idNhanVien);
            if (userInfo == null)
            {
                Response.Redirect(AppEnv.AdminUrlParams("accessdeny"));
            }

            if (!CurrentUser.IsAdmin && !CurrentUser.IsSuperAdmin)
            {
                if (CurrentUser.UserID != 8)
                {
                    if (CurrentUser.RoleID == (int)Constants.Role.NhanVien || CurrentUser.RoleID == (int)Constants.Role.NhanVienKD)
                    {
                        if (CurrentUser.UserID != idNhanVien)
                        {
                            Response.Redirect(AppEnv.AdminUrlParams("accessdeny"));
                        }
                    }
                }
            }

            #endregion

            DataTable dt = DotDanhGiaController.checkDanhGiaThang(idDotDanhGia, idNhanVien);

            if (dt != null && dt.Rows.Count > 0)
            {
                #region kiem tra trang thai cua Ban danh gia

                if (idNhanVien == CurrentUser.UserID)
                {
                    if (ConvertUtility.ToInt32(dt.Rows[0]["TrangThai"]) == (int)Constants.TrangThaiDanhGiaNhanVien.ThongNhat)
                    {
                        btnSumit.Enabled = false;
                        btnSumit.Text    = "Thống nhất";
                    }
                    else
                    {
                        btnSumit.Enabled = false;
                        btnSumit.Text    = "Chờ CEO đánh giá";
                    }
                }
                else
                {
                    btnSumit.Enabled = true;
                    btnSumit.Text    = "Đánh giá và gửi lại kết quả cho TBP";
                }

                #endregion

                tableContent.Visible = true;
                tableAlert.Visible   = false;

                #region Tong diem cua ban danh gia

                DataSet ds = DotDanhGiaController.DanhGiaThang_DGCBCNVDanhGia_TongDiemCongThucMoi(idDotDanhGia, idNhanVien);

                if (ds != null)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        lblDiemDanhGiaDonVi.Text = Math.Round(ConvertUtility.ToDouble(ds.Tables[0].Rows[0]["TotalDiemDanhGiaDonVi"].ToString()), 2).ToString() + "%";
                    }

                    if (ds.Tables[1].Rows.Count > 0)
                    {
                        lblDiemHoanThanhLoiNhuanCongTy.Text = Math.Round(ConvertUtility.ToDouble(ds.Tables[1].Rows[0]["TotalDiemLNCgTy"]), 2).ToString() + "%";
                    }
                    if (ds.Tables[2].Rows.Count > 0)
                    {
                        lblDiemPhoiHop.Text = Math.Round(ConvertUtility.ToDouble(ds.Tables[2].Rows[0]["TotalDiemPhoiHop"]), 2).ToString() + "%";
                    }
                    if (ds.Tables[3].Rows.Count > 0)
                    {
                        lblDiemKyLuat.Text = Math.Round(ConvertUtility.ToDouble(ds.Tables[3].Rows[0]["TotalDiemKyLuat"]), 2).ToString() + "%";
                    }

                    if (ds.Tables[4].Rows.Count > 0)
                    {
                        lblLNBoPhan.Text = Math.Round(ConvertUtility.ToDouble(ds.Tables[4].Rows[0]["TotalDiemLNBoPhan"]), 2).ToString() + "%";
                    }

                    if (ds.Tables[5].Rows.Count > 0)
                    {
                        lblMucDoHoanThanh.Text = Math.Round(ConvertUtility.ToDouble(ds.Tables[5].Rows[0]["TongDiem"]), 1, MidpointRounding.AwayFromZero).ToString() + "%";
                    }

                    if (ds.Tables[6].Rows.Count > 0)
                    {
                        lblXepLoai.Text = ds.Tables[6].Rows[0]["XepLoai"].ToString();
                    }

                    if (ds.Tables[7].Rows.Count > 0)
                    {
                        lblName.Text = ds.Tables[7].Rows[0]["HoTen"].ToString();
                    }

                    if (ds.Tables[8].Rows.Count > 0)
                    {
                        lblDiemThuong.Text = Math.Round(ConvertUtility.ToDouble(ds.Tables[8].Rows[0]["DiemThuong"]), 2).ToString() + "%";
                    }

                    lblHeSoLuongMem.Text = GetLuongMem(lblXepLoai.Text);


                    #region Ty Trong Cong Viec

                    double totalCVTX  = 0;
                    double totalCVKTX = 0;
                    double totalCVPS  = 0;
                    double total      = 0;

                    DataTable dtCongViecThuongXuyen = DanhGiaThang_DGCBCNVDanhGiaTTCVController.GetAll(1, idDotDanhGia, idNhanVien);

                    foreach (DataRow item in dtCongViecThuongXuyen.Rows)
                    {
                        totalCVTX += ConvertUtility.ToDouble(item["TyTrongCV"]);
                    }

                    DataTable dtCongViecKhongThuonguyen = DanhGiaThang_DGCBCNVDanhGiaTTCVController.GetAll(2, idDotDanhGia, idNhanVien);
                    foreach (DataRow item in dtCongViecKhongThuonguyen.Rows)
                    {
                        totalCVKTX += ConvertUtility.ToDouble(item["TyTrongCV"]);
                    }

                    DataTable dtCongViecPhatSinh = DanhGiaThang_DGCBCNVDanhGiaTTCVController.GetAll(3, idDotDanhGia, idNhanVien);
                    foreach (DataRow item in dtCongViecPhatSinh.Rows)
                    {
                        totalCVPS += ConvertUtility.ToDouble(item["TyTrongCV"]);
                    }

                    lblCVTX.Text       = Math.Round(totalCVTX, 2) + "%";
                    lblCVKTX.Text      = Math.Round(totalCVKTX, 2) + "%";
                    lblCVPhatSinh.Text = Math.Round(totalCVPS, 2) + "%";

                    total = totalCVTX + totalCVKTX + totalCVPS;

                    lblTotal.Text = Math.Round(total, 2).ToString() + "%";

                    lblTotal.Text = Math.Round(total, 2).ToString() + "%";
                    if (total > 100)
                    {
                        lblTotal.ForeColor = Color.Red;
                    }
                    double totalCVPhatSinh = Math.Round((100 - total), 2);

                    if (totalCVPhatSinh > 0)
                    {
                        lblCVPhatSinh.Text = Math.Round(totalCVPS, 2) + "%" + " còn lại " + Math.Round((100 - total), 2) + "%";
                    }
                    else
                    {
                        lblCVPhatSinh.Text = Math.Round(totalCVPS, 2) + "%";
                    }

                    #endregion
                }

                #endregion
            }
            else
            {
                tableContent.Visible = false;
                tableAlert.Visible   = true;
            }
        }
Ejemplo n.º 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                string httpMethod = Request.HttpMethod;
                string buildId    = ConvertUtility.Trim(Request.QueryString["id"]);

                if (httpMethod.Equals("get", StringComparison.OrdinalIgnoreCase))
                {
                    BuildFwService buildService = new BuildFwService();
                    this.Build = buildService.GetBuild(buildId);
                }
                else
                {
                    int    x_axis_c      = ConvertUtility.ToInt(Request.Form["x_axis"]);
                    string x_axis_t      = ConvertUtility.Trim(Request.Form["x_axis_t"]);
                    bool   x_axis_except = ConvertUtility.ToBoolean(Request.Form["x_axis_except"]);

                    int  y_axis_b      = ConvertUtility.ToInt(Request.Form["y_axis_b"]);
                    int  y_axis_e      = ConvertUtility.ToInt(Request.Form["y_axis_e"]);
                    bool y_axis_except = ConvertUtility.ToBoolean(Request.Form["y_axis_except"]);

                    int    countf      = ConvertUtility.ToInt(Request.Form["countf"]);
                    int    countt      = ConvertUtility.ToInt(Request.Form["countt"]);
                    int    countw      = ConvertUtility.ToInt(Request.Form["countw"]);
                    int    county      = ConvertUtility.ToInt(Request.Form["county"]);
                    float  area        = ConvertUtility.ToFloat(Request.Form["area"]);
                    string directionTo = ConvertUtility.Trim(Request.Form["directionTo"]);

                    if (y_axis_b <= y_axis_e)
                    {
                        UnitFwService unitService = new UnitFwService();
                        string        x_axis      = string.Empty;
                        string        y_axis      = string.Empty;
                        for (int y = y_axis_b; y <= y_axis_e; y++)
                        {
                            if (y_axis_except && y.ToString().IndexOf("4") >= 0)
                            {
                                continue;
                            }
                            for (int x = 1; x <= x_axis_c; x++)
                            {
                                y_axis = y.ToString();
                                x_axis = x.ToString();
                                if (x_axis_t.Equals("a"))
                                {
                                    int ascii = x + 64;
                                    if (x > 90)
                                    {
                                        continue;
                                    }
                                    else
                                    {
                                        System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
                                        char[] chars = encoding.GetChars(new byte[] { (byte)ascii });
                                        x_axis = chars[0].ToString();
                                    }
                                }
                                else
                                {
                                    if (x_axis_except && x.ToString().IndexOf("4") >= 0)
                                    {
                                        continue;
                                    }
                                }
                                unitService.AddUnit(buildId, x_axis, y_axis, countf, countt, countw, county, area, directionTo);
                            }
                        }

                        Response.Write("true");
                    }
                    else
                    {
                        Response.Write("false");
                    }
                    Response.End();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 13
0
    public int Execute(int jobId)
    {
        WebServiceCharging3g webServiceCharging3G = new WebServiceCharging3g();
        string userName = "******";
        string userPass = "******";
        string cpId     = "1930";
        string price    = "4000";

        try
        {
            DataTable dtUsers = ViSport_S2_Registered_UsersController.GetSportGameUserByType(false);
            if (dtUsers != null && dtUsers.Rows.Count > 0)
            {
                string message        = string.Empty;
                string returnValue    = string.Empty;
                string notEnoughMoney = AppEnv.GetSetting("NotEnoughMoney");

                string serviceType = "Charge Hero";
                string serviceName = "ViSport_Hero";
                string reasonLog   = string.Empty;

                for (int i = 0; i < dtUsers.Rows.Count; i++)
                {
                    try
                    {
                        #region TIEN HANH CHARGED

                        price       = "5000";
                        returnValue = webServiceCharging3G.PaymentVnmWithAccount(dtUsers.Rows[i]["User_ID"].ToString(), price, "Charged Sub Anh Tai", "Anh_Tai_Sub", userName, userPass, cpId);
                        if (returnValue.Trim() == notEnoughMoney)
                        {
                            price       = "3000";
                            returnValue = webServiceCharging3G.PaymentVnmWithAccount(dtUsers.Rows[i]["User_ID"].ToString(), price, "Charged Sub Anh Tai", "Anh_Tai_Sub", userName, userPass, cpId);
                            if (returnValue.Trim() == notEnoughMoney)
                            {
                                price       = "2000";
                                returnValue = webServiceCharging3G.PaymentVnmWithAccount(dtUsers.Rows[i]["User_ID"].ToString(), price, "Charged Sub Anh Tai", "Anh_Tai_Sub", userName, userPass, cpId);
                                if (returnValue.Trim() == notEnoughMoney)
                                {
                                    price       = "1000";
                                    returnValue = webServiceCharging3G.PaymentVnmWithAccount(dtUsers.Rows[i]["User_ID"].ToString(), price, "Charged Sub Anh Tai", "Anh_Tai_Sub", userName, userPass, cpId);
                                }
                            }
                        }

                        if (returnValue == "1")
                        {
                            #region LOG DOANH THU

                            var logInfo = new SportGameHeroChargedUserLogInfo();

                            logInfo.ID           = ConvertUtility.ToInt32(dtUsers.Rows[i]["ID"].ToString());
                            logInfo.User_ID      = dtUsers.Rows[i]["User_ID"].ToString();
                            logInfo.Request_ID   = dtUsers.Rows[i]["Request_ID"].ToString();
                            logInfo.Service_ID   = dtUsers.Rows[i]["Service_ID"].ToString();
                            logInfo.Command_Code = dtUsers.Rows[i]["Command_Code"].ToString();

                            logInfo.Service_Type       = ConvertUtility.ToInt32(dtUsers.Rows[i]["Service_Type"].ToString());
                            logInfo.Charging_Count     = ConvertUtility.ToInt32(dtUsers.Rows[i]["Charging_Count"].ToString());
                            logInfo.FailedChargingTime = ConvertUtility.ToInt32(dtUsers.Rows[i]["FailedChargingTimes"].ToString());

                            logInfo.RegisteredTime = ConvertUtility.ToDateTime(dtUsers.Rows[i]["RegisteredTime"].ToString());
                            logInfo.ExpiredTime    = DateTime.Now.AddDays(1);

                            logInfo.Registration_Channel = dtUsers.Rows[i]["Registration_Channel"].ToString();
                            logInfo.Status   = ConvertUtility.ToInt32(dtUsers.Rows[i]["Status"].ToString());
                            logInfo.Operator = dtUsers.Rows[i]["Operator"].ToString();
                            logInfo.Price    = ConvertUtility.ToInt32(price);
                            logInfo.Reason   = "Succ";

                            ViSport_S2_Registered_UsersController.InsertSportGameHeroChargedUserLogForSub(logInfo);

                            #endregion
                        }
                        else
                        {
                            #region LOG DOANH THU

                            var logInfo = new SportGameHeroChargedUserLogInfo();

                            logInfo.ID           = ConvertUtility.ToInt32(dtUsers.Rows[i]["ID"].ToString());
                            logInfo.User_ID      = dtUsers.Rows[i]["User_ID"].ToString();
                            logInfo.Request_ID   = dtUsers.Rows[i]["Request_ID"].ToString();
                            logInfo.Service_ID   = dtUsers.Rows[i]["Service_ID"].ToString();
                            logInfo.Command_Code = dtUsers.Rows[i]["Command_Code"].ToString();

                            logInfo.Service_Type       = ConvertUtility.ToInt32(dtUsers.Rows[i]["Service_Type"].ToString());
                            logInfo.Charging_Count     = ConvertUtility.ToInt32(dtUsers.Rows[i]["Charging_Count"].ToString());
                            logInfo.FailedChargingTime = ConvertUtility.ToInt32(dtUsers.Rows[i]["FailedChargingTimes"].ToString());

                            logInfo.RegisteredTime = ConvertUtility.ToDateTime(dtUsers.Rows[i]["RegisteredTime"].ToString());
                            logInfo.ExpiredTime    = DateTime.Now.AddDays(1);

                            logInfo.Registration_Channel = dtUsers.Rows[i]["Registration_Channel"].ToString();
                            logInfo.Status   = ConvertUtility.ToInt32(dtUsers.Rows[i]["Status"].ToString());
                            logInfo.Operator = dtUsers.Rows[i]["Operator"].ToString();
                            logInfo.Price    = ConvertUtility.ToInt32(price);
                            logInfo.Reason   = returnValue;

                            ViSport_S2_Registered_UsersController.InsertSportGameHeroChargedUserLogForSub(logInfo);

                            #endregion
                        }

                        if (returnValue == "1")//CHARGED THANH CONG
                        {
                            #region SEND MT CHO USER

                            //SEND MT CHO KHACH HANG

                            DataTable dtQuestion = ViSport_S2_Registered_UsersController.GetQuestionInfoSportGameHero();
                            if (dtQuestion != null && dtQuestion.Rows.Count > 0)
                            {
                                message = dtQuestion.Rows[0]["Question"].ToString();

                                int    questionIdnew = ConvertUtility.ToInt32(dtQuestion.Rows[0]["Id"].ToString());
                                string answer        = dtQuestion.Rows[0]["Answer"].ToString();

                                string serviceId   = dtUsers.Rows[i]["Service_ID"].ToString();
                                string commandCode = dtUsers.Rows[i]["Command_Code"].ToString();
                                string requestId   = dtUsers.Rows[i]["Request_ID"].ToString();


                                ViSport_S2_Registered_UsersController.InsertSportGameHeroAnswerLog(dtUsers.Rows[i]["User_ID"].ToString(), questionIdnew, message, answer, DateTime.Now, 0); // LUU LOG Question
                                SendMtSportGame(dtUsers.Rows[i]["User_ID"].ToString(), message, serviceId, commandCode, requestId);
                            }

                            //END SEND MT CHO KHACH HANG

                            #endregion
                        }

                        #endregion
                    }
                    catch (Exception ex)
                    {
                        log.Error("Anh tai bong da Loi charged : " + ex);
                        continue;
                    }
                }
            }

            return(1);
        }
        catch (Exception ex)
        {
            log.Error("Anh tai bong da Loi lay tap User : " + ex);
            return(0);
        }
    }
Ejemplo n.º 14
0
        public void rptPage_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            int curdata = ConvertUtility.ToInt32(e.Item.DataItem);

            if (curdata == pagesize || curdata == totalpage)
            {
                Literal ltrGach = (Literal)e.Item.FindControl("ltrGach");
                ltrGach.Visible = false;
            }
            Label ltrPage = (Label)e.Item.FindControl("ltrPage");
            //string url = Request.AppRelativeCurrentExecutionFilePath.Replace("~/TinHot/", "") + queryparam + e.Item.DataItem;

            string urlGet = Request.RawUrl;

            string[] arrUrl = urlGet.Split('/');
            string   url    = UrlProcess.TinTucChuyenMuc(ConvertUtility.ToInt32(arrUrl[3]), ConvertUtility.ToInt32(e.Item.DataItem), arrUrl[5].Replace(".aspx", ""));


            if ((e.Item.ItemIndex + 1) == curpage)
            {
                ltrPage.Text = "<span class=\"orange bold\">" + ConvertUtility.ToString(e.Item.DataItem) + "</span>";
            }
            else
            {
                if (curpage > numberpage)
                {
                    if (ConvertUtility.ToInt32(e.Item.DataItem) == curpage)
                    {
                        ltrPage.Text = "<span class=\"orange bold\">" + ConvertUtility.ToString(e.Item.DataItem) + "</span>";
                    }
                    else
                    {
                        ltrPage.Text = "<a href=\"" + url + "\" >" + ConvertUtility.ToString(e.Item.DataItem) + " </a>";
                    }
                }
                else
                {
                    ltrPage.Text = "<a href=\"" + url + "\" >" + ConvertUtility.ToString(e.Item.DataItem) + " </a>";
                }
            }
        }
Ejemplo n.º 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            price = ConfigurationSettings.AppSettings.Get("ringtoneprice");
            lang  = Request.QueryString["lang"];
            width = ConvertUtility.ToInt32(Request.QueryString["w"]);
            id    = ConvertUtility.ToInt32(Request.QueryString["id"]);
            telCo = Session["telco"].ToString();
            if (!IsPostBack)
            {
                if (width == 0)
                {
                    width = (int)Constant.DefaultScreen.Standard;
                }
                ltrWidth.Text = "<meta content=\"width=" + width.ToString() + "; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;\" name=\"viewport\" />";

                DataTable dtDetail = MusicController.GetItemDetailHasCache(Session["telco"].ToString(), id);
                //Miễn phí
                if (id == 2843)
                {
                    free = true;
                    HienThiNoiDung(true);
                    return;
                }
                if (telCo == "Undefined")
                {
                    pnlSMS.Visible = true;
                    if (lang == "1")
                    {
                        ltrHuongdan.Text = Resources.Resource.wHuongDan;
                        ltrSMS.Text      = "Soạn tin <b>" + ConfigurationSettings.AppSettings.Get("ringtonecode") + " " + dtDetail.Rows[0]["Code"].ToString() + "</b> gửi <b>" + ConfigurationSettings.AppSettings.Get("ringtonecommandcode") + "</b> để tải bản nhạc <b>" + dtDetail.Rows[0]["SongNameUnicode"].ToString() + "</b> về máy" + Resources.Resource.wChon3G;
                    }
                    else
                    {
                        ltrHuongdan.Text = Resources.Resource.wHuongDan_KD;
                        ltrSMS.Text      = "Soan tin <b>" + ConfigurationSettings.AppSettings.Get("ringtonecode") + " " + dtDetail.Rows[0]["Code"].ToString() + "</b> gui <b>" + ConfigurationSettings.AppSettings.Get("ringtonecommandcode") + "</b> de tai ban nhac <b>" + dtDetail.Rows[0]["SongName"].ToString() + "</b> ve may" + Resources.Resource.wChon3G_KD;
                    }
                }
                else
                {
                    //pnlThongBao.Visible = true;
                    //if (lang == "1")
                    //{
                    //    ltrTitle.Text = Resources.Resource.wThongBao;
                    //    //ltrThongBao.Text = Resources.Resource.wXacNhanDichVu.Replace("xxx", price);
                    //    ltrThongBao.Text = Resources.Resource.wXacNhanDichVu + "nhạc chuông " + dtDetail.Rows[0]["SongNameUnicode"].ToString();
                    //    btnCo.Text = Resources.Resource.btnCo;
                    //    btnKhong.Text = Resources.Resource.btnKhong;
                    //}
                    //else
                    //{
                    //    ltrTitle.Text = Resources.Resource.wThongBao_KD;
                    //    //ltrThongBao.Text = Resources.Resource.wXacNhanDichVu_KD.Replace("xxx", price);
                    //    ltrThongBao.Text = Resources.Resource.wXacNhanDichVu_KD + "nhac chuong " + dtDetail.Rows[0]["SongName"].ToString();
                    //    btnCo.Text = Resources.Resource.btnCo_KD;
                    //    btnKhong.Text = Resources.Resource.btnKhong_KD;
                    //}

                    pnlThongBao.Visible = false;
                    try
                    {
                        switch (Session["telco"].ToString())
                        {
                        case "Vietnamobile":
                            WapXzone_VNM.Library.VNMCharging.VNMChargingGW charging = new WapXzone_VNM.Library.VNMCharging.VNMChargingGW();

                            //messageReturn = charging.PaymentVNM(Session["msisdn"].ToString(), price, "D", "TT", Request.QueryString["id"].ToString());

                            messageReturn = charging.PaymentVNM(Session["msisdn"].ToString(), "MUSICDOWNLOAD", "MUSIC_DOWN");

                            if (!string.IsNullOrEmpty(messageReturn) && messageReturn == "1")
                            {    // Thanh toán thành công >> trả nội dung
                                HienThiNoiDung(true);
                            }
                            else
                            {    // Thanh toán không thành công >> thông báo lỗi
                                HienThiNoiDung(false);
                            }
                            break;
                        }
                    }
                    catch (Exception ex)
                    {
                        ILog logger = log4net.LogManager.GetLogger(Session["telco"].ToString());
                        logger.Debug("----------Lỗi charging----------------------");
                        logger.Debug("MSISDN:" + Session["msisdn"].ToString());
                        logger.Debug(ex.ToString());
                        logger.Debug("----------Lỗi charging----------------------");
                    }
                }
            }
        }
Ejemplo n.º 16
0
        public string SyncSubscriptionData(string ShortCode, string CommandCode, string UserID, string Message, string RequestID, string ServiceID, string RefID, string UpdateType, string UpdateDescription)
        {
            try
            {
                if (Message.StartsWith("HD", StringComparison.OrdinalIgnoreCase)) // HD|HDSD
                {
                    Service_Info service = Controller.Visport_Subscription_Services_GetByID(ConvertUtility.ToInt32(ServiceID));
                    string       mt      = service.Right_Syntax_MT.Replace("Shortcode", ShortCode);
                    Controller.SendMT(UserID, mt, ShortCode, CommandCode, service.Service_Type, service.ID, MESSAGE_TYPE.NoCharge, RequestID, 1, 1, 0, CONTENT_TYPE.Text);
                }
                else if (Message.StartsWith("KT", StringComparison.OrdinalIgnoreCase)) // KTDV|KT DV
                {
                    DataTable dt = SqlHelper.ExecuteDataset(Common.ConnectionString, "Visport_GetRegisteredServices", UserID).Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        string srvInfoFormat = "Quy khach dang su dung dich vu {0} tren dau so 979. Phi dich vu: {1} dong/{2} ngay. Quy khach da dang ky dich vu vao ngay {3} qua {4}. De huy dich vu, vui long soan: {5} gui 979.  De biet them ve cac dich vu khac, soan tin: HDSD gui 949 .Tran trong cam on.";
                        string srvInfo       = "";
                        foreach (DataRow dr in dt.Rows)
                        {
                            srvInfo = String.Format(srvInfoFormat, dr["Product_Name"], dr["Charging_Price"], dr["PeriodLength"], dr["RegisteredTime"], dr["Registration_Channel"], dr["Cancel_Syntax"]);
                            Controller.SendMT(UserID, srvInfo, ShortCode, CommandCode, 1001, 1, MESSAGE_TYPE.NoCharge, RequestID, 1, 1, 0, CONTENT_TYPE.Text);
                        }
                    }
                    else
                    {
                        string mt = "Quy khach khong su dung dich vu nao tren dau so nay. Tran trong cam on";
                        Controller.SendMT(UserID, mt, ShortCode, CommandCode, 1001, 1, MESSAGE_TYPE.NoCharge, RequestID, 1, 1, 0, CONTENT_TYPE.Text);
                    }
                }
                else if (Message.StartsWith("HUY", StringComparison.OrdinalIgnoreCase)) // HUY TBDV
                {
                    DataTable dt = SqlHelper.ExecuteDataset(Common.ConnectionString, "Visport_GetRegisteredServices", UserID).Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            Controller.Visport_Deactivate_Users(ConvertUtility.ToInt32(dr["ID"]), "HUY TBDV");
                        }

                        string mt = "Quy khach da huy thanh cong toan bo dich vu da dang ky tren dau so 979. Tran trong cam on";
                        Controller.SendMT(UserID, mt, ShortCode, CommandCode, 1001, 1, MESSAGE_TYPE.NoCharge, RequestID, 1, 1, 0, CONTENT_TYPE.Text);
                    }
                    else
                    {
                        string mt = "Quy khach khong su dung dich vu nao tren dau so nay. Tran trong cam on";
                        Controller.SendMT(UserID, mt, ShortCode, CommandCode, 1001, 1, MESSAGE_TYPE.NoCharge, RequestID, 1, 1, 0, CONTENT_TYPE.Text);
                    }
                }

                return("-1|User Guide");
            }
            catch (Exception ex)
            {
                return("0|" + ex.Message);
            }
        }
Ejemplo n.º 17
0
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         foreach (ListItem item in lstCommands.Items)
         {
             if (item.Selected && item.Value != "0")
             {
                 UserController.AddCommandToUserByPortalID(Convert.ToInt32(item.Value), userId, ConvertUtility.ToInt32(dropPortal.SelectedValue));
             }
             else
             {
                 UserController.RemoveCommandFromUserByPortalID(Convert.ToInt32(item.Value), userId, ConvertUtility.ToInt32(dropPortal.SelectedValue));
             }
         }
         lblUpdateStatus.Text = MiscUtility.MSG_UPDATE_SUCCESS;
         new DataCaching().RemoveAll();
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
     }
     lblUpdateStatus1.Text = "";
 }
Ejemplo n.º 18
0
        protected void HienThiNoiDung(Boolean thuchien)
        {
            pnlNoiDung.Visible = true;

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

            SoDT = MobileUtils.ToSTDMobileNumber(SoDT);
            if (thuchien)
            {
                if (lang == "1")
                {
                    ltrTieuDe.Text = linkStr;
                    lblTen.Text    = dtDetail.Rows[0]["WTitle_Unicode"].ToString();
                    //lnkDownload.Text = Resources.Resource.wBamDeTai;
                    ltrNoiDung.Text = Resources.Resource.wTangThanhCong + " hình nền " + dtDetail.Rows[0]["WTitle_Unicode"].ToString() + " (" + dtDetail.Rows[0]["WCode"].ToString() + ") tới số điện thoại 0" + SoDT.Remove(0, 2);
                }
                else
                {
                    ltrTieuDe.Text = linkStr_KD;
                    lblTen.Text    = dtDetail.Rows[0]["WTitle"].ToString();
                    //lnkDownload.Text = Resources.Resource.wBamDeTai_KD;
                    ltrNoiDung.Text = Resources.Resource.wTangThanhCong_KD + " hinh nen " + dtDetail.Rows[0]["WTitle"].ToString() + " (" + dtDetail.Rows[0]["WCode"].ToString() + ") toi so dien thoai 0" + SoDT.Remove(0, 2);
                };

                string url    = UrlProcess.GetDownloadItem(Session["telco"].ToString(), "1", 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("wallcommandcode");
                mtInfo.Command_Code  = ConfigurationSettings.AppSettings.Get("wallcode");
                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 hinh nen " + dtDetail.Rows[0]["WCode"].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 hinh nen " + dtDetail.Rows[0]["WCode"].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 hinh nen 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);

                //Lưu Transaction
                if (ConvertUtility.ToInt32(dtDetail.Rows[0]["W_CategoryID"]) == ConvertUtility.ToInt32(ConfigurationSettings.AppSettings.Get("thuphapid")))
                {
                    chitietGiaodich = "Thu phap: " + dtDetail.Rows[0]["WCode"].ToString() + " -- id:" + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
                    Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, url, id.ToString(), chitietGiaodich, 15);
                }
                else
                {
                    chitietGiaodich = "Hinh nen: " + dtDetail.Rows[0]["WCode"].ToString() + " -- id:" + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
                    Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, url, id.ToString(), chitietGiaodich, 1);
                }
                HinhNenController.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;
                }
                if (ConvertUtility.ToInt32(dtDetail.Rows[0]["W_CategoryID"]) == ConvertUtility.ToInt32(ConfigurationSettings.AppSettings.Get("thuphapid")))
                {
                    chitietGiaodich = "Thu phap: " + dtDetail.Rows[0]["WCode"].ToString() + " -- id:" + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
                    Transaction.Failure(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 15, messageReturn);
                }
                else
                {
                    chitietGiaodich = "Hinh nen: " + dtDetail.Rows[0]["WCode"].ToString() + " -- id:" + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
                    Transaction.Failure(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 1, 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: Hinh nen - parameter: " + price + " - Ten: " + dtDetail.Rows[0]["WTitle"].ToString() + " - id: " + id);
            logger.Debug("Wallpaper Url:" + lnkDownload.NavigateUrl);
            logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress);
            logger.Debug("Error:" + messageReturn);
            logger.Debug("Current Url:" + Request.RawUrl);
            //end log
        }
Ejemplo n.º 19
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            //Fill commands
            lstCommands.Items.Clear();

            if (!CurrentUser.IsSuperAdmin)
            {
                CommandController.FillToListBox(lstCommands.Items, CommandController.GetCommandsForUserByPortalID(CurrentUser.UserID, ConvertUtility.ToInt32(dropPortal.SelectedValue)), 0, CurrentUser.IsSuperAdmin);
            }
            else
            {
                CommandController.FillToListBox(lstCommands.Items, CommandController.GetCommands(), 0, CurrentUser.IsSuperAdmin);
            }

            DataTable dtUserCommands = CommandController.GetCommandsForUserNotGroup(userId, ConvertUtility.ToInt32(dropPortal.SelectedValue));

            foreach (DataRow row in dtUserCommands.Rows)
            {
                if (lstCommands.Items.FindByValue(row["CommandID"].ToString()) != null)
                {
                    lstCommands.Items.FindByValue(row["CommandID"].ToString()).Selected = true;
                }
            }

            DataTable dtReturnCommand = new DataTable();

            dtReturnCommand.Columns.Add("CommandID", typeof(String));
            dtReturnCommand.Columns.Add("PortalID", typeof(String));
            dtReturnCommand.Columns.Add("UserID", typeof(String));
            dtReturnCommand.Columns.Add("CommandParentID", typeof(String));
            dtReturnCommand.Columns.Add("CommandName", typeof(String));
            dtReturnCommand.Columns.Add("Level", typeof(String));
            dtReturnCommand.Columns.Add("Role_View", typeof(String));
            dtReturnCommand.Columns.Add("Role_Add", typeof(String));
            dtReturnCommand.Columns.Add("Role_Update", typeof(String));
            dtReturnCommand.Columns.Add("Role_Delete", typeof(String));
            dtReturnCommand.Columns.Add("UseForWeb", typeof(String));
            dtReturnCommand.Columns.Add("UseForWap", typeof(String));
            dtReturnCommand.Columns.Add("UseForSMS", typeof(String));
            dtReturnCommand.Columns.Add("UseForXzone", typeof(String));

            dtCommand = dtUserCommands;
            DataTable _dtReturnCommand = UserController.BuildRecursiveUserPermission(dtUserCommands, dtReturnCommand, userId, ConvertUtility.ToInt32(dropPortal.SelectedValue));

            dgrUserRole.DataSource = _dtReturnCommand;
            dgrUserRole.DataBind();
        }
Ejemplo n.º 20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lang  = Request.QueryString["lang"];
            width = ConvertUtility.ToInt32(Request.QueryString["w"]);
            SoDT  = Request.QueryString["sdt"];
            telCo = Session["telco"].ToString();
            id    = ConvertUtility.ToInt32(Request.QueryString["id"]);
            catID = ConvertUtility.ToInt32(Request.QueryString["catid"]);
            DataTable dtDetail = HinhNenController.GetWallpaperDetailByID(telCo, id);

            if (catID == ConvertUtility.ToInt32(ConfigurationSettings.AppSettings.Get("thuphapid")))
            {
                price = ConfigurationSettings.AppSettings.Get("thuphapprice");
            }
            else
            {
                price = ConfigurationSettings.AppSettings.Get("wallprice");
            }
            linkStr    = "<a href=\"../" + UrlProcess.GetWallpaperHomeUrl(lang, width.ToString()).Replace("~/", "") + "\" >HÌNH NỀN<a>";
            linkStr_KD = "<a href=\"../" + UrlProcess.GetWallpaperHomeUrl(lang, width.ToString()).Replace("~/", "") + "\" >HINH NEN<a>";

            if (!IsPostBack)
            {
                if (width == 0)
                {
                    width = (int)Constant.DefaultScreen.Standard;
                }
                ltrWidth.Text = "<meta content=\"width=" + width.ToString() + "; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;\" name=\"viewport\" />";

                //Nếu số điện thoại không hợp lệ thì hướng dẫn
                if (!MobileUtils.IsMobileNumber(SoDT))
                {
                    pnlSMS.Visible = true;
                    if (lang == "1")
                    {
                        ltrHuongdan.Text = linkStr + " » " + Resources.Resource.wHuongDan;
                        ltrSMS.Text      = Resources.Resource.wSoDienThoaiKhongHopLe;
                    }
                    else
                    {
                        ltrHuongdan.Text = linkStr_KD + " » " + Resources.Resource.wHuongDan_KD;
                        ltrSMS.Text      = Resources.Resource.wSoDienThoaiKhongHopLe_KD;
                    }
                    return;
                }


                if (telCo == "Undefined")
                {
                    pnlSMS.Visible = true;
                    if (lang == "1")
                    {
                        ltrHuongdan.Text = linkStr + " » " + Resources.Resource.wHuongDan;
                        ltrSMS.Text      = "Soạn tin <b>" + ConfigurationSettings.AppSettings.Get("wallcode") + " " + dtDetail.Rows[0]["WCode"].ToString() + " " + SoDT + "</b> gửi <b>" + ConfigurationSettings.AppSettings.Get("wallcommandcode") + "</b> để gửi tặng hình nền <b>" + dtDetail.Rows[0]["WTitle_Unicode"].ToString() + "</b>" + Resources.Resource.wChon3G;
                    }
                    else
                    {
                        ltrHuongdan.Text = linkStr_KD + " » " + Resources.Resource.wHuongDan_KD;
                        ltrSMS.Text      = "Soan tin <b>" + ConfigurationSettings.AppSettings.Get("wallcode") + " " + dtDetail.Rows[0]["WCode"].ToString() + " " + SoDT + "</b> gui <b>" + ConfigurationSettings.AppSettings.Get("wallcommandcode") + "</b> de gui tang hinh nen <b>" + dtDetail.Rows[0]["WTitle"].ToString() + "</b>" + Resources.Resource.wChon3G_KD;
                    }
                }
                else
                {
                    //pnlThongBao.Visible = true;
                    //if (lang == "1")
                    //{
                    //    ltrTitle.Text = linkStr + " » " + Resources.Resource.wThongBao;
                    //    //ltrThongBao.Text = Resources.Resource.wXacNhanTangDichVu.Replace("xxx", price);
                    //    ltrThongBao.Text = Resources.Resource.wXacNhanTangDichVu + "hình nền " + dtDetail.Rows[0]["WTitle_Unicode"].ToString();
                    //    btnCo.Text = Resources.Resource.btnCo;
                    //    btnKhong.Text = Resources.Resource.btnKhong;
                    //}
                    //else
                    //{
                    //    ltrTitle.Text = linkStr_KD + " » " + Resources.Resource.wThongBao_KD;
                    //    //ltrThongBao.Text = Resources.Resource.wXacNhanTangDichVu_KD.Replace("xxx", price);
                    //    ltrThongBao.Text = Resources.Resource.wXacNhanTangDichVu_KD + "hinh nen " + dtDetail.Rows[0]["WTitle"].ToString();
                    //    btnCo.Text = Resources.Resource.btnCo_KD;
                    //    btnKhong.Text = Resources.Resource.btnKhong_KD;
                    //}
                    pnlThongBao.Visible = false;
                    switch (Session["telco"].ToString())
                    {
                    case "Vietnamobile":
                        WapXzone_VNM.Library.VNMCharging.VNMChargingGW charging = new WapXzone_VNM.Library.VNMCharging.VNMChargingGW();

                        //messageReturn = charging.PaymentVNM(Session["msisdn"].ToString(), price, "D", "WP", Request.QueryString["id"].ToString());

                        messageReturn = charging.PaymentVNM(Session["msisdn"].ToString(), "PICGIFT", "PIC_GIFT");

                        messageReturn = charging.NavigatePaymentVnm(Session["msisdn"].ToString(), "PICGIFT", "PIC_GIFT", price, "D", "WP", Request.QueryString["id"]);

                        if (messageReturn == "1")
                        {    // Thanh toán thành công >> trả nội dung
                            HienThiNoiDung(true);
                        }
                        else
                        {    // Thanh toán không thành công >> thông báo lỗi
                            HienThiNoiDung(false);
                        }
                        break;
                    }
                }
            }
        }
Ejemplo n.º 21
0
        protected void rptData_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var curData = (DataRowView)e.Item.DataItem;

                var lnkName   = (HyperLink)e.Item.FindControl("lnkName");
                var lnkAvatar = (HyperLink)e.Item.FindControl("lnkAvatar");
                var imgAvatar = (Image)e.Item.FindControl("imgAvatar");

                lnkName.Text        = curData["Content_Name"].ToString();
                lnkName.NavigateUrl = lnkAvatar.NavigateUrl = UrlFilter.BuildUrlByItemID(ConvertUtility.ToInt32(curData["Distribution_ID"]));

                var coverInfo = ImageDB.GetCover(ConvertUtility.ToInt32(curData["Content_ID"]));
                if (coverInfo != null)
                {
                    string avatar = coverInfo.Image_File;
                    if (avatar.Length > 0)
                    {
                        imgAvatar.ImageUrl = UrlFilter.BuildImageUrl(avatar, 180, 0);
                    }
                    else
                    {
                        imgAvatar.Visible = false;
                    }
                }
                else
                {
                    imgAvatar.Visible = false;
                }
            }
        }
Ejemplo n.º 22
0
        private static ContentInfo CreateEntityFromReader(IDataReader reader)
        {
            var item = new ContentInfo();

            try { if (!reader.IsDBNull(reader.GetOrdinal("Content_ID")))
                  {
                      item.Content_ID = ConvertUtility.ToInt32(reader["Content_ID"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Content_Name")))
                  {
                      item.Content_Name = ConvertUtility.ToString(reader["Content_Name"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Content_Teaser")))
                  {
                      item.Content_Teaser = ConvertUtility.ToString(reader["Content_Teaser"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Content_Body")))
                  {
                      item.Content_Body = ConvertUtility.ToString(reader["Content_Body"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Content_CreateDate")))
                  {
                      item.Content_CreateDate = ConvertUtility.ToDateTime(reader["Content_CreateDate"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Content_ModifiedDate")))
                  {
                      item.Content_ModifiedDate = ConvertUtility.ToDateTime(reader["Content_ModifiedDate"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Content_Status")))
                  {
                      item.Content_Status = ConvertUtility.ToInt32(reader["Content_Status"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Content_OriginalZoneID")))
                  {
                      item.Content_OriginalZoneID = ConvertUtility.ToInt32(reader["Content_OriginalZoneID"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Content_UserID")))
                  {
                      item.Content_UserID = ConvertUtility.ToInt32(reader["Content_UserID"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Content_ModifiedUserID")))
                  {
                      item.Content_ModifiedUserID = ConvertUtility.ToInt32(reader["Content_ModifiedUserID"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Content_Author")))
                  {
                      item.Content_Author = ConvertUtility.ToString(reader["Content_Author"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Content_EventDate")))
                  {
                      item.Content_EventDate = ConvertUtility.ToDateTime(reader["Content_EventDate"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Content_FriendlyUrl")))
                  {
                      item.Content_FriendlyUrl = ConvertUtility.ToString(reader["Content_FriendlyUrl"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Content_Comment")))
                  {
                      item.Content_Comment = ConvertUtility.ToString(reader["Content_Comment"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Content_ExcludeFromSearch")))
                  {
                      item.Content_ExcludeFromSearch = ConvertUtility.ToBoolean(reader["Content_ExcludeFromSearch"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Content_IsPhoto")))
                  {
                      item.Content_IsPhoto = ConvertUtility.ToBoolean(reader["Content_IsPhoto"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Content_IsDownload")))
                  {
                      item.Content_IsDownload = ConvertUtility.ToBoolean(reader["Content_IsDownload"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Content_IsVideo")))
                  {
                      item.Content_IsVideo = ConvertUtility.ToBoolean(reader["Content_IsVideo"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Content_IsPoll")))
                  {
                      item.Content_IsPoll = ConvertUtility.ToBoolean(reader["Content_IsPoll"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Content_IsProduct")))
                  {
                      item.Content_IsProduct = ConvertUtility.ToBoolean(reader["Content_IsProduct"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Content_Visible")))
                  {
                      item.Content_Visible = ConvertUtility.ToBoolean(reader["Content_Visible"]);
                  }
            }
            catch { }
            try { if (!reader.IsDBNull(reader.GetOrdinal("Content_IsTemp")))
                  {
                      item.Content_IsTemp = ConvertUtility.ToBoolean(reader["Content_IsTemp"]);
                  }
            }
            catch { }
            return(item);
        }
Ejemplo n.º 23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            price = ConfigurationSettings.AppSettings.Get("videopriceView");
            lang  = Request.QueryString["lang"];
            width = ConvertUtility.ToInt32(Request.QueryString["w"]);
            id    = ConvertUtility.ToInt32(Request.QueryString["id"]);

            telCo = AppEnv.CheckFreeContentTelco();

            linkStr = "<a href=\"" + UrlProcess.VideoHome() + "\" >VIDEO</a>";

            //HienThiNoiDung(true,false);return;

            if (!IsPostBack)
            {
                //if (width == 0)
                //    width = (int)Constant.DefaultScreen.Standard;
                //ltrWidth.Text = "<meta content=\"width=" + width.ToString() + "; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;\" name=\"viewport\" />";

                #region Free Content

                if (AppEnv.GetSetting("FreeContent") == "1")
                {
                    HienThiNoiDung(true, false);
                    return;
                }

                #endregion

                #region OLD

                if (Session["transactionid_old"] != null)
                {// Nếu có transactionid_old >> thuê bao mobifone đã thực hiện thanh toán
                    messageReturn = ConvertUtility.ToString(Session["debit_status"]);
                    if (ConvertUtility.ToString(Session["debit_status"]) == "0")
                    {// Thanh toán thành công >> trả nội dung
                        HienThiNoiDung(true, true);
                    }
                    else
                    {// Thanh toán không thành công >> thông báo lỗi
                        HienThiNoiDung(false, true);
                    }
                    Session["transactionid_old"] = null;
                }
                else
                {
                    DataTable dtDetail = VideoController.GetVideoDetailByID(Session["telco"].ToString(), id);
                    if (telCo == Constant.T_Mobifone)
                    {
                        string content = Session["cpid"].ToString() + "&" + Constant.clipchung + "0" + id.ToString() + "&" + price + "&" + Session["transactionid"].ToString();
                        Response.Redirect(ConfigurationSettings.AppSettings.Get("vms3g") + "?link=" + Server.UrlEncode(EAS.EncryptData(content, ConfigurationSettings.AppSettings.Get("vmskey"))));
                    }
                    //
                    if (telCo == "Undefined")
                    {
                        pnlSMS.Visible = true;
                        //if (lang == "1")
                        //{
                        ltrHuongdan.Text = linkStr + " » " + Resources.Resource.wHuongDan;
                        ltrSMS.Text      = "Soạn tin <b>" + ConfigurationSettings.AppSettings.Get("videocode") + " " + dtDetail.Rows[0]["VID"].ToString() + "</b> gửi <b>" + ConfigurationSettings.AppSettings.Get("videocommandcode") + "</b> để tải video <b>" + dtDetail.Rows[0]["VTitle_Unicode"].ToString() + "</b> về máy" + Resources.Resource.wChon3G;
                        //}
                        //else
                        //{
                        //    ltrHuongdan.Text = linkStr + " » " + Resources.Resource.wHuongDan_KD;
                        //    ltrSMS.Text = "Soan tin <b>" + ConfigurationSettings.AppSettings.Get("videocode") + " " + dtDetail.Rows[0]["VID"].ToString() + "</b> gui <b>" + ConfigurationSettings.AppSettings.Get("videocommandcode") + "</b> de tai video <b>" + dtDetail.Rows[0]["VTitle"].ToString() + "</b> ve may" + Resources.Resource.wChon3G_KD;
                        //}
                    }
                    else
                    {
                        pnlThongBao.Visible = false;
                        try
                        {
                            switch (Session["telco"].ToString())
                            {
                            case "Vietnamobile":
                                var charging = new Library.VNMCharging.VNMChargingGW();

                                messageReturn = charging.NavigatePaymentVnm(Session["msisdn"].ToString(), "VIDEOVIEW", "VIDEO_VIEW", price, "D", "VID", Request.QueryString["id"]);

                                if (messageReturn == AppEnv.GetSetting("NotEnoughMoney"))    //Not Enough Money
                                {
                                    messageReturn = AppEnv.VnmChargingOptimizeNotEnoughMoney(Session["msisdn"].ToString(), "VIDEOVIEW", "VIDEO_VIEW", price, "D", "VID", Request.QueryString["id"], out logPrice);
                                    price         = logPrice;
                                }

                                if (messageReturn == AppEnv.GetSetting("SystemOverload"))     //System Over Load
                                {
                                    messageReturn = AppEnv.VnmChargingSystemOverload(Session["msisdn"].ToString(), "VIDEOVIEW", "VIDEO_VIEW", price, "D", "VID", Request.QueryString["id"]);
                                }

                                ILog logger = log4net.LogManager.GetLogger(Session["telco"].ToString());
                                logger.Debug("---" + messageReturn + "---");
                                if (messageReturn == "1")
                                {    // Thanh toán thành công >> trả nội dung
                                    HienThiNoiDung(true, true);
                                }
                                else
                                {    // Thanh toán không thành công >> thông báo lỗi
                                    HienThiNoiDung(false, true);
                                }
                                break;
                            }
                        }
                        catch (Exception ex)
                        {
                            ILog logger = log4net.LogManager.GetLogger(Session["telco"].ToString());
                            logger.Debug("----------Lỗi charging----------------------");
                            logger.Debug("MSISDN:" + Session["msisdn"].ToString());
                            logger.Debug(ex.ToString());
                            logger.Debug("----------Lỗi charging----------------------");
                        }
                    }
                }

                #endregion
            }
        }
        protected void HienThiNoiDung(Boolean thuchien, Boolean log)
        {
            pnlNoiDung.Visible = true;

            DataTable dtGiai = ThethaoController.GetCompetitionGetByWID(ConvertUtility.ToInt32(Request.QueryString["catid"]));

            gameid = dtGiai.Rows[0]["CompetitionID"].ToString();
            DataTable dtTKDB          = ThethaoController.ThongKeDacBiet(gameid);
            string    chitietGiaodich = string.Empty;

            if (thuchien)
            {
                if (dtTKDB.Rows.Count > 0)
                {
                    string noidung = dtTKDB.Rows[0][0].ToString().Trim();

                    ltrNoiDung.Text = noidung;
                    //if (lang == "1")
                    //{
                    ltrTieuDe.Text = linkStr;
                    lblTen.Text    = dtGiai.Rows[0]["NameUnicode"].ToString();
                    //}
                    //else
                    //{
                    //    ltrTieuDe.Text = linkStr_KD;
                    //    lblTen.Text = dtGiai.Rows[0]["Name"].ToString();
                    //};

                    if (log)
                    {
                        chitietGiaodich = "Thống kê đặc biệt: " + dtGiai.Rows[0]["Name"].ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
                        chitietGiaodich = chitietGiaodich + "\r\n" + ltrNoiDung.Text;
                        Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), gameid, chitietGiaodich, 20);//Thong ke dac biet
                    }
                }
            }
            else
            {
                chitietGiaodich = "Thống kê đặc biệt: " + gameid + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
                //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;
                //}
                if (log)
                {
                    Transaction.Failure(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), gameid, chitietGiaodich, 20, messageReturn);
                }
                //--Thông báo lỗi thanh toán
            }

            if (log)
            {
                //log charging
                ILog logger = LogManager.GetLogger(Session["telco"].ToString());
                logger.Debug("--------------------------------------------------");
                logger.Debug("MSISDN: " + Session["msisdn"]);
                logger.Debug("Dich vu: Thong ke dac biet " + 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
            }
        }
Ejemplo n.º 25
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnInit(e);
            if (CurrentUser.IsSuperAdmin)// || CurrentUser.IsAdmin
            {
                this.Visible = true;
            }
            else
            {
                DataTable dt = CommandController.GetRoleForUserByPortalID(CurrentUser.UserID, ConvertUtility.ToInt32(AppEnv.PortalId()));

                if (dt.Rows.Count > 0)
                {
                    if (dt.Rows.Count > 1)
                    {
                        pmsRole  = ConvertUtility.ToBoolean(dt.Rows[0]["Role_View"]);
                        pmsRole1 = ConvertUtility.ToBoolean(dt.Rows[1]["Role_View"]);

                        if (!pmsRole && !pmsRole1)
                        {
                            this.Visible = false;
                        }
                        else
                        {
                            this.Visible = true;
                        }
                    }
                    else
                    {
                        pmsRole = ConvertUtility.ToBoolean(dt.Rows[0]["Role_View"]);
                        if (!pmsRole)
                        {
                            this.Visible = false;
                        }
                        else
                        {
                            this.Visible = true;
                        }
                    }
                }
                else
                {
                    this.Visible = false;
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            lang  = Request.QueryString["lang"];
            width = ConvertUtility.ToInt32(Request.QueryString["w"]);
            price = ConfigurationSettings.AppSettings.Get("goldprice");

            telCo = AppEnv.CheckSessionTelco();

            linkStr = "<a href=\"" + UrlProcess.TheThaoHome() + "\" >BÓNG ĐÁ</a>";
            //linkStr_KD = "<a href=\"../" + UrlProcess.GetSportHomeUrl(lang, "home", width.ToString()).Replace("~/", "") + "\" >BONG DA<a>";

            if (!IsPostBack)
            {
                //if (width == 0)
                //    width = (int)Constant.DefaultScreen.Standard;
                //ltrWidth.Text = "<meta content=\"width=" + width.ToString() + "; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;\" name=\"viewport\" />";

                #region Free Content

                if (AppEnv.GetSetting("FreeContent") == "1")
                {
                    HienThiNoiDung(true, false);
                    return;
                }

                #endregion

                #region OLD

                DataTable dtGiai = ThethaoController.GetCompetitionGetByWID(ConvertUtility.ToInt32(Request.QueryString["catid"]));

                if (WapController.W4A_Subscriber_IsActive(ConvertUtility.ToString(Session["msisdn"]), 2))
                {
                    HienThiNoiDung(true, false);
                    return;
                }

                gameid = ThethaoController.GetCompetitionGetByWID(ConvertUtility.ToInt32(Request.QueryString["catid"])).Rows[0]["CompetitionID"].ToString();
                // Nếu có transactionid_old >> thuê bao mobifone đã thực hiện thanh toán
                if (Session["transactionid_old"] != null)
                {
                    messageReturn = ConvertUtility.ToString(Session["debit_status"]);
                    if (ConvertUtility.ToString(Session["debit_status"]) == "0")
                    {// Thanh toán thành công >> trả nội dung
                        HienThiNoiDung(true, true);
                    }
                    else
                    {// Thanh toán không thành công >> thông báo lỗi
                        HienThiNoiDung(false, true);
                    }
                    Session["transactionid_old"] = null;
                }
                else
                {
                    if (telCo == Constant.T_Mobifone)
                    {
                        //Chưa xử lý
                        string content = Session["cpid"].ToString() + "&" + Constant.thethao + "5" + Request.QueryString["catid"] + "&" + price + "&" + Session["transactionid"].ToString();
                        Response.Redirect(ConfigurationSettings.AppSettings.Get("vms3g") + "?link=" + Server.UrlEncode(EAS.EncryptData(content, ConfigurationSettings.AppSettings.Get("vmskey"))));
                    }
                    //
                    if (telCo == "Undefined")
                    {
                        pnlSMS.Visible = true;
                        //if (lang == "1")
                        //{
                        ltrHuongdan.Text = linkStr + " » " + Resources.Resource.wHuongDan;
                        ltrSMS.Text      = "Soạn tin <b>" + ConfigurationSettings.AppSettings.Get("tkdbcode") + " " + dtGiai.Rows[0]["Code"].ToString() + "</b> gửi <b>" + ConfigurationSettings.AppSettings.Get("tkdbcommandcode") + "</b> để nhận thống kê đặc biệt của giải" + Resources.Resource.wChon3G;
                        //}
                        //else
                        //{
                        //    ltrHuongdan.Text = linkStr_KD + " » " + Resources.Resource.wHuongDan_KD;
                        //    ltrSMS.Text = "Soan tin <b>" + ConfigurationSettings.AppSettings.Get("tkdbcode") + " " + dtGiai.Rows[0]["Code"].ToString() + "</b> gui <b>" + ConfigurationSettings.AppSettings.Get("tkdbcommandcode") + "</b> de nhan thong ke dac biet cua giai" + Resources.Resource.wChon3G_KD;
                        //}
                    }
                    else
                    {
                        pnlThongBao.Visible = false;
                        switch (Session["telco"].ToString())
                        {
                        case "Vietnamobile":
                            var charging = new Library.VNMCharging.VNMChargingGW();

                            messageReturn = charging.NavigatePaymentVnm(Session["msisdn"].ToString(), "GAMEDOWN", "GAME_DOWN", price, "D", "GAME87", Request.QueryString["id"]);

                            if (messageReturn == AppEnv.GetSetting("NotEnoughMoney"))    //Not Enough Money
                            {
                                messageReturn = AppEnv.VnmChargingOptimizeNotEnoughMoney(Session["msisdn"].ToString(), "GAMEDOWN", "GAME_DOWN", price, "D", "GAME87", Request.QueryString["id"], out logPrice);
                                price         = logPrice;
                            }

                            if (messageReturn == AppEnv.GetSetting("SystemOverload"))     //System Over Load
                            {
                                messageReturn = AppEnv.VnmChargingSystemOverload(Session["msisdn"].ToString(), "GAMEDOWN", "GAME_DOWN", price, "D", "GAME87", Request.QueryString["id"]);
                            }

                            if (!string.IsNullOrEmpty(messageReturn) && messageReturn == "1")
                            {    // Thanh toán thành công >> trả nội dung
                                HienThiNoiDung(true, true);
                            }
                            else
                            {    // Thanh toán không thành công >> thông báo lỗi
                                HienThiNoiDung(false, true);
                            }
                            break;
                        }
                    }
                }

                #endregion
            }
        }
Ejemplo n.º 27
0
        protected void HienThiNoiDung(Boolean thuchien, Boolean isLog)
        {
            pnlNoiDung.Visible = true;

            id    = ConvertUtility.ToInt32(Request.QueryString["id"]);
            level = Request.QueryString["l"];

            if (thuchien)
            {
                int       type;
                DateTime  vTime    = DateTime.Now;
                DataTable dtDetail = null;
                switch (level)
                {
                case "1":
                    dtDetail = HoangdaoController.GetHodaDateByIDHasCache(id);
                    type     = ConvertUtility.ToInt32(dtDetail.Rows[0]["Type"]);
                    if (lang == "1")
                    {
                        ltrTieuDe.Text = linkStr + " » " + "HOÀNG ĐẠO THEO NGÀY";
                        lblTen.Text    = HoangdaoController.CungHoangdao[type, 1] + " (" + HoangdaoController.CungHoangdao[type, 2] + ")";
                        if (dtDetail.Rows.Count > 0)
                        {
                            ltrNoiDung.Text = dtDetail.Rows[0]["WapContent"].ToString();
                        }
                    }
                    else
                    {
                        ltrTieuDe.Text = linkStr_KD + " » " + "HOANG DAO THEO NGAY";
                        lblTen.Text    = HoangdaoController.CungHoangdao[type, 0] + " (" + HoangdaoController.CungHoangdao[type, 2] + ")";
                        if (dtDetail.Rows.Count > 0)
                        {
                            ltrNoiDung.Text = UnicodeUtility.UnicodeToKoDau(dtDetail.Rows[0]["WapContent"].ToString());
                        }
                    };
                    break;

                case "2":
                    dtDetail = HoangdaoController.GetHodaWeekByIDHasCache(id);
                    type     = ConvertUtility.ToInt32(dtDetail.Rows[0]["Type"]);
                    if (lang == "1")
                    {
                        ltrTieuDe.Text = linkStr + " » " + "HOÀNG ĐẠO THEO TUẦN";
                        lblTen.Text    = HoangdaoController.CungHoangdao[type, 1] + " (" + HoangdaoController.CungHoangdao[type, 2] + ")";
                        if (dtDetail.Rows.Count > 0)
                        {
                            ltrNoiDung.Text = dtDetail.Rows[0]["WapContent"].ToString();
                        }
                    }
                    else
                    {
                        ltrTieuDe.Text = linkStr_KD + " » " + "HOANG DAO THEO TUAN";
                        lblTen.Text    = HoangdaoController.CungHoangdao[type, 0] + " (" + HoangdaoController.CungHoangdao[type, 2] + ")";
                        if (dtDetail.Rows.Count > 0)
                        {
                            ltrNoiDung.Text = UnicodeUtility.UnicodeToKoDau(dtDetail.Rows[0]["WapContent"].ToString());
                        }
                    };
                    break;

                case "3":
                    dtDetail = HoangdaoController.GetHodaMonthByIDHasCache(id);
                    type     = ConvertUtility.ToInt32(dtDetail.Rows[0]["Type"]);
                    if (lang == "1")
                    {
                        ltrTieuDe.Text = linkStr + " » " + "HOÀNG ĐẠO THEO THÁNG";
                        lblTen.Text    = HoangdaoController.CungHoangdao[type, 1] + " (" + HoangdaoController.CungHoangdao[type, 2] + ")";
                        if (dtDetail.Rows.Count > 0)
                        {
                            ltrNoiDung.Text = dtDetail.Rows[0]["WapContent"].ToString();
                        }
                    }
                    else
                    {
                        ltrTieuDe.Text = linkStr_KD + " » " + "HOANG DAO THEO THANG";
                        lblTen.Text    = HoangdaoController.CungHoangdao[type, 0] + " (" + HoangdaoController.CungHoangdao[type, 2] + ")";
                        if (dtDetail.Rows.Count > 0)
                        {
                            ltrNoiDung.Text = UnicodeUtility.UnicodeToKoDau(dtDetail.Rows[0]["WapContent"].ToString());
                        }
                    };
                    break;
                }

                if (isLog)
                {
                    Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), level + id.ToString(), "Hoang dao: level:" + level + " -- id:" + id.ToString(), 17);
                }
            }
            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(), level + id.ToString(), "Hoang dao: level:" + level + " -- id:" + id.ToString(), 17, messageReturn);
                //--Thông báo lỗi thanh toán
            }

            if (isLog)
            {
                //log charging
                ILog logger = log4net.LogManager.GetLogger(AppEnv.CheckFreeContentTelco());
                logger.Debug("--------------------------------------------------");
                logger.Debug("MSISDN:" + Session["msisdn"].ToString());
                logger.Debug("Dich vu: Hoang dao - parameter: " + price + " - level: " + level + " - id: " + id.ToString());
                logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress);
                logger.Debug("Error:" + messageReturn);
                logger.Debug("Current Url:" + Request.RawUrl);
                //end log
            }
        }
Ejemplo n.º 28
0
        protected void HienThiNoiDung(Boolean thuchien)
        {
            pnlNoiDung.Visible = true;
            id = ConvertUtility.ToInt32(Request.QueryString["id"]);
            DataTable dtDetail = MusicController.GetItemDetailHasCache(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"]);
            if (thuchien)
            {
                DataTable dtKhuyenMai = MusicController.GetItemDetailRandom(Session["telco"].ToString(), id);
                string    khuyenmaiID = ConvertUtility.ToString(dtKhuyenMai.Rows[0]["W_MItemID"]);
                lnkKhuyenMai.NavigateUrl = UrlProcess.GetGameDownloadItem(Session["telco"].ToString(), "22", khuyenmaiID, SecurityMethod.MD5Encrypt(khuyenmaiID));
                if (lang == "1")
                {
                    ltrTieuDe.Text    = "ÂM NHẠC";
                    lblTen.Text       = dtDetail.Rows[0]["SongNameUnicode"].ToString();
                    lnkDownload.Text  = Resources.Resource.wBamDeTai;
                    ltrNoiDung.Text   = Resources.Resource.wMuaThanhCong + " bản nhạc " + dtDetail.Rows[0]["SongNameUnicode"].ToString();
                    lnkKhuyenMai.Text = "Nhạc tặng: " + dtKhuyenMai.Rows[0]["SongNameUnicode"].ToString();
                }
                else
                {
                    ltrTieuDe.Text    = "AM NHAC";
                    lblTen.Text       = dtDetail.Rows[0]["SongName"].ToString();
                    lnkDownload.Text  = Resources.Resource.wBamDeTai_KD;
                    ltrNoiDung.Text   = Resources.Resource.wMuaThanhCong_KD + " ban nhac " + dtDetail.Rows[0]["SongName"].ToString();
                    lnkKhuyenMai.Text = "Nhac tang: " + dtKhuyenMai.Rows[0]["SongName"].ToString();
                };
                lnkDownload.NavigateUrl = UrlProcess.GetGameDownloadItem(Session["telco"].ToString(), "22", id.ToString(), SecurityMethod.MD5Encrypt(id.ToString()));

                if (free != true)
                {
                    Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, lnkDownload.NavigateUrl, id.ToString(), chitietGiaodich, 2);
                    MusicController.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, 2, messageReturn);

                //--Thông báo lỗi thanh toán
            }
            //log charging
            if (free != true)
            {
                ILog logger = log4net.LogManager.GetLogger(Session["telco"].ToString());
                logger.Debug("--------------------------------------------------");
                logger.Debug("MSISDN:" + Session["msisdn"].ToString());
                logger.Debug("Dich vu: Am nhac - parameter: " + price + " - Ten: " + dtDetail.Rows[0]["SongName"].ToString() + " - id: " + id);
                logger.Debug("Am nhac Url:" + lnkDownload.NavigateUrl);
                logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress);
                logger.Debug("Error:" + messageReturn);
                logger.Debug("Current Url:" + Request.RawUrl);
            }
            //end log
        }
Ejemplo n.º 29
0
        protected void dgrRolePermission_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            if (e.CommandName == "edit")
            {
                int      role_id    = ConvertUtility.ToInt32(e.Item.Cells[0].Text);
                int      command_id = ConvertUtility.ToInt32(e.Item.Cells[1].Text);
                int      portal_id  = ConvertUtility.ToInt32(e.Item.Cells[2].Text);
                CheckBox chkView    = (CheckBox)e.Item.FindControl("chkView");
                CheckBox chkAdd     = (CheckBox)e.Item.FindControl("chkAdd");
                CheckBox chkUpdate  = (CheckBox)e.Item.FindControl("chkEdit");
                CheckBox chkDelete  = (CheckBox)e.Item.FindControl("chkDelete");
                //CheckBox chkWeb = (CheckBox)e.Item.FindControl("chkWeb");
                //CheckBox chkWap = (CheckBox)e.Item.FindControl("chkWap");
                //CheckBox chkSMS = (CheckBox)e.Item.FindControl("chkSMS");
                //CheckBox chkXzone = (CheckBox)e.Item.FindControl("chkXzone");
                try
                {
                    DataTable dtRoleCommands = CommandController.GetCommandsForRoleByPortalID(role_id, portal_id);
                    DataRow[] rowItems       = dtRoleCommands.Select("CommandParentID = " + command_id);

                    foreach (DataRow row in rowItems)
                    {
                        //RoleController.UpdateRolePermissionByPortalID(ConvertUtility.ToInt32(row["RoleID"]), ConvertUtility.ToInt32(row["CommandID"]), portal_id, true, true, true, true, chkView.Checked, true, true, true);
                        RoleController.UpdateRolePermissionByPortalID(ConvertUtility.ToInt32(row["RoleID"]), ConvertUtility.ToInt32(row["CommandID"]), portal_id, chkView.Checked, true, true, true);
                    }

                    try
                    {
                        //RoleController.UpdateRolePermissionByPortalID(role_id, command_id, portal_id, chkWeb.Checked, chkWap.Checked, chkSMS.Checked, chkXzone.Checked, chkView.Checked, chkAdd.Checked, chkUpdate.Checked, chkDelete.Checked);
                        RoleController.UpdateRolePermissionByPortalID(role_id, command_id, portal_id, chkView.Checked, chkAdd.Checked, chkUpdate.Checked, chkDelete.Checked);
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }

                    lblUpdate1.Text = MiscUtility.MSG_UPDATE_SUCCESS;
                }
                catch (Exception ex)
                {
                    throw ex;
                    //lblUpdateStatus.Text = MiscUtility.MSG_UPDATE_ERROR;
                }
            }
        }
Ejemplo n.º 30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lang  = Request.QueryString["lang"];
            width = ConvertUtility.ToInt32(Request.QueryString["w"]);

            if (!Page.IsPostBack)
            {
                if (width == 0)
                {
                    width = (int)Constant.DefaultScreen.Standard;
                }
                ltrWidth.Text = "<meta content=\"width=" + width + "; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;\" name=\"viewport\" />";

                if (Session["msisdn"] != null)
                {
                    string value = AppEnv.GetRegisterService(Session["msisdn"].ToString(), AppEnv.GetSetting("S2DK_CLIP"));
                    if (value == "1")
                    {
                        pnlSMS.Visible = true;
                        if (lang == "1")
                        {
                            ltrHuongdan.Text = "VIDEO CLIP";
                            ltrSMS.Text      =
                                "Bạn đã là thuê bao của dịch vụ Video Clip tuần. Xin cảm ơn <br/> Để hủy dịch vụ vui lòng SOẠN TIN : <b> HUY CLIP </b> gửi <b>" + AppEnv.GetSetting("S2ShortCode") + "</b>";
                        }
                        else
                        {
                            ltrHuongdan.Text = "VIDEO CLIP";
                            ltrSMS.Text      =
                                "Ban da la thue bao cua dich vu Video Clip tuan. Xin cam on <br/> De huy dich vu vui long SOAN TIN : <b> HUY CLIP </b> gui <b>" + AppEnv.GetSetting("S2ShortCode") + "</b>";
                        }
                    }
                    else
                    {
                        pnlThongBao.Visible = true;
                        if (lang == "1")
                        {
                            ltrThongBao.Text        = "Giới Thiệu";
                            ltrThongBaoNoiDung.Text =
                                "Cung cấp cho bạn những clip hot và nóng hổi nhất. Những thông tin mới, đặc sắc sẽ được truyền tải đến cho bạn hàng ngày. Đăng ký một lần nhận tin mãi mãi  <br/> <b> Đặc biệt miễn phí sử dụng 7 ngày đầu tiên cho khách hàng lần đầu đăng ký </b>";
                        }
                        else
                        {
                            ltrThongBao.Text        = "Gioi Thieu";
                            ltrThongBaoNoiDung.Text =
                                "Cung cap cho ban nhung clip jot va nong hoi nhat. Nhung thong tin moi, dac sac se duoc truyen tai den cho ban hang ngay. Dang ky mot lan nhan tin mai mai <br/> <b> Dac biet mien phi su dung 7 ngay dau tien cho khach hang lan dau dang ky </b>";
                        }
                    }
                }
                else
                {
                    pnlSMS.Visible = true;
                    if (lang == "1")
                    {
                        ltrHuongdan.Text = "Giới Thiệu";
                        ltrSMS.Text      =
                            "Hệ thống không xác định được số điện thoại của bạn. Vui lòng truy cập bằng 3G/GPRS hoặc soạn tin: DK CLIP gửi " + AppEnv.GetSetting("S2ShortCode");
                    }
                    else
                    {
                        ltrHuongdan.Text = "Gioi Thieu";
                        ltrSMS.Text      =
                            "He thong khong xac dinh duoc so dien thoai cua ban. Vui long truy cap bang 3G/GPRS hoac soan tin DK CLIP gui" + AppEnv.GetSetting("S2ShortCode");
                    }
                }
            }
        }