private Dictionary <string, string> dictWhere() { Dictionary <string, string> dicWhere = new Dictionary <string, string>(); if (StrKeySearch != "") { dicWhere.Add("Content", Utils.UrlDecode(StrKeySearch)); dicWhere.Add("UserNo", Utils.UrlDecode(StrKeySearch)); dicWhere.Add("ScriptName", Utils.UrlDecode(StrKeySearch)); txtSearch.Text = StrKeySearch; } if (StrDate1 != "") { dicWhere.Add("StartDate", StrDate1); txtDate1.Text = StrDate1; } if (StrDate2 != "") { dicWhere.Add("EndDate", StrDate2); txtDate2.Text = StrDate2; } if (!string.IsNullOrEmpty(Request.QueryString["selType"])) { dicWhere.Add("Type", Utils.ParseInt(Request.QueryString["selType"], 1).ToString()); } dicWhere.Add("SiteID", Utils.UrlDecode(SiteID.ToString())); return(dicWhere); }
protected void Page_Load(object sender, EventArgs e) { string FilePath; if (SiteDir == "") { FilePath = "~/" + GetVirtualPath + "config/SiteParam.config"; } else { FilePath = "~/" + GetVirtualPath + SiteDir + "/config/SiteParam.config"; } PhyFilePath = HttpContext.Current.Server.MapPath(FilePath); KingTop.BLL.SysManage.SysWebSite siteBll = new SysWebSite(); DataTable dt = siteBll.GetList("One", Utils.getOneParams(SiteID.ToString())); if (dt.Rows.Count > 0) { if (dt.Rows[0]["IsMainSite"].ToString() == "True") { isMainDomain = true; } } if (!Page.IsPostBack) { ResetConfig(); BindDate(); } }
private void BindDate() { //绑定多选用户组角色 Role bllRole = new Role(); DataTable dt = null; chkRoleCode.Items.Clear(); if (hdPCode.Value == "0" || hdPCode.Value == "") { //如果是一级用户组,则把所有的角色读出来 if (ourNumCode == "1") { dt = bllRole.GetList("ALL", Utils.getOneParams(SiteID.ToString())); } else { dt = bllRole.GetList("GETROLE", Utils.getOneParams(ourNumCode)); } } else { //如果不是,则读上一级用户组的所属角色 dt = bllRole.GetList("GETROLE", Utils.getOneParams(hdPCode.Value)); } if (dt.Rows.Count > 0) { this.chkRoleCode.DataSource = dt.DefaultView; this.chkRoleCode.DataTextField = "RoleName"; this.chkRoleCode.DataValueField = "RoleCode"; this.chkRoleCode.DataBind(); } InitChklist(); }
/// <summary> /// Get callback result /// </summary> public string GetCallbackResult() { string whereCondition = (SiteID > 0) ? SqlHelper.AddWhereCondition(gridEvents.WhereClause, GenerateWhereCondition()) : gridEvents.WhereClause; mParameters = new Hashtable(); mParameters["where"] = whereCondition; mParameters["orderby"] = gridEvents.SortDirect; // Get the dialog identifier Guid dialogIdentifier = GetDialogIdentifier(); // Store the dialog identifier with appropriate data in the session WindowHelper.Add(dialogIdentifier.ToString(), mParameters); string queryString = "?params=" + dialogIdentifier; if (SiteID > 0) { queryString = URLHelper.AddParameterToUrl(queryString, "siteid", SiteID.ToString()); } queryString = URLHelper.AddParameterToUrl(queryString, "hash", QueryHelper.GetHash(queryString)); queryString = URLHelper.AddParameterToUrl(queryString, "eventid", EventID.ToString()); return(queryString); }
/// <summary> /// Handles the UniGrid's OnAction event. /// </summary> /// <param name="actionName">Name of item (button) that throws event</param> /// <param name="actionArgument">ID (value of Primary key) of corresponding data row</param> protected void UniGrid_OnAction(string actionName, object actionArgument) { if (actionName.ToLowerCSafe() == "edit") { string editUrl = "Product_Edit_VolumeDiscount_Edit.aspx"; editUrl = URLHelper.AddParameterToUrl(editUrl, "productID", ProductID.ToString()); editUrl = URLHelper.AddParameterToUrl(editUrl, "volumeDiscountID", Convert.ToString(actionArgument)); editUrl = URLHelper.AddParameterToUrl(editUrl, "siteId", SiteID.ToString()); editUrl = URLHelper.AddParameterToUrl(editUrl, "dialog", QueryHelper.GetString("dialog", "0")); URLHelper.Redirect(AddNodeIDParameterToUrl(editUrl)); } else if (actionName.ToLowerCSafe() == "delete") { SKUInfo sku = SKUInfoProvider.GetSKUInfo(ProductID); if (sku == null) { return; } if (CheckProductModifyAndRedirect(sku)) { // Delete VolumeDiscountInfo object from database VolumeDiscountInfoProvider.DeleteVolumeDiscountInfo(Convert.ToInt32(actionArgument)); } } }
protected void btnExport_Click(object sender, EventArgs e) { List <Guid> lstSel = new List <Guid>(); foreach (GridViewRow row in gvPages.Rows) { var chkReMap = (CheckBox)row.FindControl("chkSelect"); if (chkReMap.Checked) { var hdnGalleryID = (HiddenField)row.FindControl("hdnGalleryID"); Guid gGallery = new Guid(hdnGalleryID.Value); lstSel.Add(gGallery); } } string theXML = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n"; string fileName = "galleryexport-" + SiteID.ToString() + ".xml"; theXML = GalleryExportList.GetGalleryExportXML(SiteID, lstSel); fileName = fileName.Replace(" ", "_"); Response.Expires = 5; Response.ContentType = "application/octet-stream"; Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(fileName)); Response.Write(theXML); Response.StatusCode = 200; Response.StatusDescription = "OK"; Response.End(); }
// 分页控件数据绑定 private void SplitDataBind() { Dictionary <string, string> dicWhere = new Dictionary <string, string>(); KingTop.Model.Pager p = new KingTop.Model.Pager(); KingTop.BLL.SysManage.Role objRole = new KingTop.BLL.SysManage.Role(); if (StrKeySearch != "") { dicWhere.Add("RoleName", Utils.UrlDecode(StrKeySearch)); txtSearch.Text = StrKeySearch; } //如果不是超级管理员,则只显示自己用户组以下的用户 //string userId = LoginInfoHelper.GetLoginAccountId(Session, Response); //if (userId != "0") //{ // UserGroup bllUserGrop = new UserGroup(); // DataTable dt = bllUserGrop.GetList("LOGINUSERGROP", Utils.getTwoParams(SiteID.ToString(), userId)).Tables[0]; // if (dt.Rows.Count > 0) // { // dicWhere.Add("UserGroupCode", dt.Rows[0]["UserGroupCode"].ToString()); // } //} dicWhere.Add("SiteID", SiteID.ToString()); p.Aspnetpage = Split; p.RptControls = rptUserGropeList; p.DicWhere = dicWhere; objRole.PageData(p); }
// 分页控件数据绑定 private void SplitDataBind() { Dictionary <string, string> dicWhere = new Dictionary <string, string>(); KingTop.Model.Pager p = new KingTop.Model.Pager(); KingTop.BLL.SysManage.UserGropManage objUserGrop = new KingTop.BLL.SysManage.UserGropManage(); if (StrKeySearch != "") { dicWhere.Add("UserGroupName", Utils.UrlDecode(StrKeySearch)); txtSearch.Text = StrKeySearch; } //如果不是超级管理员,则只显示自己用户组以下的用户 string userId = LoginInfoHelper.GetLoginAccountId(Session, Response); if (userId != "0") { DataTable dt = bllUserGrop.GetList("LOGINUSERGROP", Utils.getTwoParams(SiteID.ToString(), userId)).Tables[0]; if (dt.Rows.Count > 0) { dicWhere.Add("NumCode", dt.Rows[0]["NumCode"].ToString()); } } dicWhere.Add("SiteID", SiteID.ToString()); p.Aspnetpage = Split; p.RptControls = rptUserGropeList; p.DicWhere = dicWhere; //把表保存到临时内存中 dsUserGroupRole = bllUserGrop.GetList("GROUPANDROLENAME", Utils.getOneParams(SiteID.ToString())); //dsUserGroupName = BllgroupRole.GetUserGroupRole(p); objUserGrop.PageData(p, 1); }
private void InnitNote() { KingTop.BLL.SysManage.Top top = new KingTop.BLL.SysManage.Top(); //公告 rptNote.DataSource = top.GetMessage(5, SiteID.ToString(), UserNo, userID); rptNote.DataBind(); }
public void oparate() { UserGroup BllUserG = new UserGroup(); string userId = LoginInfoHelper.GetLoginAccountId(Session, Response); dtUserGroup = BllUserG.GetList("ALL", Utils.getOneParams(SiteID.ToString())).Tables[0]; ddlUserGroup.DataSource = dtUserGroup.DefaultView; ddlUserGroup.DataTextField = "UserGroupName"; ddlUserGroup.DataValueField = "userGroupCode"; ddlUserGroup.DataBind(); ListItem ls = new ListItem("请选择", "0");//追加一项 this.ddlUserGroup.Items.Insert(0, ls); if (userId != "0") { DataTable dt = BllUserG.GetList("LOGINUSERGROP", Utils.getTwoParams(SiteID.ToString(), userId)).Tables[0]; ourNumCode = dt.Rows[0]["numCode"].ToString(); } string temp_str = ""; int numCode = 0; string strCode = ""; for (int i = 0; i < dtUserGroup.Rows.Count; i++) { strCode = dtUserGroup.Rows[i]["numCode"].ToString(); if (strCode.IndexOf(ourNumCode) == 0 && strCode != ourNumCode) { numCode = strCode.Length / 3; if (numCode == 1) { } else { for (int p = 1; p < numCode; p++) { if (p == numCode - 1) { temp_str = temp_str + "├"; } else { temp_str = temp_str + " "; } } } dtUserGroup.Rows[i]["UserGroupName"] = temp_str + dtUserGroup.Rows[i]["UserGroupName"].ToString(); temp_str = ""; } else { dtUserGroup.Rows[i].Delete(); } } }
//获取当前站点的文件夹名称 protected string GetSiteDir() { string strSiteDir = ""; SysWebSite bllWebSite = new SysWebSite(); DataTable dt = bllWebSite.GetList("ONE", Utils.getOneParams(SiteID.ToString())); strSiteDir = dt.Rows[0]["Directory"].ToString(); return(strSiteDir); }
private void PageInit() { DataTable dt = bllSinglePage.GetList("ONE", Utils.getTwoParams(SiteID.ToString(), NodeCode)); if (dt != null && dt.Rows.Count > 0) { Editor1.Content = dt.Rows[0][0].ToString(); } }
protected void Page_Load(object sender, EventArgs e) { rightHeaderActions.ActionPerformed += RightHeaderActions_ActionPerformed; // Show info that scheduler is disabled if (!SchedulingHelper.EnableScheduler) { ShowWarning(GetString("scheduledtask.disabled")); } listElem.SiteID = SiteID; string editUrl = UIContextHelper.GetElementUrl("CMS.ScheduledTasks", GetElementName("EditSystemTask"), true); editUrl = URLHelper.AddParameterToUrl(editUrl, "siteid", SiteID.ToString()); listElem.EditURL = editUrl; // Refresh action HeaderActions.AddAction(new HeaderAction { Text = GetString("General.Refresh"), OnClientClick = "RefreshGrid();" }); if (SiteInfo != null) { bool usesTimer = SchedulingHelper.UseAutomaticScheduler; if (usesTimer) { // Restart timer action rightHeaderActions.AddAction(new HeaderAction { Text = GetString("Task_List.Restart"), EventName = TASKS_RESTART_TIMER, ButtonStyle = ButtonStyle.Default }); } // Run execution ASAP action rightHeaderActions.AddAction(new HeaderAction { Text = GetString("Task_List.RunNow"), EventName = TASKS_RUN, Enabled = SchedulingHelper.EnableScheduler && (!usesTimer || SchedulingTimer.TimerExists(SiteInfo.SiteName)), ButtonStyle = ButtonStyle.Default }); } // Force action buttons to cause full postback so that tasks can be properly executed in global.asax ControlsHelper.RegisterPostbackControl(listElem); ControlsHelper.RegisterPostbackControl(rightHeaderActions); if (ControlsHelper.CausedPostBack(btnRefresh)) { // Update content after refresh pnlUpdate.Update(); } }
private TabItem Tabs_OnTabCreated(UIElementInfo element, TabItem tab, int tabIndex) { // Add SiteId parameter to each tab if (!string.IsNullOrEmpty(tab.RedirectUrl)) { tab.RedirectUrl = URLHelper.AddParameterToUrl(tab.RedirectUrl, "siteId", SiteID.ToString()); } return(tab); }
protected void Page_Load(object sender, EventArgs e) { frm.FrameHeight = TabsBreadHeadFrameHeight; frm.HeaderUrl = URLHelper.AddParameterToUrl(frm.HeaderUrl, "siteid", SiteID.ToString()); if (IsSiteManager) { frm.FrameHeight = TabsBreadFrameHeight; frm.HeaderUrl = URLHelper.AddParameterToUrl(frm.HeaderUrl, "issitemanager", "1"); } }
string[] Tabs_OnTabCreated(CMS.SiteProvider.UIElementInfo element, string[] parameters, int tabIndex) { // Add SiteId parameter to each tab if (parameters.Length > 2) { parameters[2] = URLHelper.AddParameterToUrl(parameters[2], "siteId", SiteID.ToString()); } return(parameters); }
private string GetModelSql(string id) { string re = @" SELECT @ReturnValue = 0 SET @MMID=CONVERT(BIGINT,@MMID)+6 EXEC @return_value = [dbo].[proc_K_ModelManageSave] @TranType = N'NEW', @ID = @MMID, "; ModelManage mmObj = new ModelManage(); DataTable dt = mmObj.GetList("ONE", Utils.getOneParams(id)); if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; string[] arr = GetTableAction(dr["TableName"].ToString()); re += GetFieldValue(dr["MenuNo"].ToString(), "N''", "MenuNo"); re += GetFieldValue(SiteID.ToString(), "1", "SiteID"); re += GetFieldValue(dr["Title"].ToString(), "N''", "Title"); re += GetFieldValue(dr["TableName"].ToString(), "N''", "TableName"); re += GetFieldValue(dr["ModuleID"].ToString(), "NULL", "ModuleID"); re += GetFieldValue(dr["SysField"].ToString(), "N''", "SysField"); re += GetFieldValue(dr["ListLink"].ToString(), "N''", "ListLink"); re += GetFieldValue(dr["ListButton"].ToString(), "N''", "ListButton"); re += GetFieldValue(dr["OperationColumn"].ToString(), "N''", "OperationColumn"); re += GetFieldValue(dr["CustomCol"].ToString(), "N''", "CustomCol"); re += GetFieldValue(dr["Memo"].ToString(), "N''", "Memo"); re += "@Orders=@MMORDERS,\r\n"; re += GetFieldValue(dr["IsEnable"].ToString(), "true", "IsEnable"); re += GetFieldValue(dr["IsDel"].ToString(), "false", "IsDel"); re += GetFieldValue(dr["IsHtml"].ToString(), "false", "IsHtml"); re += GetFieldValue(dr["IsOrderEdit"].ToString(), "true", "IsOrderEdit"); re += "@ddlSql=N'" + GetTablesScript(dr["TableName"].ToString()) + "',\r\n"; re += "@dmlSql=N'',\r\n"; re += "@operName=N'" + arr[1] + "',\r\n"; re += "@operTitle=N'" + arr[0] + "',\r\n"; re += "@operCount=" + arr[2] + ",\r\n"; re += GetFieldValue(dr["IsListContentClip"].ToString(), "true", "IsListContentClip"); re += GetFieldValue(dr["DeliverAndSearchUrlParam"].ToString(), "NULL", "DeliverAndSearchUrlParam"); re += GetFieldValue(dr["FieldFromUrlParamValue"].ToString(), "NULL", "FieldFromUrlParamValue"); re += GetFieldValue(dr["OperationColumnWidth"].ToString(), "N''", "OperationColumnWidth"); re += GetFieldValue(dr["ConfigMan"].ToString(), "N'admin'", "ConfigMan"); re += GetFieldValue(dr["NotSearchField"].ToString(), "NULL", "NotSearchField"); re += GetFieldValue(dr["BackDeliverUrlParam"].ToString(), "'NodeCode'", "BackDeliverUrlParam"); re += GetFieldValue(dr["CommonField"].ToString(), "N''", "CommonField"); re += GetFieldValue(dr["IsSub"].ToString(), "false", "IsSub"); re += GetFieldValue(dr["SubModelGroupID"].ToString(), "NULL", "SubModelGroupID"); } re += "@ReturnValue = @ReturnValue OUTPUT\r\n"; re += "IF @ReturnValue=1\r\n"; re += "BEGIN\r\n"; return(re); }
/// <summary> /// Redirects to the new product page. /// </summary> private void RedirectToNewProduct() { string url = "Product_New.aspx"; url = URLHelper.AddParameterToUrl(url, "siteId", SiteID.ToString()); url = URLHelper.AddParameterToUrl(url, "categoryId", OptionCategoryID.ToString()); url = URLHelper.AddParameterToUrl(url, "parentNodeId", ParentNodeID.ToString()); url = URLHelper.AddParameterToUrl(url, "classId", DataClassID.ToString()); url = URLHelper.AddParameterToUrl(url, "saved", "1"); URLHelper.Redirect(url); }
/// <summary> /// Handles the UniGrid's OnAction event. /// </summary> /// <param name="actionName">Name of item (button) that throws event</param> /// <param name="actionArgument">ID (value of Primary key) of corresponding data row</param> protected void UniGrid_OnAction(string actionName, object actionArgument) { if (actionName.ToLowerInvariant() == "edit") { string editUrl = "Product_Edit_VolumeDiscount_Edit.aspx"; editUrl = URLHelper.AddParameterToUrl(editUrl, "productID", ProductID.ToString()); editUrl = URLHelper.AddParameterToUrl(editUrl, "volumeDiscountID", Convert.ToString(actionArgument)); editUrl = URLHelper.AddParameterToUrl(editUrl, "siteId", SiteID.ToString()); editUrl = URLHelper.AddParameterToUrl(editUrl, "dialog", QueryHelper.GetString("dialog", "0")); URLHelper.Redirect(UrlResolver.ResolveUrl(AddNodeIDParameterToUrl(editUrl))); } }
/// <summary> /// Returns parameters according to the upload mode. /// </summary> private string GetModeParameters() { string[] args; if (MediaLibraryID > 0) { // MediaLibrary mode args = new[] { "MediaLibraryID", MediaLibraryID.ToString(), "MediaFolderPath", MediaFolderPath, "MediaFileID", MediaFileID.ToString(), "IsMediaThumbnail", IsMediaThumbnail.ToString(), "MediaFileName", MediaFileName }; return("MediaLibraryArgs=" + GetArgumentsString(args, UploaderHelper.MEDIA_LIBRARY_ARGS_HASHING_PURPOSE)); } if (ObjectID > 0) { // MetaFile mode args = new[] { "MetaFileID", MetaFileID.ToString(), "ObjectID", ObjectID.ToString(), "SiteID", SiteID.ToString(), "ObjectType", ObjectType, "Category", Category }; return("MetaFileArgs=" + GetArgumentsString(args, UploaderHelper.META_FILE_ARGS_HASHING_PURPOSE)); } if ((DocumentID > 0) || (FormGUID != Guid.Empty)) { // Attachment mode args = new[] { "DocumentID", DocumentID.ToString(), "DocumentParentNodeID", DocumentParentNodeID.ToString(), "NodeClassName", NodeClassName, "AttachmentGUIDColumnName", AttachmentGUIDColumnName, "AttachmentGUID", AttachmentGUID.ToString(), "AttachmentGroupGUID", AttachmentGroupGUID.ToString(), "FormGUID", FormGUID.ToString(), "IsFieldAttachment", mIsFiledAttachment.ToString(), "FullRefresh", FullRefresh.ToString() }; return("AttachmentArgs=" + GetArgumentsString(args, UploaderHelper.ATTACHEMENT_ARGS_HASHING_PURPOSE)); } return(String.Empty); }
/// <summary> /// Initializes the master page. /// </summary> private void InitMasterPage() { string titleText = ""; string productText; // Initialize creation of new product option if (OptionCategoryID > 0) { productText = GetString("product_new.newproductoption"); } // Initialize creation of new product else { if (ParentNodeID > 0) { titleText = GetString((newObjectSiteId > 0) ? "com_sku_edit_general.newitemcaption" : "com.product.newglobal"); } else { titleText = GetString((newObjectSiteId > 0) ? "com.sku.newsku" : "com.sku.newglobalsku"); } productText = titleText; } // Set breadcrumbs if (OptionCategoryID > 0) { var productListUrl = "~/CMSModules/Ecommerce/Pages/Tools/ProductOptions/OptionCategory_Edit_Options.aspx"; productListUrl = URLHelper.AddParameterToUrl(productListUrl, "siteId", SiteID.ToString()); productListUrl = URLHelper.AddParameterToUrl(productListUrl, "categoryId", OptionCategoryID.ToString()); PageBreadcrumbs.AddBreadcrumb(new BreadcrumbItem { Text = GetString("product_new.productoptionslink"), RedirectUrl = ResolveUrl(productListUrl), }); PageBreadcrumbs.AddBreadcrumb(new BreadcrumbItem { Text = FormatBreadcrumbObjectName(productText, newObjectSiteId) }); } else { EnsureProductBreadcrumbs(PageBreadcrumbs, productText, false, DisplayTreeInProducts, false); } PageTitle.TitleText = titleText; }
public override string ToString() { if (Site.Structures.Count < 10) { return(Site + " - " + SiteID); } if (Site.Structures.Count < 100) { return(Site + " - " + SiteID.ToString().PadLeft(2, '0')); } return(Site + " - " + SiteID.ToString().PadLeft(3, '0')); }
public void oparate() { UserGroup BllUserG = new UserGroup(); string userId = LoginInfoHelper.GetLoginAccountId(Session, Response); dtUserGroup = BllUserG.GetList("ALL", Utils.getOneParams(SiteID.ToString())).Tables[0]; DataTable opdt = dtUserGroup.Copy(); if (userId != "0") { DataTable dt = BllUserG.GetList("LOGINUSERGROP", Utils.getTwoParams(SiteID.ToString(), userId)).Tables[0]; ourNumCode = dt.Rows[0]["numCode"].ToString(); } string temp_str = ""; int numCode = 0; string strCode = ""; for (int i = 0; i < opdt.Rows.Count; i++) { strCode = opdt.Rows[i]["numCode"].ToString(); if (strCode.IndexOf(ourNumCode) == 0) { numCode = strCode.Length / 3; if (numCode == 1) { } else { for (int p = 1; p < numCode; p++) { if (p == numCode - 1) { temp_str = temp_str + "├"; } else { temp_str = temp_str + " "; } } } opdt.Rows[i]["UserGroupName"] = temp_str + opdt.Rows[i]["UserGroupName"].ToString(); temp_str = ""; } else { opdt.Rows[i].Delete(); } } }
public override void Select(MainForm frm) { frm.grpStructure.Text = ToString(); frm.grpStructure.Show(); frm.lblStructureID.Text = SiteID.ToString(); frm.lblStructureSite.Data = Site; if (CreatedEvent != null) { frm.lblStructureCreatedSiteCiv.Data = CreatedEvent.SiteCiv; frm.lblStructureCreatedCiv.Data = CreatedEvent.Civ; frm.lblStructureCreatedSite.Data = CreatedEvent.Site; frm.lblStructureCreatedTime.Data = CreatedEvent; frm.lblStructureCreatedTime.Text = CreatedEvent.Time.ToString(); } frm.grpStructureCreated.Visible = CreatedEvent != null; if (RazedEvent != null) { frm.lblStructureRazedCiv.Data = RazedEvent.Civ; frm.lblStructureRazedSite.Data = RazedEvent.Site; frm.lblStructureRazedTime.Data = RazedEvent; frm.lblStructureRazedTime.Text = RazedEvent.Time.ToString(); } frm.grpStructureRazed.Visible = RazedEvent != null; frm.lstStructureEvents.Items.Clear(); if (Events != null) { frm.lstStructureEvents.Items.AddRange(Events.ToArray()); } frm.grpStructureEvents.Visible = frm.lstStructureEvents.Items.Count > 0; frm.lstStructureEntombedHF.Items.Clear(); if (ChangeHFBodyStateEvents != null) { foreach (var changeHfBodyStateEvent in ChangeHFBodyStateEvents) { if (changeHfBodyStateEvent.BodyState == "entombed at site") { frm.lstStructureEntombedHF.Items.Add(changeHfBodyStateEvent.HF); } } } frm.grpStructureEntombedHF.Visible = frm.lstStructureEntombedHF.Items.Count > 0; Program.MakeSelected(frm.tabStructure, frm.lstStructure, this); }
protected void Page_Load(object sender, System.EventArgs e) { //If no site_id was passed, then redirect back to the homepage string site_id = Request.QueryString["site_id"]; if (!string.IsNullOrEmpty(site_id)) { SiteID = Convert.ToInt32(site_id); } else { Response.Redirect(Config.SIMSURL + "SIMSWSCHome.aspx"); } //Using the passed site_id, setup the site data element, and reset the office and wsc to match that of the current site currSHA = db.SHAs.Where(p => p.site_id == SiteID).FirstOrDefault(); OfficeID = (int)currSHA.Site.office_id; WSCID = (int)db.Offices.Where(p => p.office_id == OfficeID).FirstOrDefault().wsc_id; //--BASIC PAGE SETUP-------------------------------------------------------------------- Response.Cache.SetCacheability(HttpCacheability.NoCache); ph1.Title = "Manage Site Hazard Analysis"; ph1.SubTitle = currSHA.Site.site_no + " " + db.vSITEFILEs.FirstOrDefault(s => s.site_no == currSHA.Site.site_no && s.agency_cd == currSHA.Site.agency_cd).station_nm; if (!Page.IsPostBack) { //Clear session state variable Session["btnpressed"] = ""; //--PAGE ACCESS SECTION------------------------------------------------------------- if (user.IsSuperUser || user.WSCID.Contains(WSCID)) { pnlHasAccess.Visible = true; } else { Response.Redirect("SHAView.aspx?site_id=" + SiteID.ToString()); pnlHasAccess.Visible = false; } //--END PAGE ACCESS SECTION--------------------------------------------------------- hlPrintSHA.NavigateUrl = "SHAView.aspx?site_id=" + SiteID.ToString(); PopulatePagePanels(); } //-------------------------------------------------------------------------------------- //Moved out of PopulatePagePanels routine for AJAX to work SetupMeasurementSpecificPanel(); }
protected void Page_Load(object sender, EventArgs e) { string headerUrl = "Configuration_Header.aspx"; if (SiteID != CMSContext.CurrentSiteID) { headerUrl += "?SiteId=" + SiteID.ToString(); } configHeader.Attributes["src"] = headerUrl; if (CultureHelper.IsUICultureRTL()) { ControlsHelper.ReverseFrames(colsFrameset); } }
/// <summary> /// Initializes the master page elements. /// </summary> private void InitializeMasterPage() { string newUrl = "~/CMSModules/Ecommerce/Pages/Tools/Products/Product_Edit_VolumeDiscount_Edit.aspx"; newUrl = URLHelper.AddParameterToUrl(newUrl, "ProductID", ProductID.ToString()); newUrl = URLHelper.AddParameterToUrl(newUrl, "siteId", SiteID.ToString()); newUrl = URLHelper.AddParameterToUrl(newUrl, "dialog", QueryHelper.GetString("dialog", "0")); // Set new volume discount action CurrentMaster.HeaderActions.ActionsList.Add(new HeaderAction { Text = GetString("Product_Edit_VolumeDiscount_List.NewItemCaption"), RedirectUrl = AddNodeIDParameterToUrl(newUrl) }); }
protected TabItem Tabs_OnTabCreated(UIElementInfo element, TabItem tab, int tabIndex) { // Global objects tab will be displayed only to global admin if (!currentUser.IsGlobalAdministrator && (element.ElementName.ToLowerCSafe() == "configuration.settings.globalobjects")) { return(null); } // Add SiteId parameter to each tab if (!string.IsNullOrEmpty(tab.RedirectUrl)) { tab.RedirectUrl = URLHelper.AddParameterToUrl(tab.RedirectUrl, "siteId", SiteID.ToString()); } return(tab); }
/// <summary> /// Generates complete filter where condition. /// </summary> private string GenerateWhereCondition() { // Get mode from viewstate EnsureFilterMode(); string whereCond = ""; // Create WHERE condition for basic filter if (!String.IsNullOrEmpty(drpEventLogType.Value.ToString())) { whereCond = "EventType='" + drpEventLogType.Value + "'"; } whereCond = SqlHelperClass.AddWhereCondition(whereCond, fltSource.GetCondition()); whereCond = SqlHelperClass.AddWhereCondition(whereCond, fltEventCode.GetCondition()); whereCond = SqlHelperClass.AddWhereCondition(whereCond, fltTimeBetween.GetCondition()); // Create WHERE condition for advanced filter (id needed) if (isAdvancedMode) { whereCond = SqlHelperClass.AddWhereCondition(whereCond, fltUserName.GetCondition()); whereCond = SqlHelperClass.AddWhereCondition(whereCond, fltIPAddress.GetCondition()); whereCond = SqlHelperClass.AddWhereCondition(whereCond, fltDocumentName.GetCondition()); whereCond = SqlHelperClass.AddWhereCondition(whereCond, fltMachineName.GetCondition()); whereCond = SqlHelperClass.AddWhereCondition(whereCond, fltEventURL.GetCondition()); whereCond = SqlHelperClass.AddWhereCondition(whereCond, fltEventURLRef.GetCondition()); whereCond = SqlHelperClass.AddWhereCondition(whereCond, fltDescription.GetCondition()); whereCond = SqlHelperClass.AddWhereCondition(whereCond, fltUserAgent.GetCondition()); } // Append site condition if siteid given if (!String.IsNullOrEmpty(whereCond) && (SiteID >= 0)) { whereCond += " AND "; } if (SiteID > 0) { whereCond += " (SiteID=" + SiteID.ToString() + ")"; } else if (SiteID == 0) { whereCond += " (SiteID IS NULL)"; } return(whereCond); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { BindDll(); hdSiteID.Value = SiteID.ToString(); ViewState["StrPageParams"] = StrPageParams; #region 初始化页面 if (this.Action == "EDIT") { span1.Visible = false; //按钮文本为“修改” BtnSave.Text = Utils.GetResourcesValue("Common", "Update"); DataTable DtAccount = BllAccount.GetList("ONE", Utils.getOneParams(this.UserID)); if (DtAccount.Rows.Count > 0) //如果当前行存在,则绑定行 { foreach (DataRow dr in DtAccount.Rows) { txtAccountName.Value = dr["UserName"].ToString(); hidLogTitle.Value = dr["UserName"].ToString(); txtAccountName.Disabled = true; txtAccountOrder.Text = dr["Orders"].ToString(); RBL_IsValid.SelectedValue = dr["IsValid"].ToString(); } } //选择ddlUserGroup DataTable dtAccInfo = BllAccount.GetList("GETACCINFOBYSITE", Utils.getTwoParams(UserID, SiteID.ToString())); if (dtAccInfo.Rows.Count > 0) { ddlUserGroup.SelectedValue = dtAccInfo.Rows[0]["UserGroupCode"].ToString(); this.hdUserGropOld.Value = dtAccInfo.Rows[0]["UserGroupCode"].ToString(); } } if (this.Action == "NEW") { //判断权限 BtnSave.Visible = IsHaveRightByOperCode("Edit"); //按钮文本为“添加” Utils.GetResourcesValue("Common", "Add"); } #endregion } }