protected void rptlstCategory_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemIndex < 0) { return; } DataRowView curData = (DataRowView)e.Item.DataItem; HyperLink lnkTai = (HyperLink)e.Item.FindControl("lnkTai"); if (lnkTai != null) { if (MobileUtils.CheckValidModel(curData["ModelSupport"].ToString(), _info)) { lnkTai.Text = "<img alt=\"\" src=\"/imagesnew/icon/down.png\" /> " + AppEnv.CheckLang("Tải"); lnkTai.NavigateUrl = UrlProcess.GetGameDownloadUrlNew(lang.ToString(), width, curData["W_GameItemID"].ToString(), hotro); } else { lnkTai.NavigateUrl = ""; lnkTai.Text = AppEnv.CheckLang("Dòng máy không hỗ trợ"); } } if (e.Item.ItemIndex < pagesize - 1) { Literal lit = (Literal)e.Item.FindControl("litBlank"); if (lit != null) { lit.Text = "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"f5f5f5\"><tr><td align=\"left\" valign=\"top\"><img src=\"/imagesnew/blank.gif\" width=\"5\" height=\"9\" /></td></tr></table>"; } } }
//Search App Agent public static DataTable GetAllApp_ItemByKeyAndAgent(string telCo, string strKeySearch, User_AgentInfo _info, int pagesize, int pageIndex, out int totalRecord) { DataCaching data = new DataCaching(); string key = "W4A_Wap_App.GetAllApp_ItemByKeyAndAgent"; string param = "telCo=" + telCo + "&KeySearch=" + strKeySearch + "&info=" + _info.model_name; DataTable dtRetval = (DataTable)data.GetHashCache(key, param); if (dtRetval == null || dtRetval.Rows.Count == 0) { DataTable dtCat = GetAllApp_ItemByKey(telCo, strKeySearch, 9999, 1, out totalRecord); //Xoá những game không hỗ trợ for (int i = 0; i < totalRecord; i++) { if (!MobileUtils.CheckValidModel(dtCat.Rows[i]["ModelSupport"].ToString(), _info)) { dtCat.Rows[i].Delete(); } } dtCat.AcceptChanges(); //Ghi vào cache data.SetHashCache(key, param, GetExpire(), dtCat); dtRetval = dtCat; } totalRecord = dtRetval.Rows.Count; // int vFrom = ((pageIndex - 1) * pagesize); int vTo = pageIndex * pagesize; if (vTo > totalRecord) { vTo = totalRecord; } DataTable dtReturn = dtRetval.Clone(); for (int i = vFrom; i < vTo; i++) { dtReturn.ImportRow(dtRetval.Rows[i]); } return(dtReturn); }
protected void rptDetail_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemIndex < 0) { return; } DataRowView curData = (DataRowView)e.Item.DataItem; HyperLink lnkTai = (HyperLink)e.Item.FindControl("lnkTai"); if (lnkTai != null) { if (MobileUtils.CheckValidModel(curData["ModelSupport"].ToString(), _info)) { lnkTai.Text = "<img alt=\"\" src=\"/imagesnew/icon/down.png\" /> " + AppEnv.CheckLang("Tải"); lnkTai.NavigateUrl = UrlProcess.GetGameDownloadUrlNew(lang.ToString(), width, curData["W_GameItemID"].ToString(), hotro); } else { lnkTai.NavigateUrl = ""; lnkTai.Text = AppEnv.CheckLang("Dòng máy không hỗ trợ"); } } }
public static DataTable GetAllGameByCateTypeAndAgentNoCache(string telCo, int catID, int displayType, User_AgentInfo _info, int pagesize, int pageindex, out int totalrecord) { var dtRetval = new DataTable(); if (dtRetval.Rows.Count == 0) { DataTable dtCat = GetAllGameByCategoryAndDisplayType(telCo, catID, displayType, 9999, 1, out totalrecord); //Xoá những game không hỗ trợ for (int i = 0; i < totalrecord; i++) { if (!MobileUtils.CheckValidModel(dtCat.Rows[i]["ModelSupport"].ToString(), _info)) { dtCat.Rows[i].Delete(); } } dtCat.AcceptChanges(); dtRetval = dtCat; } totalrecord = dtRetval.Rows.Count; // int vFrom = ((pageindex - 1) * pagesize); int vTo = pageindex * pagesize; if (vTo > totalrecord) { vTo = totalrecord; } DataTable dtReturn = dtRetval.Clone(); for (int i = vFrom; i < vTo; i++) { dtReturn.ImportRow(dtRetval.Rows[i]); } return(dtReturn); }
protected void rptlastest_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemIndex < 0) { return; } DataRowView curData = (DataRowView)e.Item.DataItem; System.Web.UI.WebControls.Image imgAvatar = (System.Web.UI.WebControls.Image)e.Item.FindControl("imgAvatar"); HyperLink lnkAvatar = (HyperLink)e.Item.FindControl("lnkAvatar"); HyperLink lnkTenAnh = (HyperLink)e.Item.FindControl("lnkTenAnh"); Literal ltrTheloai = (Literal)e.Item.FindControl("ltrTheloai"); Literal ltrLuottai = (Literal)e.Item.FindControl("ltrLuottai"); HyperLink lnkTai = (HyperLink)e.Item.FindControl("lnkTai"); HyperLink lnkTang = (HyperLink)e.Item.FindControl("lnkTang"); string sGioiThieu; if (lang == 1) { lnkTenAnh.Text = "<span class=\"bold\">" + curData["AppNameUnicode"].ToString() + "</span>"; ltrTheloai.Text = Resources.Resource.wTheLoai + curData["Web_Name"].ToString(); sGioiThieu = curData["DescriptionUnicode"].ToString(); if (sGioiThieu.Length > 120) { sGioiThieu = sGioiThieu.Substring(0, sGioiThieu.LastIndexOf(" ", 110)) + "..."; } ltrLuottai.Text = Resources.Resource.wGioiThieu + sGioiThieu; lnkTai.Text = "<span class=\"orange bold\">" + Resources.Resource.wTai + "</span>"; lnkTang.Text = "<span class=\"orange bold\">" + Resources.Resource.wTang + "</span>"; } else { lnkTenAnh.Text = "<span class=\"bold\">" + curData["AppName"].ToString() + "</span>"; ltrTheloai.Text = Resources.Resource.wTheLoai_KD + UnicodeUtility.UnicodeToKoDau(curData["Web_Name"].ToString()); sGioiThieu = curData["Description"].ToString(); if (sGioiThieu.Length > 120) { sGioiThieu = sGioiThieu.Substring(0, sGioiThieu.LastIndexOf(" ", 110)) + "..."; } ltrLuottai.Text = Resources.Resource.wGioiThieu_KD + sGioiThieu; lnkTai.Text = "<span class=\"orange bold\">" + Resources.Resource.wTai_KD + "</span>"; lnkTang.Text = "<span class=\"orange bold\">" + Resources.Resource.wTang_KD + "</span>"; } lnkTang.NavigateUrl = UrlProcess.GetAppDetailUrl(lang.ToString(), "detail", width, curData["W_AppItemID"].ToString(), hotro.ToString()) + "&g=1"; if (MobileUtils.CheckValidModel(curData["ModelSupport"].ToString(), _info)) { //lnkTai.NavigateUrl = "../Download.aspx?id=" + curData["W_AppItemID"].ToString() + "&lang=" + lang + "&w=" + width; lnkTai.NavigateUrl = UrlProcess.GetAppDownloadUrl(lang.ToString(), width, curData["W_AppItemID"].ToString(), hotro.ToString()); } else { lnkTai.NavigateUrl = ""; if (lang == 1) { lnkTai.Text = Resources.Resource.wKhongHoTro; } else { lnkTai.Text = Resources.Resource.wKhongHoTro_KD; } } lnkAvatar.NavigateUrl = lnkTenAnh.NavigateUrl = UrlProcess.GetAppDetailUrl(lang.ToString(), "detail", width, curData["W_AppItemID"].ToString(), hotro.ToString()); WapXzone_VNM.CreateAvatar.MOReceiver ws = new WapXzone_VNM.CreateAvatar.MOReceiver(); ws.GenerateAvatarThumnail(curData["Avatar"].ToString(), 60, 70); imgAvatar.ImageUrl = preurl + MultimediaUtility.GetAvatarThumnail(curData["Avatar"].ToString(), 60, 70).Replace("~", ""); //imgAvatar.ImageUrl = preurl + curData["Avatar"].ToString().Replace("~", ""); }
protected void rptlstResult_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemIndex < 0) { return; } DataRowView curData = (DataRowView)e.Item.DataItem; Image imgAvatar = (Image)e.Item.FindControl("imgAvatar"); HyperLink lnkAvatar = (HyperLink)e.Item.FindControl("lnkAvatar"); HyperLink lnkTenAnh = (HyperLink)e.Item.FindControl("lnkTenAnh"); Literal ltrTheloai = (Literal)e.Item.FindControl("ltrTheloai"); Literal ltrLuottai = (Literal)e.Item.FindControl("ltrLuottai"); HyperLink lnkTai = (HyperLink)e.Item.FindControl("lnkTai"); string sGioiThieu; if (lang == 1) { lnkTenAnh.Text = curData["GameNameUnicode"].ToString(); ltrTheloai.Text = Resources.Resource.wTheLoai + curData["Web_Name"]; sGioiThieu = curData["DescriptionUnicode"].ToString(); if (sGioiThieu.Length > 120) { sGioiThieu = sGioiThieu.Substring(0, sGioiThieu.LastIndexOf(" ", 110)) + "..."; } ltrLuottai.Text = Resources.Resource.wGioiThieu + sGioiThieu; lnkTai.Text = Resources.Resource.wTai; } else { lnkTenAnh.Text = curData["GameName"].ToString(); ltrTheloai.Text = Resources.Resource.wTheLoai_KD + UnicodeUtility.UnicodeToKoDau(curData["Web_Name"].ToString()); sGioiThieu = curData["Description"].ToString(); if (sGioiThieu.Length > 120) { sGioiThieu = sGioiThieu.Substring(0, sGioiThieu.LastIndexOf(" ", 110)) + "..."; } ltrLuottai.Text = Resources.Resource.wGioiThieu_KD + sGioiThieu; lnkTai.Text = Resources.Resource.wTai_KD; } if (MobileUtils.CheckValidModel(curData["ModelSupport"].ToString(), _info)) { lnkTai.NavigateUrl = UrlProcess.GetGameDownloadUrlNew(lang.ToString(), width, curData["W_GameItemID"].ToString(), hotro.ToString()); validGame += 1; } else { lnkTai.NavigateUrl = ""; if (lang == 1) { lnkTai.Text = Resources.Resource.wKhongHoTro; } else { lnkTai.Text = Resources.Resource.wKhongHoTro_KD; } } lnkAvatar.NavigateUrl = lnkTenAnh.NavigateUrl = UrlProcess.GetGameDetailUrlNew(lang.ToString(), "detail", width, curData["W_GameItemID"].ToString(), hotro.ToString()); WapXzone_VNM.CreateAvatar.MOReceiver ws = new WapXzone_VNM.CreateAvatar.MOReceiver(); ws.GenerateAvatarThumnail(curData["Avatar"].ToString(), 36, 48); imgAvatar.ImageUrl = preurl + MultimediaUtility.GetAvatarThumnail(curData["Avatar"].ToString(), 36, 48).Replace("~", ""); }
protected void rptlstCategory_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemIndex < 0) { return; } if (e.Item.ItemIndex < pagesize - 1) { Literal lit = (Literal)e.Item.FindControl("litBlank"); lit.Text = "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"f5f5f5\"><tr><td align=\"left\" valign=\"top\"><img alt=\"\" src=\"/imagesnew/blank.gif\" width=\"5\" height=\"9\" /></td></tr></table>"; } DataRowView curData = (DataRowView)e.Item.DataItem; Image imgAvatar = (Image)e.Item.FindControl("imgAvatar"); HyperLink lnkAvatar = (HyperLink)e.Item.FindControl("lnkAvatar"); HyperLink lnkTenAnh = (HyperLink)e.Item.FindControl("lnkTenAnh"); Literal ltrTheloai = (Literal)e.Item.FindControl("ltrTheloai"); HyperLink lnkTai = (HyperLink)e.Item.FindControl("lnkTai"); string sGioiThieu; if (lang == 1) { lnkTenAnh.Text = curData["AppNameUnicode"].ToString(); ltrTheloai.Text = Resources.Resource.wTheLoai + curData["Web_Name"]; sGioiThieu = curData["DescriptionUnicode"].ToString(); if (sGioiThieu.Length > 120) { sGioiThieu = sGioiThieu.Substring(0, sGioiThieu.LastIndexOf(" ", 110)) + "..."; } lnkTai.Text = Resources.Resource.wTai; } else { lnkTenAnh.Text = curData["AppName"].ToString(); ltrTheloai.Text = Resources.Resource.wTheLoai_KD + UnicodeUtility.UnicodeToKoDau(curData["Web_Name"].ToString()); sGioiThieu = curData["Description"].ToString(); if (sGioiThieu.Length > 120) { sGioiThieu = sGioiThieu.Substring(0, sGioiThieu.LastIndexOf(" ", 110)) + "..."; } lnkTai.Text = Resources.Resource.wTai_KD; } if (MobileUtils.CheckValidModel(curData["ModelSupport"].ToString(), _info)) { lnkTai.NavigateUrl = UrlProcess.GetAppDownloadUrlNew(lang.ToString(), width, curData["W_AppItemID"].ToString(), hotro.ToString()); } else { lnkTai.NavigateUrl = ""; if (lang == 1) { lnkTai.Text = Resources.Resource.wKhongHoTro; } else { lnkTai.Text = Resources.Resource.wKhongHoTro_KD; } } lnkAvatar.NavigateUrl = lnkTenAnh.NavigateUrl = UrlProcess.GetAppDetailUrlNew(lang.ToString(), "detail", width, curData["W_AppItemID"].ToString(), hotro.ToString()); WapXzone_VNM.CreateAvatar.MOReceiver ws = new WapXzone_VNM.CreateAvatar.MOReceiver(); ws.GenerateAvatarThumnail(curData["Avatar"].ToString(), 36, 48); imgAvatar.ImageUrl = preurl + MultimediaUtility.GetAvatarThumnail(curData["Avatar"].ToString(), 36, 48).Replace("~", ""); }
protected void Page_Load(object sender, EventArgs e) { preurl = ConfigurationSettings.AppSettings.Get("urldata"); width = Request.QueryString["w"]; hotro = ConvertUtility.ToInt32(Request.QueryString["hotro"]).ToString(); lang = ConvertUtility.ToInt32(Request.QueryString["lang"]); id = ConvertUtility.ToInt32(Request.QueryString["id"]); if (!IsPostBack) { _info = Get_User_Agent_Info(); if (ConvertUtility.ToInt32(Request.QueryString["g"]) == 1) { txtSoDienThoaiTang.Focus(); } //Detail DataTable dtDetail = PhanmemController.GetAPPDetailByIDHasCache(Session["telco"].ToString(), id); //end detail if (dtDetail.Rows.Count > 0) { price = ConfigurationSettings.AppSettings.Get("Appprice"); if (dtDetail.Rows[0]["Web_Name"].ToString() == "Vmg_zone") { price = "1000"; } lnkCateChannel.NavigateUrl = UrlProcess.GetAppCategoryUrl(lang.ToString(), width, dtDetail.Rows[0]["W_AppCategoryID"].ToString(), hotro); lnkHomeChannel.NavigateUrl = UrlProcess.GetAppHomeUrl(lang.ToString(), width, hotro); if (lang == 1) { lnkHomeChannel.Text = "PHẦN MỀM"; lnkCateChannel.Text = dtDetail.Rows[0]["Title_Unicode"].ToString().ToUpper(); ltrTenAnh.Text = dtDetail.Rows[0]["AppNameUnicode"].ToString(); ltrNhom.Text = Resources.Resource.wTheLoai + dtDetail.Rows[0]["Web_Name"].ToString(); ltrLuottai.Text = Resources.Resource.wLuotTai + dtDetail.Rows[0]["Download"].ToString().ToUpper(); //ltrGiaTai.Text = Resources.Resource.wGiaTai + price + Resources.Resource.wDonViTien; //ltrGiaTang.Text = Resources.Resource.wGiaTang + price + Resources.Resource.wDonViTien; ltrGioiThieu.Text = Resources.Resource.wGioiThieu + dtDetail.Rows[0]["DescriptionUnicode"].ToString(); lnkTai.Text = "<span class=\"bold\">" + Resources.Resource.wTaiVe + "</span>"; ltrGuiTang.Text = Resources.Resource.wGuiTang; ltrCungTheLoai.Text = Resources.Resource.pmPhanMemCungTheLoai; } else { lnkCateChannel.Text = dtDetail.Rows[0]["Title"].ToString().ToUpper(); ltrTenAnh.Text = dtDetail.Rows[0]["AppName"].ToString(); ltrNhom.Text = Resources.Resource.wTheLoai_KD + UnicodeUtility.UnicodeToKoDau(dtDetail.Rows[0]["Web_Name"].ToString()); ltrLuottai.Text = Resources.Resource.wLuotTai_KD + dtDetail.Rows[0]["Download"].ToString().ToUpper(); //ltrGiaTai.Text = Resources.Resource.wGiaTai_KD + price + Resources.Resource.wDonViTien_KD; //ltrGiaTang.Text = Resources.Resource.wGiaTang_KD + price + Resources.Resource.wDonViTien_KD; ltrGioiThieu.Text = Resources.Resource.wGioiThieu_KD + dtDetail.Rows[0]["Description"].ToString(); lnkTai.Text = "<span class=\"bold\">" + Resources.Resource.wTaiVe_KD + "</span>"; ltrGuiTang.Text = Resources.Resource.wGuiTang_KD; ltrCungTheLoai.Text = Resources.Resource.pmPhanMemCungTheLoai_KD; } if (MobileUtils.CheckValidModel(dtDetail.Rows[0]["ModelSupport"].ToString(), _info)) { //lnkTai.NavigateUrl = "../Download.aspx?id=" + dtDetail.Rows[0]["W_AppItemID"].ToString() + "&lang=" + lang + "&w=" + width; lnkTai.NavigateUrl = UrlProcess.GetAppDownloadUrl(lang.ToString(), width, dtDetail.Rows[0]["W_AppItemID"].ToString(), hotro); } else { lnkTai.Visible = false; } WapXzone_VNM.CreateAvatar.MOReceiver ws = new WapXzone_VNM.CreateAvatar.MOReceiver(); ws.GenerateAvatarThumnail(dtDetail.Rows[0]["Avatar"].ToString(), 120, 141); imgDetail.ImageUrl = preurl + MultimediaUtility.GetAvatarThumnail(dtDetail.Rows[0]["Avatar"].ToString(), 120, 141).Replace("~", ""); //imgDetail.ImageUrl = preurl + dtDetail.Rows[0]["Avatar"].ToString().Replace("~", ""); //Other if (!string.IsNullOrEmpty(Request.QueryString["tpage"])) { tpage = ConvertUtility.ToInt32(Request.QueryString["tpage"]); } int totaltopdownload = 0; DataTable dtltopdownload = PhanmemController.GetAllAppByCategoryAndDisplayTypeHasCache(Session["telco"].ToString(), ConvertUtility.ToInt32(dtDetail.Rows[0]["W_AppCategoryID"]), 0, pagesize, tpage, out totaltopdownload); rptCungTheLoai.DataSource = dtltopdownload; rptCungTheLoai.ItemDataBound += new RepeaterItemEventHandler(rptCungTheLoai_ItemDataBound); rptCungTheLoai.DataBind(); Paging1.totalrecord = totaltopdownload; Paging1.pagesize = pagesize; Paging1.numberpage = pagenumber; Paging1.defaultparam = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&id=" + Request.QueryString["id"]; Paging1.queryparam = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&id=" + Request.QueryString["id"] + "&tpage="; } } }