Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["LastPage"] = Request.RawUrl;
            lang  = Request.QueryString["lang"];
            width = ConvertUtility.ToInt32(Request.QueryString["w"]);
            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\" />";
            }
            if (string.IsNullOrEmpty(Request.QueryString["display"]))
            {
                display = "home";
            }
            else
            {
                display = Request.QueryString["display"];
            }
            switch (display)
            {
            case "home":
                plContent.Controls.Add(LoadControl("UserControl/LotHome.ascx"));
                break;

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

            case "detail":
                plContent.Controls.Add(LoadControl("UserControl/Detail.ascx"));
                break;

            case "byday":
                plContent.Controls.Add(LoadControl("UserControl/ByDay.ascx"));
                break;
            }
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                int catID = ConvertUtility.ToInt32(Request.QueryString["catid"]);
                _info = Get_User_Agent_Info();

                string CatName = string.Empty;

                DataTable catInfo = GameController.GetCategoryByCatIDHasCache(catID);
                if (catInfo != null && catInfo.Rows.Count > 0)
                {
                    CatName = catInfo.Rows[0]["Title_Unicode"].ToString().ToUpper();
                    lblCategoryName.Text = CatName;
                }

                if (!string.IsNullOrEmpty(Request.QueryString["cpage"]))
                {
                    curpage = ConvertUtility.ToInt32(Request.QueryString["cpage"]);
                }

                int totalrecord = 0;
                var dt          = new DataTable();
                dt = GameController.GetAllGameByCateTypeAndAgent(AppEnv.CheckSessionTelco(), catID, (int)Constant.Game.Category, _info, pagesize, curpage, out totalrecord);
                if (dt.Rows.Count == 0)
                {
                    dt = GameController.GetAllGameByCategoryAndDisplayTypeHasCache(AppEnv.CheckSessionTelco(), catID, (int)Constant.Game.Category, pagesize, curpage, out totalrecord);
                }

                rptGameHay.DataSource = dt;
                rptGameHay.DataBind();

                Paging1.totalrecord = totalrecord;
                Paging1.pagesize    = pagesize;
                Paging1.numberpage  = pagenumber;

                Paging1.defaultparam = UrlProcess.GameChuyenMuc(catID, curpage, CatName);
                Paging1.queryparam   = UrlProcess.GameChuyenMuc(catID, curpage, CatName);
            }
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            preurl   = ConfigurationSettings.AppSettings.Get("urldata");
            width    = Request.QueryString["w"];
            key      = Request.QueryString["key"];
            parentid = ConvertUtility.ToInt32(ConfigurationSettings.AppSettings.Get("news_zoneid"));
            if (!IsPostBack)
            {
                lang = ConvertUtility.ToInt32(Request.QueryString["lang"]);
                if (lang == 1)
                {
                    lblTitle.Text = "Kết quả tìm kiếm";
                }
            }
            if (!string.IsNullOrEmpty(Request.QueryString["cpage"]))
            {
                curpage = ConvertUtility.ToInt32(Request.QueryString["cpage"]);
            }
            //start category list
            int       totalrecord = 0;
            DataTable dtCat       = TintucController.GetAllNewsByKey(key, pagesize, curpage, out totalrecord, parentid);

            rptResult.DataSource     = dtCat;
            rptResult.ItemDataBound += new RepeaterItemEventHandler(rptResult_ItemDataBound);
            rptResult.DataBind();
            Paging1.totalrecord  = totalrecord;
            Paging1.pagesize     = pagesize;
            Paging1.numberpage   = pagenumber;
            Paging1.defaultparam = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&catid=" + Request.QueryString["catid"] + "&key=" + Request.QueryString["key"] + "&id=" + Request.QueryString["id"];
            Paging1.queryparam   = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&catid=" + Request.QueryString["catid"] + "&key=" + Request.QueryString["key"] + "&id=" + Request.QueryString["id"] + "&cpage=";
            //end category list
            if (lang == 1)
            {
                ltrCount.Text = "Tìm thấy " + totalrecord + " bài";
            }
            else
            {
                ltrCount.Text = "Tim thay " + totalrecord + " bai";
            }
        }
        protected void btnXem_Click(object sender, EventArgs e)
        {
            string strNgaySinh = txtNgay.Text.Trim() + "/" + txtThang.Text.Trim() + "/" + txtNam.Text.Trim();

            try
            {
                DateTime  dateValue = DateTime.Parse(strNgaySinh, new CultureInfo("fr-FR", false));
                DataTable dt        = TuViController.Horoscope_Get4Wap(ConvertUtility.ToInt32(ddlGioitinh.SelectedValue), strNgaySinh);
                if (dt == null)
                {
                    if (lang == 1)
                    {
                        lblThongbao.Text = "Dữ liệu về ngày sinh chưa được cập nhật. Vui lòng thử lại sau!";
                    }
                    else
                    {
                        lblThongbao.Text = "Du lieu ve ngay sinh chua duoc cap nhat. Vui long thu lai sau!";
                    }
                    lblThongbao.Visible = true;
                    return;
                }
                else
                {
                    string content = cpid + "&" + Constant.hoangdao + "9" + dt.Rows[0]["ID"].ToString() + "&" + ConfigurationSettings.AppSettings.Get("tuviprice") + "&" + vmstransactionid;
                    Response.Redirect(ConfigurationSettings.AppSettings.Get("vms3g") + "?link=" + Server.UrlEncode(EAS.EncryptData(content, ConfigurationSettings.AppSettings.Get("vmskey"))));
                }
            }
            catch
            {
                if (lang == 1)
                {
                    lblThongbao.Text = "Thông tin ngày sinh bạn nhập không chính xác. Vui lòng nhập lại!";
                }
                else
                {
                    lblThongbao.Text = "Thong tin ngay sinh ban nhap khong chinh xac. Vui long nhap lai!";
                }
                lblThongbao.Visible = true;
            }
        }
Exemple #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            preurl = ConfigurationSettings.AppSettings.Get("urldata");
            width  = Request.QueryString["w"];
            lang   = ConvertUtility.ToInt32(Request.QueryString["lang"]);
            catID  = ConvertUtility.ToInt32(Request.QueryString["catid"]);

            if (!IsPostBack)
            {
                DataTable catInfo = VideoController.GetCategoryByCatIDHasCache(catID);
                if (lang == 1)
                {
                    lnkCateChannel.Text = catInfo.Rows[0]["Title_Unicode"].ToString().ToUpper();
                }
                else
                {
                    lnkCateChannel.Text = catInfo.Rows[0]["Title"].ToString().ToUpper();
                }
                lnkCateChannel.NavigateUrl = UrlProcess.GetVideoCategoryUrl(lang.ToString(), width, catID.ToString());
                lnkHomeChannel.NavigateUrl = UrlProcess.GetVideoHomeUrl(lang.ToString(), width);
            }

            if (!string.IsNullOrEmpty(Request.QueryString["cpage"]))
            {
                curpage = ConvertUtility.ToInt32(Request.QueryString["cpage"]);
            }
            //start category list
            int       totalrecord = 0;
            DataTable dtCat       = VideoController.GetAllVideoByCategoryAndDisplayTypeHasCache(Session["telco"].ToString(), catID, -1, (int)Constant.Video.Category, pagesize, curpage, out totalrecord);

            rptlstCategory.DataSource     = dtCat;
            rptlstCategory.ItemDataBound += new RepeaterItemEventHandler(rptlstCategory_ItemDataBound);
            rptlstCategory.DataBind();
            Paging1.totalrecord  = totalrecord;
            Paging1.pagesize     = pagesize;
            Paging1.numberpage   = pagenumber;
            Paging1.defaultparam = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&catid=" + Request.QueryString["catid"];
            Paging1.queryparam   = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&catid=" + Request.QueryString["catid"] + "&cpage=";
            //end category list
        }
        public Literal GetNewAds(DataRow curData)
        {
            using (var retVal = new Literal())
            {
                string width  = curData["Advertise_Width"].ToString();
                string height = curData["Advertise_Height"].ToString();
                if (ConvertUtility.ToInt32(width) == -1)
                {
                    width = "99%";
                }

                string path = AppEnv.GetSetting("urldata") + "/" + curData["Advertise_Path"];
                switch (curData["Advertise_Type"].ToString())
                {
                case "image":
                {
                    string link = curData["Advertise_RedirectURL"].ToString();
                    if (link.IndexOf("?") > 0)
                    {
                        link += "&lang=" + Lang + "&w=" + Width;
                    }
                    else
                    {
                        link += "?lang=" + Lang + "&w=" + Width;
                    }

                    retVal.Text  = "<a href=\"" + link + "\"><img border=0 ";
                    retVal.Text += "src=\"" + path + "\" ";
                    retVal.Text += "width=\"" + width + "\" ";
                    if (width != "99%")
                    {
                        retVal.Text += "height=\"" + height + "\">";
                    }
                    retVal.Text += "</img></a>";
                }
                break;
                }
                return(retVal);
            }
        }
Exemple #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            width    = Request.QueryString["w"];
            lang     = ConvertUtility.ToInt32(Request.QueryString["lang"]).ToString();
            artistID = Request.QueryString["id"].ToString();

            if (!string.IsNullOrEmpty(Request.QueryString["cpage"]))
            {
                curpage = ConvertUtility.ToInt32(Request.QueryString["cpage"]);
            }
            //start category list
            int       totalrecord = 0;
            DataTable dtCat       = MusicController.GetItemByArtistHasCache(Session["telco"].ToString(), artistID, curpage, pagesize, out totalrecord);

            rptlstCategory.DataSource     = dtCat;
            rptlstCategory.ItemDataBound += new RepeaterItemEventHandler(rptlstCategory_ItemDataBound);
            rptlstCategory.DataBind();
            Paging1.totalrecord  = totalrecord;
            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"] + "&cpage=";
            if (!IsPostBack)
            {
                DataTable ArtistInfo = MusicController.GetArtistByIDHasCache(artistID);
                if (ArtistInfo.Rows.Count > 0)
                {
                    if (lang == "1")
                    {
                        ltrArtistName.Text = "<span class=\"bold\" style=\"color:#B200B2;\">" + ArtistInfo.Rows[0]["ArtistNameUnicode"].ToString() + "</span>";
                        ltrSobai.Text      = Resources.Resource.wSoBai + totalrecord.ToString();
                    }
                    else
                    {
                        ltrArtistName.Text = "<span class=\"bold\" style=\"color:#B200B2;\">" + ArtistInfo.Rows[0]["ArtistName"].ToString() + "</span>";
                        ltrSobai.Text      = Resources.Resource.wSoBai_KD + totalrecord.ToString();
                    }
                }
            }
        }
Exemple #8
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");
                var litTeaser = (Literal)e.Item.FindControl("litTeaser");

                var distid = ConvertUtility.ToInt32(curData["Distribution_ID"]);

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

                litTeaser.Text = curData["Content_Teaser"].ToString();

                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(MultimediaUtility.GetOriginalImage(avatar), 224, 0);
                    }
                    else
                    {
                        imgAvatar.Visible = false;
                    }
                }
                else
                {
                    imgAvatar.Visible = false;
                }

                SessionUtility.Remove("excludeid");

                SessionUtility.SetValue("excludeid", distid.ToString());
            }
        }
        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 urlGet = Request.RawUrl;

            string[] arrUrl = urlGet.Split('/');
            string   url    = UrlProcess.HinhNenChuyenMuc(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>";
                }
            }
        }
Exemple #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                catID = ConvertUtility.ToInt32(Request.QueryString["catid"]);
                int totalrecord = 0;

                if (!string.IsNullOrEmpty(Request.QueryString["cpage"]))
                {
                    curpage = ConvertUtility.ToInt32(Request.QueryString["cpage"]);
                }

                DataTable dtCat;
                if (catID == 4)
                {
                    dtCat = HinhNenController.GetAllWallpaperByCategoryAndDisplayTypeHasCache(AppEnv.CheckSessionTelco(), 4, (int)Constant.HinhNen.Topdownload, pagesize, curpage, out totalrecord);
                }
                else
                {
                    dtCat = HinhNenController.GetAllWallpaperByCategoryAndDisplayTypeHasCache(AppEnv.CheckSessionTelco(), catID, (int)Constant.HinhNen.Category, pagesize, curpage, out totalrecord);
                }



                if (dtCat != null && dtCat.Rows.Count > 0)
                {
                    string catName = dtCat.Rows[0]["Web_Name"].ToString();

                    rptList.DataSource = dtCat;
                    rptList.DataBind();

                    Paging1.totalrecord = totalrecord;
                    Paging1.pagesize    = pagesize;
                    Paging1.numberpage  = pagenumber;

                    Paging1.defaultparam = UrlProcess.HinhNenChuyenMuc(catID, curpage, catName);
                    Paging1.queryparam   = UrlProcess.HinhNenChuyenMuc(catID, curpage, catName);
                }
            }
        }
Exemple #11
0
        protected void dtgUsers_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                Button btnDanhGiaTruongPhong = (Button)e.Row.FindControl("btnDanhGiaTBP");

                Label lblTrangThai = (Label)e.Row.FindControl("lblTrangThai");

                DataRowView curData = (DataRowView)e.Row.DataItem;

                lblTrangThai.Text = GetTrangThai(ConvertUtility.ToInt32(curData["TrangThai"]));

                if (e.Row.RowState == DataControlRowState.Alternate)
                {
                    e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#EEFF00';");
                    e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#f7fff8';");
                }
                else
                {
                    e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#EEFF00';");
                    e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#eefef0';");
                }

                if (CurrentUser.RoleID != (int)Constants.Role.CEO && !CurrentUser.IsAdmin && !CurrentUser.IsSuperAdmin)
                {
                    UserInfo info = UserController.GetUser(ConvertUtility.ToInt32(curData["UserID"].ToString()));

                    if (info != null)
                    {
                        if (info.IDTrungTam != CurrentUser.IDTrungTam)
                        {
                            btnDanhGiaTruongPhong.Visible = false;
                        }
                    }
                }

                string url = "window.open('" + AppEnv.AdminUrlParams("dg_tpvapp_ht") + "&idDotDanhGia=" + idDotDanhGia + "&idNhanVien=" + curData["UserID"].ToString() + "','_self'); return false;";
                btnDanhGiaTruongPhong.OnClientClick = url;
            }
        }
Exemple #12
0
        public static ImageInfo GetCover(int contentId)
        {
            ImageInfo retVal = null;
            var       dbConn = new SqlConnection(AppEnv.ConnectionString);
            var       dbCmd  = new SqlCommand("CMS_Images_GetCover", dbConn)
            {
                CommandType = CommandType.StoredProcedure
            };

            dbCmd.Parameters.AddWithValue("@Content_ID", contentId);
            try
            {
                dbConn.Open();
                var dr = dbCmd.ExecuteReader();
                if (dr.Read())
                {
                    retVal                   = new ImageInfo();
                    retVal.Image_ID          = ConvertUtility.ToInt32(dr["Image_ID"]);
                    retVal.Image_Name        = ConvertUtility.ToString(dr["Image_Name"]);
                    retVal.Image_Description = ConvertUtility.ToString(dr["Image_Description"]);
                    retVal.Image_File        = ConvertUtility.ToString(dr["Image_File"]);
                    retVal.Image_CreateDate  = ConvertUtility.ToDateTime(dr["Image_CreateDate"]);
                    retVal.Image_FileSize    = ConvertUtility.ToDouble(dr["Image_FileSize"]);
                    retVal.Image_Width       = ConvertUtility.ToInt32(dr["Image_Width"]);
                    retVal.Image_Height      = ConvertUtility.ToInt32(dr["Image_Height"]);
                    retVal.Image_View        = ConvertUtility.ToInt32(dr["Image_View"]);
                    retVal.User_ID           = ConvertUtility.ToInt32(dr["User_ID"]);
                    retVal.Image_Visible     = ConvertUtility.ToBoolean(dr["Image_Visible"]);
                }
                if (dr != null)
                {
                    dr.Close();
                }
            }
            finally
            {
                dbConn.Close();
            }
            return(retVal);
        }
        protected void dgrUserRole_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            if (e.CommandName == "edit")
            {
                int      user_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 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, true, true, true, true, 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;
                    }
                    lblUpdateStatus.Text = MiscUtility.MSG_UPDATE_SUCCESS;
                }
                catch
                {
                    lblUpdateStatus.Text = MiscUtility.MSG_UPDATE_ERROR;
                }
            }
        }
Exemple #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            width   = Request.QueryString["w"];
            lang    = ConvertUtility.ToInt32(Request.QueryString["lang"]).ToString();
            StyleID = Request.QueryString["id"];

            if (!string.IsNullOrEmpty(Request.QueryString["cpage"]))
            {
                curpage = ConvertUtility.ToInt32(Request.QueryString["cpage"]);
            }
            //start category list
            int       totalrecord = 0;
            DataTable dtCat       = MusicController.GetItemByStyleHasCache(Session["telco"].ToString(), StyleID, curpage, pagesize, out totalrecord);

            rptlstCategory.DataSource     = dtCat;
            rptlstCategory.ItemDataBound += rptlstCategory_ItemDataBound;
            rptlstCategory.DataBind();
            Paging1.totalrecord  = totalrecord;
            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"] + "&cpage=";
            if (!IsPostBack)
            {
                DataTable StyleInfo = MusicController.GetStyleByIDHasCache(StyleID);
                if (StyleInfo.Rows.Count > 0)
                {
                    if (lang == "1")
                    {
                        ltrStyleName.Text = StyleInfo.Rows[0]["StyleNameUnicode"].ToString();
                        ltrSobai.Text     = Resources.Resource.wSoBai + totalrecord;
                    }
                    else
                    {
                        ltrStyleName.Text = StyleInfo.Rows[0]["StyleName"].ToString();
                        ltrSobai.Text     = Resources.Resource.wSoBai_KD + totalrecord;
                    }
                }
            }
        }
Exemple #15
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            DataTable dt = PhongBanController.GetAll(ConvertUtility.ToInt32(dropTrungTamSearch.SelectedValue));

            PhongBanController.LoadPhongBan(dropParent.Items, ConvertUtility.ToInt32(dropTrungTam.SelectedValue));
            dropParent.Items.Insert(0, new ListItem("Root", "0"));

            int id = ConvertUtility.ToInt32(Request.QueryString["idPhong"]);

            if (id > 0)
            {
                PhongBanInfo info = PhongBanController.GetInfo(id);

                if (info != null)
                {
                    dropTrungTam.SelectedValue = info.IDTrungTam.ToString();
                    txtTen.Text     = info.Ten;
                    txtMoTa.Text    = info.MoTa;
                    txtTyTrong.Text = info.TyTrong.ToString();
                    dropTruongPhongBan.SelectedValue = info.IDNhanVienTruongPhong.ToString();
                    try
                    {
                        dropParent.SelectedValue = info.IDParent.ToString();
                    }
                    catch
                    {
                        dropParent.SelectedIndex = -1;
                    }
                }
            }
            else
            {
                btnUpdate.Visible = false;
            }

            dgrPhongBan.DataSource = dt;
            dgrPhongBan.DataBind();
        }
        protected void dtgWaitingDeployList_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemIndex < 0)
            {
                return;
            }
            //DataRowView rowData = (DataRowView)e.Item.DataItem;
            HyperLink lnkHeadline = (HyperLink)e.Item.FindControl("lnkHeadline");
            int       contentid   = ConvertUtility.ToInt32(e.Item.Cells[0].Text);

            lnkHeadline.Text        = ContentDB.GetName(contentid);
            lnkHeadline.NavigateUrl = AppEnv.ADMIN_CMD + "cmsviewcontent&contentid=" + e.Item.Cells[0].Text;
            lnkHeadline.ToolTip     = ContentDB.GetAuthorInfoByContentID(contentid);
            Button cmdDeploy = (Button)e.Item.FindControl("cmdDeploy");
            Button cmdReturn = (Button)e.Item.FindControl("cmdReturn");

            if (!isManager && !isDeployer)
            {
                cmdDeploy.Enabled = false;
                cmdReturn.Enabled = false;
            }
        }
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            DataTable dtUsers;

            if (CurrentUser.IsAdmin || CurrentUser.IsSuperAdmin)
            {
                dtUsers = CommonController.BaoCaoTienDoThucHienDanhGiaThang(ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue), ConvertUtility.ToInt32(dropTrungTam.SelectedValue), ConvertUtility.ToInt32(dropChucVu.SelectedValue), ConvertUtility.ToInt32(dropTrangThai.SelectedValue), ConvertUtility.ToInt32(dropPhongBan.SelectedValue));
            }
            else
            {
                dtUsers = CommonController.BaoCaoTienDoThucHienDanhGiaThang(ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue), ConvertUtility.ToInt32(dropTrungTam.SelectedValue), ConvertUtility.ToInt32(dropChucVu.SelectedValue), ConvertUtility.ToInt32(dropTrangThai.SelectedValue), ConvertUtility.ToInt32(dropPhongBan.SelectedValue), CurrentUser.UserID);
            }

            //-------sort----------
            DataView dv = new DataView(dtUsers);

            if (ViewState["sortExpression"] != null && ViewState["sortExpression"].ToString() != string.Empty)
            {
                dv.Sort = ViewState["sortExpression"].ToString();
            }


            if (ViewState["sortDirection"] != null && ViewState["sortDirection"].ToString() == "Desc")
            {
                dv.Sort = ViewState["sortExpression"].ToString() + " " + ViewState["sortDirection"].ToString();
            }
            //--------sort-------------

            dtgUsers.DataSource    = dv;
            dtgUsers.RowDataBound += new GridViewRowEventHandler(dtgUsers_RowDataBound);
            dtgUsers.DataBind();

            if (dtUsers != null)
            {
                lblTotalTop.Text = lblTotalBottom.Text = dtUsers.Rows.Count.ToString();
            }
        }
Exemple #18
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 litTeaser   = (Literal)e.Item.FindControl("litTeaser");
                var litDatetime = (Literal)e.Item.FindControl("litDatetime");
                //var lnkAvatar = (HyperLink)e.Item.FindControl("lnkAvatar");
                var imgAvatar = (Image)e.Item.FindControl("imgAvatar");

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

                litTeaser.Text = curData["Content_Teaser"].ToString();

                var newstime = ConvertUtility.ToDateTime(curData["Distribution_CreateDate"]);
                litDatetime.Text = newstime.Day + " tháng " + newstime.Month + " năm" + newstime.Year;

                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, 120, 0);
                    }
                    else
                    {
                        imgAvatar.Visible = false;
                    }
                }
                else
                {
                    imgAvatar.Visible = false;
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                int userId = ConvertUtility.ToInt32(Request.QueryString["uid"]);

                if (userId == 0)
                {
                    //tabLyLichCaNhan.Enabled = true;
                }
                else
                {
                    //tabThongTinMoRong.Enabled = true;
                    //tabThongTinGiaDinh.Enabled = true;
                    //tabHocVan.Enabled = true;
                    //tabQuaTrinhLamViec.Enabled = true;
                    //tabHopDongLaoDong.Enabled = true;
                    //tabHopDongLaoDongGiaHan3.Enabled = true;
                    //tabDieuChinhNhanSu.Enabled = true;
                }
            }
        }
        private static void LoadForCurItem(DataTable lstItems, DataRow curItem, int ParentID, int LevelDeep)
        {
            int level = ConvertUtility.ToInt32(curItem["LevelDeep"]);

            level++;
            QuanLyCongViecKTXVaPSInfo info = QuanLyCongViecKTXVaPSController.GetInfo(ParentID);

            if (info == null)
            {
                return;
            }

            DataRow item = lstItems.NewRow();

            item["Ten"]           = info.Ten;
            item["ParentID"]      = info.ParentID;
            item["LevelDeep"]     = level;
            item["IDCongViecKPI"] = info.ID;
            lstItems.Rows.Add(item);

            LoadForCurItem(lstItems, item, info.ParentID, info.LevelDeep);
        }
Exemple #21
0
        protected void butUpdateAll_Click(object sender, EventArgs e)
        {
            try
            {
                foreach (DataGridItem item in dtgOrder.Items)
                {
                    int         id   = ConvertUtility.ToInt32(item.Cells[0].Text);
                    HocsinhInfo info = HocsinhDB.GetInfo(id);

                    var chkIsLearning = (CheckBox)item.FindControl("chkIsLearning");

                    info.Hocsinh_IsLearning = ConvertUtility.ToBoolean(chkIsLearning.Checked);

                    HocsinhDB.Update(info);
                }
                lblUpdateStatus.Text = MiscUtility.UPDATE_SUCCESS;
            }
            catch
            {
                lblUpdateStatus.Text = MiscUtility.UPDATE_ERROR; //ex.ToString();
            }
        }
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         RoleInfo role = new RoleInfo();
         role.RoleName        = txtRoleName.Text;
         role.RoleDescription = txtRoleDescription.Text;
         role.Address         = txtAddress.Text;
         role.Phone           = txtPhone.Text;
         role.Fax             = txtFax.Text;
         role.Email           = txtEmail.Text;
         role.UserManager     = ConvertUtility.ToInt32(dropUserManager.SelectedValue);
         role.RoleParentID    = ConvertUtility.ToInt32(dropRoleParentID.SelectedValue);
         RoleController.AddRole(role);
         lblUpdate.Text = MiscUtility.MSG_UPDATE_SUCCESS;
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
     }
     btnCancel_Click(null, null);
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            lang  = ConvertUtility.ToInt32(Request.QueryString["lang"]).ToString();
            width = Request.QueryString["w"];
            DataTable cpConfig = WapController.Setting_Category_GetAllByParentIDHasCache(0, 74);

            if (lang == "1")
            {
                ltrNhom.Text     = cpConfig.Rows[0]["WAP_CategoryTitleUnicode"].ToString();
                lnkTrangChu.Text = "<span class=\"pink bold\">" + Resources.Resource.wTrangChu + "</span>";
            }
            else
            {
                ltrNhom.Text     = cpConfig.Rows[0]["WAP_CategoryTitle"].ToString();
                lnkTrangChu.Text = "<span class=\"pink bold\">" + Resources.Resource.wTrangChu_KD + "</span>";
            }
            lnkTrangChu.NavigateUrl = UrlProcess.GetWapHomeUrl(lang, width);
            //
            rptLienket.DataSource     = WapController.CPConfig_GetByWap_IDHasCache((int)cpConfig.Rows[0]["WAP_ID"]);
            rptLienket.ItemDataBound += new RepeaterItemEventHandler(rptLienket_ItemDataBound);
            rptLienket.DataBind();
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         lang   = ConvertUtility.ToInt32(Request.QueryString["lang"]).ToString();
         width  = Request.QueryString["w"];
         preurl = AppEnv.GetSetting("urldata");
         DataTable dt = HinhNenController.GetAllCategoryExeptCatIDHasCache(Session["telco"].ToString(), (int)Constant.HinhNen.Category, 0);
         totalcat = dt.Rows.Count;
         rptTheLoai.DataSource     = dt;
         rptTheLoai.ItemDataBound += rptCategory_ItemDataBound;
         rptTheLoai.DataBind();
         if (lang == "1")
         {
             ltrTheLoai.Text = Resources.Resource.hnTheLoaiHinh;
         }
         else
         {
             ltrTheLoai.Text = Resources.Resource.hnTheLoaiHinh_KD;
         }
     }
 }
Exemple #25
0
        protected void dtgModules_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case "deletemodule":
                try
                {
                    int moduleId = ConvertUtility.ToInt32(e.CommandArgument);
                    ModuleController.DeleteModule(moduleId);
                    BindData();
                }
                catch (Exception ex)
                {
                    Response.Write(ex.Message);
                }
                break;

            case "editmodule":
                Response.Redirect(AppEnv.AdminUrlParams("moduleedit") + "&mid=" + e.CommandArgument.ToString());
                break;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            preurl = ConfigurationSettings.AppSettings.Get("urldata");
            width  = Request.QueryString["w"];
            catID  = ConvertUtility.ToInt32(Request.QueryString["catid"]);
            if (!IsPostBack)
            {
                lang = ConvertUtility.ToInt32(Request.QueryString["lang"]);
                DataTable catInfo = TintucController.GetCategoryByCatIDHasCache(catID);
                if (lang == 1)
                {
                    lnkCatName.Text     = catInfo.Rows[0]["Zone_Name"].ToString().ToUpper();
                    lnkHomeChannel.Text = "TIN TỨC";
                }
                else
                {
                    lnkCatName.Text = catInfo.Rows[0]["Zone_Alias"].ToString().ToUpper();
                }
                lnkCatName.NavigateUrl     = UrlProcess.GetTinTucNewCategoryUrl(lang.ToString(), width, catID.ToString());
                lnkHomeChannel.NavigateUrl = UrlProcess.GetTinTucNewHomeUrl(lang.ToString(), width);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["cpage"]))
            {
                curpage = ConvertUtility.ToInt32(Request.QueryString["cpage"]);
            }
            //start category list
            int       totalrecord = 0;
            DataTable dtCat       = TintucController.GetAllNewsByCategoryHasCache(catID, pagesize, curpage, out totalrecord);

            rptlstCategory.DataSource     = dtCat;
            rptlstCategory.ItemDataBound += new RepeaterItemEventHandler(rptlstCategory_ItemDataBound);
            rptlstCategory.DataBind();
            Paging1.totalrecord  = totalrecord;
            Paging1.pagesize     = pagesize;
            Paging1.numberpage   = pagenumber;
            Paging1.defaultparam = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&catid=" + Request.QueryString["catid"];
            Paging1.queryparam   = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&catid=" + Request.QueryString["catid"] + "&cpage=";
            //end category list
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int totalrecord = 0;

            width = Request.QueryString["w"];
            lang  = ConvertUtility.ToInt32(Request.QueryString["lang"]);
            hotro = ConvertUtility.ToInt32(Request.QueryString["hotro"]);

            _info = Get_User_Agent_Info();

            //Tải nhiều nhất
            //DataTable dtHottest = GameController.GetAllGameByCategoryAndDisplayType(Session["telco"].ToString(), 15, (int)Constant.Game.Topdownload, 30, 1, out totalrecord);
            //DataTable dtHottest = GameController.GetAllGameByCateTypeAndAgentNoCache(Session["telco"].ToString(), 15, (int)Constant.Game.Topdownload, _info, 30, 1, out totalrecord);

            var dtHottest = new DataTable();

            dtHottest = GameController.GetAllGameByCateTypeAndAgentNoCache(Session["telco"].ToString(), 15, (int)Constant.Game.Topdownload, _info, 30, 1, out totalrecord);
            if (dtHottest.Rows.Count == 0)
            {
                dtHottest = GameController.GetAllGameByCategoryAndDisplayType(Session["telco"].ToString(), 15, (int)Constant.Game.Topdownload, 30, 1, out totalrecord);
            }

            if (dtHottest != null && dtHottest.Rows.Count > 0)
            {
                string gameLink = UrlProcess.GetGameHomeUrlNew(lang.ToString(), width, hotro.ToString());

                lnkXemThem.NavigateUrl = gameLink;

                Random rnd = new Random();
                while (dtHottest.Rows.Count > 3)
                {
                    dtHottest.Rows.RemoveAt(rnd.Next(0, dtHottest.Rows.Count));
                    dtHottest.AcceptChanges();
                }
                rptGame.DataSource     = dtHottest;
                rptGame.ItemDataBound += rptGame_ItemDataBound;
                rptGame.DataBind();
            }
        }
Exemple #28
0
        protected void cmdUpdate_Click(object sender, EventArgs e)
        {
            var info = CosoDB.GetInfo(ConvertUtility.ToInt32(txtID.Text));

            if (info == null)
            {
                return;
            }

            info.Coso_Name = txtName.Text.Trim();
            info.Coso_Info = txtDes.Text;
            info.Coso_Map  = txtAvatar.Text;
            try
            {
                CosoDB.Update(info);
                lblUpdateStatus.Text = MiscUtility.UPDATE_SUCCESS;
            }
            catch
            {
                lblUpdateStatus.Text = MiscUtility.UPDATE_ERROR;
            }
        }
Exemple #29
0
 protected void Page_Load(object sender, EventArgs e)
 {
     preurl = ConfigurationSettings.AppSettings.Get("urldata");
     width  = Request.QueryString["w"];
     lang   = ConvertUtility.ToInt32(Request.QueryString["lang"]);
     if (!IsPostBack)
     {
         //lastest News
         DataTable dtlatest = TintucController.GetTopNewsHasCache(381, 3);
         count = dtlatest.Rows.Count - 1;
         rptNewLastest.DataSource     = dtlatest;
         rptNewLastest.ItemDataBound += new RepeaterItemEventHandler(rptNewLastest_ItemDataBound);
         rptNewLastest.DataBind();
         //end lastest News
         lnkCacTinKhac.NavigateUrl = UrlProcess.GetNewsCategoryUrl(lang.ToString(), width, "320");
         if (lang != 1)
         {
             lnkCacTinKhac.Text = "Cac tin khac »";
         }
         ;
     }
 }
Exemple #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            idDotDanhGia = ConvertUtility.ToInt32(Request.QueryString["idDotDanhGia"]);
            idNhanVien   = ConvertUtility.ToInt32(Request.QueryString["idNhanVien"]);

            if (idDotDanhGia == 0)
            {
                idDotDanhGia = CurrentUser.IDDotDanhGiaVaNhanVien;
                idNhanVien   = CurrentUser.UserID;
            }

            if (!IsPostBack)
            {
                dtBoPhanHoTro  = BoPhanController.BoPhan_GetAllActive();
                Session["Nav"] = "1";
            }

            if (CurrentUser.RoleID == (int)Constants.Role.CEO)
            {
                btnUpdateDiem1.Visible = false;
            }
        }