Пример #1
0
        /// <summary>
        /// Handles the OnItemDataBound event of the gridSiteDomains control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Telerik.Web.UI.GridItemEventArgs"/> instance containing the event data.</param>
        protected void gridSiteDomains_OnItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                var item = (GridDataItem)e.Item;
                var data = (DataRowView)e.Item.DataItem;

                ((HyperLink)item.FindControl("hlEdit")).NavigateUrl = UrlsData.AP_SiteDomainsEdit(Module, Guid.Parse(data["ID"].ToString()));

                ((ImageButton)item.FindControl("ibDelete")).CommandArgument = data["tbl_SiteDomain_ID"].ToString();
                ((ImageButton)item.FindControl("ibDelete")).OnClientClick   = "return confirm(\"Вы действительно хотите удалить запись?\");";
                ((Literal)item.FindControl("lrlSiteDomainStatus")).Text     = EnumHelper.GetEnumDescription((SiteDomainStatus)int.Parse(data["tbl_SiteDomain_StatusID"].ToString()));
            }
        }
Пример #2
0
        /// <summary>
        /// Handles the OnClick event of the lbtnSaveAndCheckDomain control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void lbtnSaveAndCheckDomain_OnClick(object sender, EventArgs e)
        {
            ucNotificationMessageDomainExists.Text = string.Empty;

            var siteDomainId = Guid.Empty;

            var result = DataManager.SiteDomain.Save(SiteId, txtDomain.Text, txtAliases.Text, true, ref siteDomainId);

            if (!string.IsNullOrEmpty(result))
            {
                ucNotificationMessage.Text = result;
                return;
            }

            Session["RunCheck"] = "true";
            Response.Redirect(UrlsData.AP_SiteDomainsEdit("Settings", siteDomainId, "Settings"));
        }