コード例 #1
0
        private void LoadInfo(int zoneID)
        {
            hddID.Value = "";
            ZoneInfo info = ZoneDB.GetInfo(zoneID);

            if (info == null)
            {
                //  cmdEmpty_Click(null, null);
                btnUpdate.Enabled = false;
                btnDelete.Enabled = false;
                return;
            }

            btnUpdate.Enabled = true;
            btnDelete.Enabled = true;

            hddID.Value = info.Zone_ID.ToString();

            dropZones.SelectedIndex = -1;
            if (dropZones.Items.FindByValue(info.Zone_ParentID.ToString()) != null)
            {
                dropZones.Items.FindByValue(info.Zone_ParentID.ToString()).Selected = true;
            }

            txtName.Text = info.Zone_Name;
            txtDescriptionCK.HtmlValue = info.Zone_Description;
            txtFriendlyUrl.Text        = info.Zone_FriendlyUrl;
            txtRealUrl.Text            = info.Zone_RealUrl;
            txtAvatar.Text             = info.Zone_Avatar;
            //priority field


            //lang field
            //isStandAloneBox field
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _zonecurrent = ZoneUtility.GetZoneCurrent();
            var source = ZoneDB.GetByParentID(_zonecurrent);

            if (source.Rows.Count == 0)
            {
                pntSub.Visible = false;

                var zoneInfo = ZoneDB.GetInfo(_zonecurrent);
                if (zoneInfo != null)
                {
                    pnZoneName.Visible = true;
                    litZoneName.Text   = zoneInfo.Zone_Name;
                    var listStyle = zoneInfo.Zone_ContentListingDisplay;
                    if (listStyle == "one")
                    {
                        PlaceHolder1.Controls.Add(Page.LoadControl("UserControls/NewsFocus.ascx"));
                    }
                    else
                    {
                        PlaceHolder1.Controls.Add(Page.LoadControl("UserControls/NewsList.ascx"));
                    }
                }
                else
                {
                    Response.Redirect("/");
                }
            }
            else
            {
                rptData.DataSource = source;
                rptData.DataBind();
            }
        }
コード例 #3
0
        public void Blockchange2(Player p, ushort x, ushort y, ushort z, ushort type)
        {
            p.ClearBlockchange();
            ushort b = p.level.GetTile(x, y, z);

            p.SendBlockchange(x, y, z, b);
            CatchPos cpos = (CatchPos)p.blockchangeObject;

            Zone Zn = new Zone();

            Zn.smallX = Math.Min(cpos.x, x);
            Zn.smallY = Math.Min(cpos.y, y);
            Zn.smallZ = Math.Min(cpos.z, z);
            Zn.bigX   = Math.Max(cpos.x, x);
            Zn.bigY   = Math.Max(cpos.y, y);
            Zn.bigZ   = Math.Max(cpos.z, z);
            Zn.owner  = cpos.Owner;
            Zn.level  = p.level.name;

            p.level.ZoneList.Add(Zn);
            ZoneDB.zones.Add(Zn);


            ZoneDB.Save();
            Player.SendMessage(p, "Added zone for &b" + cpos.Owner);
        }
コード例 #4
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();
        }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _zonecurrent = ZoneUtility.GetZoneCurrent();

            var zoneInfo = ZoneDB.GetInfo(_zonecurrent);

            if (zoneInfo != null)
            {
                lnkZone.Text        = zoneInfo.Zone_Name;
                lnkZone.NavigateUrl = UrlFilter.BuildUrlByZoneID(_zonecurrent);
                var listStyle = zoneInfo.Zone_ContentListingDisplay;
                if (listStyle == "one")
                {
                    SpecialInZone1.Visible = false;
                    PlaceHolder1.Controls.Add(Page.LoadControl("UserControls/NewsFocus.ascx"));
                }
                else
                {
                    PlaceHolder1.Controls.Add(Page.LoadControl("Project/TuyenSinhList.ascx"));
                }
            }
            else
            {
                Response.Redirect("/");
            }
        }
コード例 #6
0
ファイル: Album_List.ascx.cs プロジェクト: coltechvn/SolArt
        protected void Page_Load(object sender, EventArgs e)
        {
            _zoneCurrent = ZoneUtility.GetZoneCurrent();

            lnkZone.Text        = ZoneDB.GetZoneNameByID(_zoneCurrent);
            lnkZone.NavigateUrl = UrlFilter.BuildUrlByZoneID(_zoneCurrent);

            var source = DistributionDB.GetNewContentByZoneIDNoPage(_zoneCurrent, true, _excludeSpecial);

            if (source.Rows.Count > 0)
            {
                CollectionPager1.DataSource    = source.DefaultView;
                CollectionPager1.BindToControl = rptData;

                if (AppEnv.GetLanguageFrontEnd() == "vi-VN")
                {
                    CollectionPager1.LabelText = "Trang:&nbsp;";
                }
                else
                {
                    CollectionPager1.LabelText = "Page:&nbsp;";
                }

                CollectionPager1.BackText              = "<<";
                CollectionPager1.PageNumbersSeparator  = "&nbsp;&nbsp;&nbsp;";
                CollectionPager1.BackNextLinkSeparator = "&nbsp;&nbsp;&nbsp;";

                rptData.DataSource = CollectionPager1.DataSourcePaged;
                rptData.DataBind();
            }
            else
            {
                rptData.Visible = false;
            }
        }
コード例 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _zonecurrent = ZoneUtility.GetZoneCurrent();

            var zoneLayout = ZoneDB.GetZoneLayout(_zonecurrent);

            if (zoneLayout.Length > 0)
            {
                switch (zoneLayout)
                {
                case "Layout_Zone_ClassRegister":
                    break;

                case "Layout_Zone_Khoahoc":
                case "Layout_Zone_Mamnon":
                    TuyenSinh_Home1.Visible     = true;
                    Search_Khoahoc1.Visible     = true;
                    Subcategory_2level1.Visible = true;
                    News_Sub1.Visible           = true;
                    break;

                case "Layout_Zone_Contact":
                    TuyenSinh_Home1.Visible = true;
                    CamNhan_Sub1.Visible    = true;
                    break;

                default:
                    TuyenSinh_Home1.Visible = true;
                    CamNhan_Sub1.Visible    = true;
                    Music_Home1.Visible     = true;
                    Video_RightSub1.Visible = true;
                    break;
                }
            }
        }
コード例 #8
0
        private void LoadInfo(int zoneID)
        {
            hddID.Value = "";
            ZoneInfo info = ZoneDB.GetInfo(zoneID);

            if (info == null)
            {
                //  cmdEmpty_Click(null, null);
                btnUpdate.Enabled = false;
                btnDelete.Enabled = false;
                return;
            }

            btnUpdate.Enabled = true;
            btnDelete.Enabled = true;

            hddID.Value = info.Zone_ID.ToString();

            dropZones.SelectedIndex = -1;
            if (dropZones.Items.FindByValue(info.Zone_ParentID.ToString()) != null)
            {
                dropZones.Items.FindByValue(info.Zone_ParentID.ToString()).Selected = true;
            }

            txtName.Text        = info.Zone_Name;
            txtDescription.Text = info.Zone_Description;
            txtFriendlyUrl.Text = info.Zone_FriendlyUrl;
            txtRealUrl.Text     = info.Zone_RealUrl;
            txtAvatar.Text      = info.Zone_Avatar;
            //priority field
            txtMetaDescription.Text = info.Zone_MetaDescription;
            txtMetaKeywords.Text    = info.Zone_MetaKeywords;

            dropLayout.SelectedIndex = -1;
            if (dropLayout.Items.FindByValue(info.Zone_Layout) != null)
            {
                dropLayout.Items.FindByValue(info.Zone_Layout).Selected = true;
            }

            dropSubcategoryDisplay.SelectedIndex = -1;
            dropSubcategoryDisplay.SelectedValue = info.Zone_SubcategoryDisplay;

            dropContentDisplay.SelectedIndex = -1;
            dropContentDisplay.SelectedValue = info.Zone_ContentListingDisplay;

            chkMainNav.Checked   = info.Zone_VisibleInMainNav;
            chkLeftNav.Checked   = info.Zone_VisibleInLeftNav;
            chkTopNav.Checked    = info.Zone_VisibleInTopNav;
            chkFooterNav.Checked = info.Zone_VisibleInFooterNav;

            chkExcludeFromNav.Checked = info.Zone_ExcludeFromNav;
            chkVisible.Checked        = info.Zone_Visible;
            chkDisable.Checked        = info.Zone_Disable;

            //lang field
            //isStandAloneBox field
        }
コード例 #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            zoneCurrent = ZoneUtility.GetZoneCurrent();

            lnkDownload.NavigateUrl = AppEnv.DownloadBrochure;

            rptData.DataSource = ZoneDB.GetByParentID(zoneCurrent);
            rptData.DataBind();
        }
コード例 #10
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();
        }
コード例 #11
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();
        }
コード例 #12
0
        private void LoadZones()
        {
            if (isManager || isDeployer)
            {
                dropZones.DataSource     = ZoneDB.GetStandAloneBox();
                dropZones.DataValueField = "Zone_ID";
                dropZones.DataTextField  = "Zone_Name";
                dropZones.DataBind();
                dropZones.Items.Insert(0, new ListItem("Root", "0"));
            }

            MiscUtility.SetSelected(dropZones.Items, AppEnv.ZoneSelected.ToString());
        }
コード例 #13
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            if (hddID.Value == "")
            {
                return;
            }

            ZoneInfo info = ZoneDB.GetInfo(ConvertUtility.ToInt32(hddID.Value));

            if (info == null)
            {
                Reset();
                return;
            }

            if (txtName.Text.Trim() == "")
            {
                lblStatusUpdate.Text = AppEnv.NoticeRequired(lang, "TÊN MỤC");
                return;
            }


            info.Zone_ParentID    = ConvertUtility.ToInt32(dropZones.SelectedValue);
            info.Zone_Name        = txtName.Text.Trim();
            info.Zone_Description = txtDescriptionCK.HtmlValue;
            info.Zone_FriendlyUrl = txtFriendlyUrl.Text.Replace(" ", "");
            info.Zone_RealUrl     = txtRealUrl.Text.Trim();
            info.Zone_Avatar      = txtAvatar.Text.Trim();
            //priority field
            info.Zone_Lang = lang;

            if (info.Zone_ID == info.Zone_ParentID)
            {
                lblStatusUpdate.Text = "<font color='red'>" + (lang == "vi-VN" ? " Trùng mục cha, chọn mục cha khác !" : "The same Index Parent,Select other index Parent !") + "</font>";
                return;
            }
            if (ZoneDB.Update(info))
            {
                lblStatusUpdate.Text = AppEnv.NoticeEdit(lang, true);
                hddID.Value          = "";
                btnUpdate.Enabled    = false;
                btnDelete.Enabled    = false;
                Reset();
            }
            else
            {
                lblStatusUpdate.Text = AppEnv.NoticeEdit(lang, false);
            }

            LoadZones();
        }
コード例 #14
0
        private void LoadPrioritys(DataTable dataTable)
        {
            totalPriority = 0;

            if (dataTable != null && dataTable.Rows.Count > 0)
            {
                totalPriority = ZoneDB.GetMaxOrder(lang);

                if (totalPriority < dataTable.Rows.Count)
                {
                    totalPriority = dataTable.Rows.Count;
                }
            }
        }
コード例 #15
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            hddID.Value       = "";
            btnUpdate.Enabled = false;
            btnDelete.Enabled = false;

            if (txtName.Text.Trim() == "")
            {
                lblStatusUpdate.Text = AppEnv.NoticeRequired(lang, "TÊN TRƯỜNG");
                return;
            }

            var info = new ZoneInfo();

            info.Zone_ParentID    = ConvertUtility.ToInt32(dropZones.SelectedValue);
            info.Zone_Name        = txtName.Text.Trim();
            info.Zone_Description = txtDescription.Text;

            info.Zone_FriendlyUrl = UnicodeUtility.UnicodeToFriendlyUrl(txtName.Text);

            info.Zone_RealUrl               = txtRealUrl.Text.Trim();
            info.Zone_Avatar                = txtAvatar.Text.Trim();
            info.Zone_Priority              = ZoneDB.GetChildCount(ConvertUtility.ToInt32(dropZones.SelectedValue));
            info.Zone_MetaDescription       = txtMetaDescription.Text;
            info.Zone_MetaKeywords          = txtMetaKeywords.Text;
            info.Zone_Layout                = dropLayout.SelectedValue;
            info.Zone_SubcategoryDisplay    = dropSubcategoryDisplay.SelectedValue;
            info.Zone_ContentListingDisplay = dropContentDisplay.SelectedValue;
            info.Zone_VisibleInMainNav      = chkMainNav.Checked;
            info.Zone_VisibleInLeftNav      = chkLeftNav.Checked;
            info.Zone_VisibleInTopNav       = chkTopNav.Checked;
            info.Zone_VisibleInFooterNav    = chkFooterNav.Checked;
            info.Zone_ExcludeFromNav        = chkExcludeFromNav.Checked;
            info.Zone_Visible               = chkVisible.Checked;
            info.Zone_Disable               = chkDisable.Checked;
            info.Zone_Lang            = lang;
            info.Zone_IsStandAloneBox = false;

            if (ZoneDB.Insert(info))
            {
                lblStatusUpdate.Text = AppEnv.NoticeAdd(lang, true);
                Reset();
            }
            else
            {
                lblStatusUpdate.Text = AppEnv.NoticeAdd(lang, false);
            }
            LoadZones();
        }
コード例 #16
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;
                //HyperLink lnkZone = (HyperLink)e.Item.FindControl("lnkZone");
                var litZone        = (Literal)e.Item.FindControl("litZone");
                var imgAvatar      = (Image)e.Item.FindControl("imgAvatar");
                var litDescription = (Literal)e.Item.FindControl("litDescription");
                var rptSub2        = (Repeater)e.Item.FindControl("rptSub2");

                //if (curData["Zone_ID"].ToString() == zoneCurrent.ToString()) lnkZone.CssClass = "selected";

                //if (zoneCurrent == 0)
                //{
                //    if (curData["Zone_ID"].ToString() == zoneHome.ToString()) lnkZone.CssClass = "selected";
                //}

                //if (curData["Zone_RealUrl"].ToString().Length > 0)
                //    lnkZone.NavigateUrl = curData["Zone_RealUrl"].ToString();
                //else
                //    lnkZone.NavigateUrl = ZoneUtility.BuildUrlByZoneCurrent(ConvertUtility.ToInt32(curData["Zone_ID"]));

                litDescription.Text = curData["Zone_Description"].ToString();
                litZone.Text        = curData["Zone_Name"].ToString();
                var avatar = curData["Zone_Avatar"].ToString().Trim();
                if (avatar.Length > 0)
                {
                    imgAvatar.ImageUrl = UrlFilter.BuildImageUrl(avatar, 35, 0);
                }
                else
                {
                    imgAvatar.Visible = false;
                }

                var dtSub = ZoneDB.GetByParentID(ConvertUtility.ToInt32(curData["Zone_ID"]));

                if (dtSub.Rows.Count == 0)
                {
                    rptSub2.Visible = false;
                }
                else
                {
                    rptSub2.DataSource     = dtSub;
                    rptSub2.ItemDataBound += new RepeaterItemEventHandler(rptSub2_ItemDataBound);
                    rptSub2.DataBind();
                }
            }
        }
コード例 #17
0
        private void LoadZones()
        {
            ZoneUtility.LoadZones(dropZones.Items);

            lstZones.DataSource     = ZoneDB.GetStandAloneBox();
            lstZones.DataValueField = "Zone_ID";
            lstZones.DataTextField  = "Zone_Name";
            lstZones.DataBind();
            lstZones.Items.Insert(0, new ListItem("Root", "0"));


            MiscUtility.SetSelected(lstZones.Items, zoneSelected.ToString());

            lstZones_SelectedIndexChanged(null, null);
        }
コード例 #18
0
ファイル: Zone.ascx.cs プロジェクト: coltechvn/SolArt
        protected void Page_Load(object sender, EventArgs e)
        {
            _zonecurrent = ZoneUtility.GetZoneCurrent();

            var zoneLayout = ZoneDB.GetZoneLayout(_zonecurrent);

            if (zoneLayout.Length > 0)
            {
                PlaceHolder1.Controls.Add(Page.LoadControl("Layout/" + zoneLayout + ".ascx"));
            }
            else
            {
                Response.Redirect("/");
            }
        }
コード例 #19
0
        public static void LoadZonesOrderByName(ListItemCollection lstZones)
        {
            lstZones.Clear();
            DataTable dtItems = ZoneDB.GetByParentIDOrderByName(0);

            foreach (DataRow row in dtItems.Rows)
            {
                ListItem item = new ListItem();
                item.Value = row["Zone_ID"].ToString();
                item.Text  = row["Zone_Name"].ToString();
                item.Attributes.Add("Level", "0");
                lstZones.Add(item);
                LoadZoneItemsOrderByName(lstZones, item);
            }
        }
コード例 #20
0
        protected void lstZones_SelectedIndexChanged(object sender, EventArgs e)
        {
            int zoneID = ConvertUtility.ToInt32(lstZones.SelectedValue);

            zoneSelected = zoneID;

            DataTable data = ZoneDB.GetByParentID(zoneID);

            LoadPrioritys(data);

            dtgZones.DataSource = data;
            dtgZones.DataBind();

            LoadInfo(zoneID);
        }
コード例 #21
0
ファイル: Video_List.ascx.cs プロジェクト: coltechvn/SolArt
        protected void Page_Load(object sender, EventArgs e)
        {
            _zoneCurrent = ZoneUtility.GetZoneCurrent();

            _itemid = ConvertUtility.ToInt32(Request.QueryString["itemid"]);

            _distInfo = DistributionDB.GetInfo(_itemid);
            if (_distInfo == null)
            {
                Visible = false;
                return;
            }

            DistributionDB.UpdateView(_distInfo.Distribution_ID, 1);

            _contentId = _distInfo.Distribution_ContentID;

            var contentInfo = ContentDB.GetInfo(_contentId);

            lnkName.Text        = contentInfo.Content_Name;
            lnkName.NavigateUrl = UrlFilter.BuildUrlByItemID(_itemid);



            lnkZone.Text        = ZoneDB.GetZoneNameByID(_zoneCurrent);
            lnkZone.NavigateUrl = UrlFilter.BuildUrlByZoneID(_zoneCurrent);

            var strSQL = "SELECT CMS_ContentVideo.*, CMS_Videos.* FROM CMS_ContentVideo ";

            strSQL += " INNER JOIN CMS_Videos ON CMS_ContentVideo.Video_ID = CMS_Videos.Video_ID ";
            strSQL += " WHERE 1=1 ";

            strSQL += " AND CMS_ContentVideo.Content_ID=" + _contentId + " ";
            strSQL += " AND CMS_Videos.Video_Visible=1 ";
            strSQL += " ORDER BY CMS_ContentVideo.Priority ASC ";

            var source = DataHelper.GetDataFromTable(strSQL);

            if (source.Rows.Count > 0)
            {
                rptData.DataSource = source;
                rptData.DataBind();
            }
            else
            {
                rptData.Visible = false;
            }
        }
コード例 #22
0
ファイル: SubCategory.ascx.cs プロジェクト: coltechvn/SolArt
        protected void Page_Load(object sender, EventArgs e)
        {
            zoneCurrent = ZoneUtility.GetZoneCurrent();
            var source = ZoneDB.GetByParentID(zoneCurrent);

            if (source.Rows.Count == 0)
            {
                var zoneparent = ZoneDB.GetParentID(zoneCurrent);
                if (zoneparent != 0)
                {
                    source = ZoneDB.GetByParentID(zoneparent);
                }
            }
            rptData.DataSource = source;
            rptData.DataBind();
        }
コード例 #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _zonecurrent = ZoneUtility.GetZoneCurrent();

            var zoneInfo = ZoneDB.GetInfo(_zonecurrent);

            if (zoneInfo != null)
            {
                lnkZone.Text        = zoneInfo.Zone_Name;
                lnkZone.NavigateUrl = UrlFilter.BuildUrlByZoneID(_zonecurrent);
            }
            else
            {
                Response.Redirect("/");
            }
        }
コード例 #24
0
        private void LoadZones()
        {
            lstZones.Enabled = false;

            if (isManager || isDeployer)
            {
                lstZones.DataSource     = ZoneDB.GetStandAloneBox();
                lstZones.DataValueField = "Zone_ID";
                lstZones.DataTextField  = "Zone_Name";
                lstZones.DataBind();
            }

            if (isManager || isDeployer)
            {
                lstZones.Enabled = true;
            }
        }
コード例 #25
0
ファイル: Video_Home.ascx.cs プロジェクト: coltechvn/SolArt
        protected void Page_Load(object sender, EventArgs e)
        {
            const string boxtname = "homebottomright";
            var          zoneid   = ConvertUtility.ToInt32(ZoneDB.GetIDByFriendlyUrl(boxtname));

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

            if (info == null)
            {
                return;
            }

            var realUrl = (info.Zone_RealUrl);

            if (realUrl.Length > 0)
            {
                lnkOther.NavigateUrl = realUrl;
            }
            else
            {
                lnkOther.NavigateUrl = UrlFilter.BuildUrlByZoneID(info.Zone_ParentID);
            }

            var dtSpecial = DistributionDB.GetContentByZoneIDAndRank(zoneid, 1, (int)AppEnv.CMSContentRank.Special);

            if (dtSpecial.Rows.Count > 0)
            {
                rptSpecial.DataSource = dtSpecial;
                rptSpecial.DataBind();
            }

            var dtData = DistributionDB.GetContentByZoneIDAndRank(zoneid, 3, (int)AppEnv.CMSContentRank.Default);

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

            rptData.DataSource = dtData;
            rptData.DataBind();
        }
コード例 #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            const string boxtname = "addresshome";
            var          zoneid   = ConvertUtility.ToInt32(ZoneDB.GetIDByFriendlyUrl(boxtname));

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

            if (info == null)
            {
                return;
            }

            litContent.Text = info.Zone_Description;
        }
コード例 #27
0
        private static void LoadZoneItemsOrderByName(ListItemCollection lstZones, ListItem curItem)
        {
            int level = Convert.ToInt32(curItem.Attributes["Level"]);

            level += 1;
            int       curZoneID    = ConvertUtility.ToInt32(curItem.Value);
            DataTable dtChildItems = ZoneDB.GetByParentIDOrderByName(curZoneID);

            foreach (DataRow row in dtChildItems.Rows)
            {
                ListItem childItem = new ListItem();
                childItem.Text  = MiscUtility.StringIndent(level) + row["Zone_Name"];
                childItem.Value = row["Zone_ID"].ToString();
                childItem.Attributes.Add("Level", level.ToString());
                lstZones.Add(childItem);
                LoadZoneItems(lstZones, childItem);
            }
        }
コード例 #28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            const string boxtname = "tuyensinhtrangtrong";
            var          zoneid   = ConvertUtility.ToInt32(ZoneDB.GetIDByFriendlyUrl(boxtname));

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

            if (info == null)
            {
                return;
            }

            //litName.Text = info.Zone_Name;
            litContent.Text = info.Zone_Description;
        }
コード例 #29
0
        public BaseTest()
        {
            var options = new DbContextOptionsBuilder <ZoneDB>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString())
                          .Options;

            var context = new ZoneDB(options);

            ZoneService          = new ZoneService(context);
            ElementService       = new ElementService(context);
            WeatherService       = new WeatherService();
            CommunicationService = new CommunicationService(WeatherService, context);
            IOptions <AppSettings> appSettings = Options.Create <AppSettings>(new AppSettings()
            {
                Secret = "Testing"
            });

            UserService = new UserService(appSettings, context);
        }
コード例 #30
0
        protected void lnkOrder_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow gvr in dtgZones.Rows)
            {
                Label lblID = (Label)(gvr.FindControl("lblID"));

                if (lblID != null)
                {
                    //  lblNotice_1.Text = lblID.Text;

                    DropDownList ddlOrder = (DropDownList)gvr.FindControl("ddlOrder");
                    int          newOrder = ConvertUtility.ToInt32(ddlOrder.SelectedValue);
                    int          tabID    = ConvertUtility.ToInt32(lblID.Text);
                    ZoneDB.SetPriority(tabID, newOrder);
                }
            }


            LoadZones();
        }