Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            const string boxtname = "tuyensinhhome";
            var          zoneid   = ConvertUtility.ToInt32(ZoneDB.GetIDByFriendlyUrl(boxtname));

            if (zoneid <= 0)
            {
                return;
            }
            var info = ZoneDB.GetInfo(zoneid);

            if (info == null)
            {
                return;
            }

            lnkOther.NavigateUrl = UrlFilter.BuildUrlByZoneID(info.Zone_ParentID);

            string lang = AppEnv.GetLanguageFrontEnd();

            var zoneClassRegister = ConvertUtility.ToInt32(SettingDB.GetValue(AppEnv.CMS_ZoneClassRegister + lang));

            lnkRegister.NavigateUrl = UrlFilter.BuildUrlByZoneID(zoneClassRegister);

            var dtData = DistributionDB.GetContentByZoneIDselfAndNumberRecord(zoneid, 10);

            if (dtData.Rows.Count <= 0)
            {
                return;
            }

            rptData.DataSource = dtData;
            rptData.DataBind();
        }
Example #2
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 lnkRegister = (HyperLink)e.Item.FindControl("lnkRegister");
                var litName     = (Literal)e.Item.FindControl("litName");
                var litContent  = (Literal)e.Item.FindControl("litContent");
                var rptDocument = (Repeater)e.Item.FindControl("rptDocument");

                litName.Text    = curData["Content_Name"].ToString();
                litContent.Text = curData["Content_Body"].ToString();

                lnkRegister.NavigateUrl = UrlFilter.BuildUrlByZoneID(
                    ConvertUtility.ToInt32(
                        SettingDB.GetValue(AppEnv.CMS_ZoneClassRegister + AppEnv.GetLanguageFrontEnd()))) +
                                          "&lh=" + curData["Distribution_ZoneID"];

                var strSQL = "SELECT CMS_ContentDownload.*, CMS_Download.* FROM CMS_ContentDownload ";
                strSQL += " INNER JOIN CMS_Download ON CMS_ContentDownload.Download_ID = CMS_Download.Download_ID ";
                strSQL += " WHERE 1=1 ";
                strSQL += " AND CMS_Download.Download_Visible=1 ";
                strSQL += " AND CMS_ContentDownload.Content_ID=" + curData["Content_ID"] + " ";

                strSQL += " ORDER BY CMS_ContentDownload.Priority ASC ";

                var source = DataHelper.GetDataFromTable(strSQL);

                rptDocument.DataSource = source;
                rptDocument.DataBind();
            }
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ZoneUtility.LoadZones(dropZoneHome.Items);
                foreach (ListItem item in dropZoneHome.Items)
                {
                    //lstZones.Items.Add(new ListItem(item.Text,item.Value));
                    //lstZonesSmall.Items.Add(new ListItem(item.Text, item.Value));
                    dropClassRegister.Items.Add(new ListItem(item.Text, item.Value));
                    dropKhoaHoc.Items.Add(new ListItem(item.Text, item.Value));
                }
            }
            dropZoneHome.SelectedIndex = -1;
            MiscUtility.SetSelected(dropZoneHome.Items, SettingDB.GetValue(AppEnv.CMS_ZoneHome + AppEnv.GetLanguage()));

            dropClassRegister.SelectedIndex = -1;
            MiscUtility.SetSelected(dropClassRegister.Items, SettingDB.GetValue(AppEnv.CMS_ZoneClassRegister + AppEnv.GetLanguage()));

            dropKhoaHoc.SelectedIndex = -1;
            MiscUtility.SetSelected(dropKhoaHoc.Items, SettingDB.GetValue(AppEnv.CMS_ZoneKhoaHoc + AppEnv.GetLanguage()));


            //if (!IsPostBack)
            //{
            //    string zoneFocus = "|" + SettingDB.GetValue(Constants.CMS_ZoneHomeFocus + AppEnv.GetLanguage());
            //    lstZoneFocus.Items.Clear();
            //    foreach (ListItem item in lstZones.Items) if (zoneFocus.IndexOf("|" + item.Value + "|") >= 0) lstZoneFocus.Items.Add(new ListItem(item.Text, item.Value));

            //    string zoneSmallFocus = "|" + SettingDB.GetValue(Constants.CMS_ZoneSmallFocus + AppEnv.GetLanguage());
            //    lstZonesSmallFocus.Items.Clear();
            //    foreach (ListItem itemS in lstZonesSmall.Items) if (zoneSmallFocus.IndexOf("|" + itemS.Value + "|") >= 0) lstZonesSmallFocus.Items.Add(new ListItem(itemS.Text, itemS.Value));
            //}
        }
Example #4
0
        protected void butSearch_Click(object sender, EventArgs e)
        {
            var dotuoi = dropFilterDoTuoi.SelectedValue;
            var monhoc = dropFilterMonHoc.SelectedValue;
            var coso   = dropFilterCoso.SelectedValue;

            Response.Redirect(UrlFilter.BuildUrlByZoneID(ConvertUtility.ToInt32(SettingDB.GetValue(AppEnv.CMS_ZoneClassRegister + AppEnv.GetLanguageFrontEnd()))) + "&dt=" + dotuoi + "&mh=" + monhoc + "&cs=" + coso, true);
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            zoneCurrent = ZoneUtility.GetZoneCurrent();

            zoneHome = ConvertUtility.ToInt32(SettingDB.GetValue(AppEnv.CMS_ZoneHome + AppEnv.GetLanguageFrontEnd()));

            rptData.DataSource = ZoneDB.GetZoneVisbleInMainNav();
            rptData.DataBind();
        }
Example #6
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");
                var divRight    = (HtmlGenericControl)e.Item.FindControl("divRight");
                var lnkRegister = (HyperLink)e.Item.FindControl("lnkRegister");

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

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

                var khInfo = KhoahocDB.GetInfo(ConvertUtility.ToInt32(curData["Content_ID"]));

                if (khInfo != null)
                {
                    litDatetime.Text        = khInfo.Khoahoc_KhaiGiang;
                    lnkRegister.NavigateUrl =
                        UrlFilter.BuildUrlByZoneID(
                            ConvertUtility.ToInt32(
                                SettingDB.GetValue(AppEnv.CMS_ZoneClassRegister + AppEnv.GetLanguageFrontEnd()))) +
                        "&khoahocid=" + khInfo.Khoahoc_ID;
                }


                //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;
                        divRight.Attributes.Add("style", "width: 100%;");
                    }
                }
                else
                {
                    imgAvatar.Visible = false;
                    divRight.Attributes.Add("style", "width: 100%");
                }
            }
        }
Example #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _zonecurrent = ZoneUtility.GetZoneCurrent();

            var zoneKhoahoc =
                ConvertUtility.ToInt32(SettingDB.GetValue(AppEnv.CMS_ZoneKhoaHoc + AppEnv.GetLanguageFrontEnd()));

            lnkZoneName.NavigateUrl = UrlFilter.BuildUrlByZoneID(zoneKhoahoc);

            rptData.DataSource = ZoneDB.GetByParentID(zoneKhoahoc);
            rptData.DataBind();
        }
Example #8
0
        public static string GetValue(string _name)
        {
            DataCaching dataCaching = new DataCaching();
            object      _data       = dataCaching.GetCache(_name);

            if (_data != null)
            {
                return((string)_data);
            }
            else
            {
                string _retVal = SettingDB.GetValue(_name);
                dataCaching.InsertCacheNoExpireTime(_name, _retVal);
                return(_retVal);
            }
        }
Example #9
0
        protected void cmdUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                SettingDB.SetValue(AppEnv.CMS_ZoneHome + AppEnv.GetLanguage(), dropZoneHome.SelectedValue);
                SettingDB.SetValue(AppEnv.CMS_ZoneClassRegister + AppEnv.GetLanguage(), dropClassRegister.SelectedValue);
                SettingDB.SetValue(AppEnv.CMS_ZoneKhoaHoc + AppEnv.GetLanguage(), dropKhoaHoc.SelectedValue);

                //string zoneFocus = string.Empty;
                //foreach (ListItem item in lstZoneFocus.Items) zoneFocus += item.Value + "|";
                //SettingDB.SetValue(Constants.CMS_ZoneHomeFocus + AppEnv.GetLanguage(), zoneFocus);

                //string zoneSmallFocus = string.Empty;
                //foreach (ListItem itemS in lstZonesSmallFocus.Items) zoneSmallFocus += itemS.Value + "|";
                //SettingDB.SetValue(Constants.CMS_ZoneSmallFocus + AppEnv.GetLanguage(), zoneSmallFocus);

                lblStatusUpdate.Text = MiscUtility.UPDATE_SUCCESS;
            }
            catch
            {
                lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            _contentid = ConvertUtility.ToInt32(Request.QueryString["contentid"]);

            //mydealInfo = MydealItemDB.GetInfo(_contentid);

            if (!IsPostBack)
            {
                ZoneUtility.LoadZonesByParentID(dropLopHoc.Items, ConvertUtility.ToInt32(SettingDB.GetValue(AppEnv.CMS_ZoneKhoaHoc + AppEnv.GetLanguage())));
                dropLopHoc.Items.Insert(0, new ListItem("Lựa chọn lớp học", "0"));

                chklMonHoc.DataSource     = MonhocDB.GetAll();
                chklMonHoc.DataTextField  = "Monhoc_Name";
                chklMonHoc.DataValueField = "Monhoc_ID";
                chklMonHoc.DataBind();

                chklCoso.DataSource     = CosoDB.GetAll();
                chklCoso.DataTextField  = "Coso_Name";
                chklCoso.DataValueField = "Coso_ID";
                chklCoso.DataBind();

                chkVisible.Checked = true;
            }
            lblStatusUpdate.Text = string.Empty;
        }
Example #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _dotuoi    = ConvertUtility.ToString(Request.QueryString["dt"]);
            _monhoc    = ConvertUtility.ToString(Request.QueryString["mh"]);
            _coso      = ConvertUtility.ToString(Request.QueryString["cs"]);
            _lophoc    = ConvertUtility.ToString(Request.QueryString["lh"]);
            _khoahocid = ConvertUtility.ToInt32(Request.QueryString["khoahocid"]);

            if (!IsPostBack)
            {
                MiscUtility.FillIndex(dropDay, 1, 31, DateTime.Now.Day);
                MiscUtility.FillIndex(dropMonth, 1, 12, DateTime.Now.Month);
                MiscUtility.FillIndex(dropYear, 1950, DateTime.Now.Year, DateTime.Now.Year);

                dropFilterMonHoc.DataSource     = MonhocDB.GetAll();
                dropFilterMonHoc.DataTextField  = "Monhoc_Name";
                dropFilterMonHoc.DataValueField = "Monhoc_ID";
                dropFilterMonHoc.DataBind();
                dropFilterMonHoc.Items.Insert(0, new ListItem("Chọn môn học", ""));

                dropFilterCoso.DataSource     = CosoDB.GetAll();
                dropFilterCoso.DataTextField  = "Coso_Name";
                dropFilterCoso.DataValueField = "Coso_ID";
                dropFilterCoso.DataBind();
                dropFilterCoso.Items.Insert(0, new ListItem("Chọn cơ sở", ""));

                ZoneUtility.LoadZonesByParentID(dropFilterLopHoc.Items, ConvertUtility.ToInt32(SettingDB.GetValue(AppEnv.CMS_ZoneKhoaHoc + AppEnv.GetLanguage())));
                dropFilterLopHoc.Items.Insert(0, new ListItem("Chọn lớp học", ""));

                MiscUtility.SetSelected(dropFilterDoTuoi.Items, _dotuoi);
                MiscUtility.SetSelected(dropFilterMonHoc.Items, _monhoc);
                MiscUtility.SetSelected(dropFilterLopHoc.Items, _lophoc);
                MiscUtility.SetSelected(dropFilterCoso.Items, _coso);
            }
        }
Example #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _distInfo = DistributionDB.GetInfo(ConvertUtility.ToInt32(Request.QueryString["itemid"]));
            if (_distInfo == null)
            {
                Visible = false;
                return;
            }

            DistributionDB.UpdateView(_distInfo.Distribution_ID, 1);

            var contentInfo = ContentDB.GetInfo(_distInfo.Distribution_ContentID);

            litName.Text = contentInfo.Content_Name;

            if (_distInfo.Distribution_DisableTeaser)
            {
                pnTeaser.Visible = false;
            }
            else
            {
                if (contentInfo.Content_Teaser.Length > 0)
                {
                    litTeaser.Text = contentInfo.Content_Teaser;
                }
                else
                {
                    litTeaser.Visible = false;
                }

                if (_distInfo.Distribution_DisableAvatar)
                {
                    imgAvatar.Visible = false;
                }
                else
                {
                    var coverInfo = ImageDB.GetCover(ConvertUtility.ToInt32(contentInfo.Content_ID));
                    if (coverInfo != null)
                    {
                        string avatar = coverInfo.Image_File;
                        if (avatar.Length > 0)
                        {
                            imgAvatar.ImageUrl    = UrlFilter.BuildImageUrl(avatar, 150, 0);
                            lnkAvatar.NavigateUrl = MultimediaUtility.GetOriginalImage(avatar);

                            lnkAvatar.Attributes.Add("rel", "prettyPhoto");
                            lnkAvatar.ToolTip = coverInfo.Image_Description;
                        }
                        else
                        {
                            imgAvatar.Visible = false;
                        }
                    }
                    else
                    {
                        imgAvatar.Visible = false;
                    }
                }
            }

            litContent.Text = contentInfo.Content_Body;

            //litDatetime.Text = ConvertUtility.ToDateTime(distInfo.Distribution_CreateDate).ToString("dd/MM/yyyy");



            //DataTable dtNews = DistributionDB.GetNewsForCurrent(distInfo.Distribution_ID, 5);
            //if (dtNews.Rows.Count == 0)
            //{
            //    pnNew.Visible = false;
            //}
            //else
            //{
            //    rptNew.DataSource = dtNews;
            //    rptNew.DataBind();
            //}

            var khInfo = KhoahocDB.GetInfo(ConvertUtility.ToInt32(contentInfo.Content_ID));

            if (khInfo != null)
            {
                litDatetime.Text        = khInfo.Khoahoc_KhaiGiang;
                lnkRegister.NavigateUrl =
                    UrlFilter.BuildUrlByZoneID(
                        ConvertUtility.ToInt32(
                            SettingDB.GetValue(AppEnv.CMS_ZoneClassRegister + AppEnv.GetLanguageFrontEnd()))) +
                    "&khoahocid=" + khInfo.Khoahoc_ID;
            }
        }