protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region Script Resource ScriptReference scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/WorkGroupInfoScriptResource.js"; string[] cultures = ConfigurationManager.AppSettings["SupportLanguages"].ToString().Split(','); scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); scriptManager.Scripts.Add(scriptReference); #endregion int siteID = CommonBLL.ValidateSiteID(Request); if (siteID == 0) { Response.Redirect(ConfigurationManager.AppSettings["NoAccessPage"].ToString()); } int userID = this.CurrentUser.UserID; int accessLevelID = CommonBLL.GetAccessLevelID(this.CurrentUser.AccessLevel); ValidateUserPrivileges(siteID, accessLevelID); string basePath = ConfigurationManager.AppSettings["MaintBasePath"].ToString().TrimEnd('/'); string webServicePath = ConfigurationManager.AppSettings["MaintWebServicePath"].Trim(); string imagePath = ConfigurationManager.AppSettings["MaintImagePath"].TrimEnd('/') + "/Styles/Images"; UserControls.PagerData workGroupPagerData = new UserControls.PagerData(); workGroupPagerData.PageIndex = 0; workGroupPagerData.PageSize = int.Parse(hdnWorkGroupPageSize.Value.ToString()); workGroupPagerData.CurrentPage = currentPage; workGroupPagerData.SelectMethod = "LoadWorkGroupList"; workGroupPagerData.ServicePath = webServicePath; workGroupPagerData.SiteID = siteID; workGroupPagerData.UserID = userID; workGroupPagerData.LoadControlID = btnUploadExcel.ClientID; workGroupPagerData.AccessLevelID = accessLevelID; workGroupPagerData.PageAccessRights = PageAccessRights.ToString(); if (PageAccessRights.ToString() == AccessType.FULL_ACCESS.ToString()) { uploadFile.Attributes.Add("onchange", "javascript:UploadWorkGroupInfo();return false;"); } else { btnUploadExcel.Attributes.Add("disabled", "disabled"); } sortWorkGroup.Attributes.Add("onclick", "javascript:SortByWorkGroupName('" + sortWorkGroup.ClientID + "','MasterDataName');"); Page.ClientScript.RegisterStartupScript(GetType(), "LoadWorkGroupInfo", "LoadWorkGroupInfo(" + (new JavaScriptSerializer()).Serialize(workGroupPagerData) + ",'" + basePath + "','" + imagePath + "');", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region Script Resource ScriptReference scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/ToolsScriptResource.js"; string[] cultures = ConfigurationManager.AppSettings["SupportLanguages"].ToString().Split(','); scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); scriptManager.Scripts.Add(scriptReference); #endregion int siteID = CommonBLL.ValidateSiteID(Request); int userID = this.CurrentUser.UserID; int accessLevelID = CommonBLL.GetAccessLevelID(this.CurrentUser.AccessLevel); AccessType access = ValidateUserPrivileges(siteID, accessLevelID); AccessType approveAccess = CommonBLL.ValidateUserPrivileges(siteID, this.CurrentUser.SiteID, this.CurrentUser.UserID, accessLevelID, Convert.ToInt32(Language_Resources.MaintenancePageID_Resource.taskGroupApprove)); Vegam_MaintenanceService.BasicParam basicParam = new Vegam_MaintenanceService.BasicParam(); basicParam.SiteID = siteID; basicParam.UserID = userID; basicParam.AccessLevelID = accessLevelID; string basePath = ConfigurationManager.AppSettings["MaintBasePath"].ToString().TrimEnd('/'); string webServicePath = ConfigurationManager.AppSettings["MaintWebServicePath"].Trim(); string uploaderPath = ConfigurationManager.AppSettings["uploaderPath"].ToString().Trim('/'); string imagePath = ConfigurationManager.AppSettings["ToolsImagePath"].Trim() + siteID + "/Thumbnail"; string imageDefaultPath = ConfigurationManager.AppSettings["MaintImagePath"].TrimEnd('/') + "/Styles/Images/deafult.png"; UserControls.PagerData pagerData = new UserControls.PagerData(); pagerData.PageIndex = 0; pagerData.PageSize = int.Parse(hdnPageSize.Value.ToString()); pagerData.SelectMethod = "LoadToolsInfo"; pagerData.ServicePath = webServicePath; pagerData.LoadControlID = hdnPageSize.ClientID; pagerData.SiteID = siteID; pagerData.UserID = userID; pagerData.PageAccessRights = access.ToString(); thDescription.Attributes.Add("onclick", "javascript:SortTabs('" + thDescription.ClientID + "','ToolsDescription');"); Page.ClientScript.RegisterStartupScript(GetType(), "LoadToolsInfoPage", "LoadToolsInfoPage(" + (new JavaScriptSerializer()).Serialize(pagerData) + "," + (new JavaScriptSerializer()).Serialize(basicParam) + ",'" + basePath + "','" + webServicePath + "','" + uploaderPath + "','" + imageDefaultPath + "','" + imagePath + "','" + hasDeleteAccess + "','" + hasEditAccess + "');", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region Script Resource ScriptReference scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/WorkOrderResourceViewCalendarScriptResource.js"; string[] cultures = ConfigurationManager.AppSettings["SupportLanguages"].ToString().Split(','); scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); scriptManager.Scripts.Add(scriptReference); #endregion int siteID = CommonBLL.ValidateSiteID(Request); if (siteID == 0) { Response.Redirect(ConfigurationManager.AppSettings["NoAccessPage"].ToString()); } int userID = this.CurrentUser.UserID; int accessLevelID = CommonBLL.GetAccessLevelID(this.CurrentUser.AccessLevel); ValidateUserPrivileges(siteID, accessLevelID); AccessType viewWorkOrderInfo = GetViewWorkOrderInfoPermission(siteID, accessLevelID); string servicePath = ConfigurationManager.AppSettings["MaintWebServicePath"].TrimEnd('/'); string maintBasePath = ConfigurationManager.AppSettings["MaintBasePath"].TrimEnd('/').ToString(); int currentDate = BLL.MaintenanceBLL.GetSiteCurrentDateTime(siteID).CurrentDate; BasicParam basicParam = new BasicParam(); basicParam.SiteID = siteID; basicParam.UserID = userID; basicParam.AccessLevelID = accessLevelID; basicParam.LanguageCode = this.CurrentUser.LanguageCode; UserControls.PagerData resourceViewpagerData = new UserControls.PagerData(); resourceViewpagerData.PageIndex = 0; resourceViewpagerData.PageSize = int.Parse(hdnResourceViewPageSize.Value.ToString()); resourceViewpagerData.CurrentPage = currentPage; resourceViewpagerData.SelectMethod = "LoadResourceViewTimeline"; resourceViewpagerData.ServicePath = servicePath; resourceViewpagerData.SiteID = siteID; resourceViewpagerData.UserID = userID; resourceViewpagerData.AccessLevelID = accessLevelID; resourceViewpagerData.PageAccessRights = viewWorkOrderInfo.ToString(); Page.ClientScript.RegisterStartupScript(GetType(), "LoadResourceViewBasicInfo", "LoadResourceViewBasicInfo(" + (new JavaScriptSerializer()).Serialize(basicParam) + "," + (new JavaScriptSerializer()).Serialize(resourceViewpagerData) + ", '" + servicePath + "'," + currentDate + ",'" + maintBasePath + "');", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region Script_Resource_Refernce ScriptReference scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/DynamicGridScriptResource.js"; string[] cultures = ConfigurationManager.AppSettings["SupportLanguages"].ToString().Split(','); scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); ScriptManager1.Scripts.Add(scriptReference); scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/EquipmentModelScriptResource.js"; scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); ScriptManager1.Scripts.Add(scriptReference); #endregion userID = this.CurrentUser.UserID; siteID = this.CurrentUser.SiteID; accessLevelID = CommonBLL.GetAccessLevelID(this.CurrentUser.AccessLevel); AccessType accessType = ValidateUserPrivileges(siteID, accessLevelID); Vegam_MaintenanceService.BasicParam basicParam = new Vegam_MaintenanceService.BasicParam(); basicParam.SiteID = siteID; basicParam.UserID = userID; string usercontrolPath = ConfigurationManager.AppSettings["MaintUserControls"].ToString().TrimEnd('/'); string webServicePath = ConfigurationManager.AppSettings["MaintWebServicePath"].ToString().TrimEnd('/'); string basePath = ConfigurationManager.AppSettings["MaintBasePath"].ToString().TrimEnd('/'); SiteDateTimeFormatInfo dateTimeForamt = BLL.MaintenanceBLL.GetSiteDateTimeFormatInfo(siteID); UserControls.DynamicGridControl dynamicGridControl = (UserControls.DynamicGridControl)Page.LoadControl(usercontrolPath + "/DynamicGridControl.ascx"); divDynamicGridContent.Controls.Add(dynamicGridControl); #region Feature Equipment Model List <string> featureName = new List <string>(); featureName.Add(Language_Resources.MaintenanceFeatures.equipmentModels); int featureID = 0; List <ipas_UserService.SiteFeatureInfo> featurePageToLoad = BLL.UserBLL.GetCompanyFeatureConfiguredURL(siteID, 0, featureName); if (featurePageToLoad.Count > 0) { ipas_UserService.SiteFeatureInfo result = featurePageToLoad.SingleOrDefault(x => x.FeatureName == Language_Resources.MaintenanceFeatures.equipmentModels); if (result != null) { featureID = result.FeatureID; } } #endregion UserControls.PagerData pagerData = new UserControls.PagerData(); pagerData.PageIndex = 0; pagerData.PageSize = int.Parse(hdnPageSize.Value.ToString()); pagerData.CurrentPage = currentPage; pagerData.ServicePath = webServicePath; pagerData.SelectMethod = "LoadDynamicGridContent"; pagerData.LoadControlID = uploadFile.ClientID; pagerData.SiteID = siteID; pagerData.UserID = userID; pagerData.AccessLevelID = accessLevelID; pagerData.PlantDateFormat = dateTimeForamt.DateFormat; pagerData.PlantTimeFormat = dateTimeForamt.TimeFormat; pagerData.PageAccessRights = accessType.ToString(); UserControls.DynamicGridProperties dynamicGridProperties = new UserControls.DynamicGridProperties(); dynamicGridProperties.GridType = UserControls.DynamicGridType.Table; dynamicGridProperties.FeatureID = featureID; dynamicGridProperties.DatePickerFormat = CommonBLL.GetDatePickerDateFormat(dateTimeForamt.DateFormat); dynamicGridProperties.TableHeaderText = Language_Resources.EquipmentModel_Resource.listOfEquipmentModel; dynamicGridProperties.ImagePath = ConfigurationManager.AppSettings["MaintImagePath"].TrimEnd('/') + "/Styles/Images"; dynamicGridProperties.PagerData = pagerData; dynamicGridProperties.WebServiceName = "Vegam_MaintenanceService.asmx"; dynamicGridProperties.ExcelSheetName = "EquipmentModelList"; if (accessType == AccessType.FULL_ACCESS) { uploadFile.Attributes.Add("onchange", "javascript:UploadMeasuringPointInfo(); return false;"); btnAddNewEquipmentModel.Attributes.Add("onclick", "javascript:AddNewEquipmentModel();return false;"); } else { btnUploadExcel.Attributes.Add("disabled", "disabled"); btnAddNewEquipmentModel.Attributes.Add("disabled", "disabled"); } string equipmentModelImagePath = ConfigurationManager.AppSettings["EquipmentModelImagePath"].TrimEnd('/'); Page.ClientScript.RegisterStartupScript(GetType(), "LoadEquipmentModelListPage", "LoadEquipmentModelListPage(" + (new JavaScriptSerializer()).Serialize(dynamicGridProperties) + ",'" + basePath + "','" + equipmentModelImagePath + "')", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region Script Resource ScriptReference scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/FunctionalLocationScriptResource.js"; string[] cultures = ConfigurationManager.AppSettings["SupportLanguages"].ToString().Split(','); scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); scriptManager.Scripts.Add(scriptReference); #endregion int siteID = CommonBLL.ValidateSiteID(Request); if (siteID == 0) { Response.Redirect(ConfigurationManager.AppSettings["NoAccessPage"].ToString()); } int userID = this.CurrentUser.UserID; int accessLevelID = CommonBLL.GetAccessLevelID(this.CurrentUser.AccessLevel); int locationID = 0; if (Request.QueryString["flid"] != null && Request.QueryString["flid"].Trim().Length > 0) { locationID = Convert.ToInt32(Request.QueryString["flid"].Trim()); } string filterLocationIds = string.Empty; if (Request.QueryString["fids"] != null && Request.QueryString["fids"].Trim().Length > 0) { filterLocationIds = Request.QueryString["fids"].Trim(); } AccessType access = ValidateUserPrivileges(siteID, accessLevelID); //btnClose.Attributes.Add("onclick", "javascript:ViewFLocationList(" + (new JavaScriptSerializer()).Serialize(filterLocationIds) + ");return false;"); if (locationID == 0) { btnAddUpdateFLocation.InnerText = Language_Resources.FunctionalLocation_Resource.saveAndAddMore.ToString(); } else { btnAddUpdateFLocation.InnerText = Language_Resources.FunctionalLocation_Resource.update.ToString(); } if (access == AccessType.FULL_ACCESS && locationID == 0) { btnAddUpdateFLocation.Attributes.Add("onclick", "javascript:AddUpdateFunctionalLoaction(false);return false;"); } else if (locationID != 0 && (access == AccessType.FULL_ACCESS || access == AccessType.EDIT_ONLY)) { btnAddUpdateFLocation.Attributes.Add("onclick", "javascript:AddUpdateFunctionalLoaction(true);return false;"); } else { btnAddUpdateFLocation.Attributes.Add("disabled", "disabled"); } string webServicePath = ConfigurationManager.AppSettings["MaintWebServicePath"]; string basePath = ConfigurationManager.AppSettings["MaintBasePath"].ToString().TrimEnd('/'); string uploaderPath = ConfigurationManager.AppSettings["uploaderPath"].ToString().Trim('/'); string fLocationImgPath = ConfigurationManager.AppSettings["FunctionalLocImagePath"].ToString().Trim('/') + "/" + siteID + "/" + "Thumbnail"; string imageDefaultPath = ConfigurationManager.AppSettings["MaintImagePath"].TrimEnd('/') + "/Styles/Images/FLocation.png"; BasicParam basicParam = new BasicParam(); basicParam.SiteID = siteID; basicParam.UserID = userID; basicParam.AccessLevelID = accessLevelID; basicParam.LanguageCode = this.CurrentUser.LanguageCode; UserControls.PagerData pagerData = new UserControls.PagerData(); pagerData.PageIndex = 0; pagerData.PageSize = int.Parse(hdnFLocationPageSize.Value.ToString()); pagerData.SelectMethod = "LoadLocationInfo"; pagerData.ServicePath = webServicePath; pagerData.SiteID = siteID; pagerData.UserID = userID; pagerData.AccessLevelID = accessLevelID; pagerData.LoadControlID = btnAddUpdateFLocation.ClientID; pagerData.PageAccessRights = access.ToString(); sortFLocation.Attributes.Add("onclick", "javascript:SortByFLocationName('" + sortFLocation.ClientID + "','LocationName');"); ScriptManager.RegisterStartupScript(this, this.GetType(), "FunctionalLocationBasicInfo", "javascript:FunctionalLocationBasicInfo(" + (new JavaScriptSerializer()).Serialize(pagerData) + "," + (new JavaScriptSerializer()).Serialize(basicParam) + ",'" + basePath + "','" + webServicePath + "','" + imageDefaultPath + "','" + uploaderPath + "','" + locationID + "','" + fLocationImgPath + "','" + hasDeleteAccess + "','" + hasEditAccess + "','" + btnAddUpdateFLocation.ClientID + "');", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region Script Resource ScriptReference scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/FunctionalLocationScriptResource.js"; string[] cultures = ConfigurationManager.AppSettings["SupportLanguages"].ToString().Split(','); scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); scriptManager.Scripts.Add(scriptReference); #endregion int siteID = CommonBLL.ValidateSiteID(Request); if (siteID == 0) { Response.Redirect(ConfigurationManager.AppSettings["NoAccessPage"].ToString()); } string filterLocationIds = string.Empty; if (Request.QueryString["fids"] != null && Request.QueryString["fids"].Trim().Length > 0) { filterLocationIds = Request.QueryString["fids"].Trim(); } int userID = this.CurrentUser.UserID; int accessLevelID = CommonBLL.GetAccessLevelID(this.CurrentUser.AccessLevel); AccessType accessType = ValidateUserPrivileges(siteID, accessLevelID); string basePath = ConfigurationManager.AppSettings["MaintBasePath"].ToString().TrimEnd('/'); string webServicePath = ConfigurationManager.AppSettings["MaintWebServicePath"].Trim(); string imgFunctionalLocProfilePath = ConfigurationManager.AppSettings["MaintImagePath"].TrimEnd('/') + "/Styles/Images/FLocation.png"; string uploaderPath = ConfigurationManager.AppSettings["uploaderPath"].ToString().Trim('/'); UserControls.PagerData pagerData = new UserControls.PagerData(); pagerData.PageIndex = 0; pagerData.PageSize = int.Parse(hdnPageSize.Value.ToString()); pagerData.SelectMethod = "LoadFunctionalLocationsInfo"; pagerData.ServicePath = webServicePath; pagerData.SiteID = siteID; pagerData.UserID = userID; pagerData.AccessLevelID = accessLevelID; pagerData.LoadControlID = btnUploadExcel.ClientID; pagerData.PageAccessRights = accessType.ToString(); btnFLocationName.Attributes.Add("onclick", "javascript:SortTabs('" + btnFLocationName.ClientID + "','FunctionalLoc');"); btnUpdateOn.Attributes.Add("onclick", "javascript:SortTabs('" + btnUpdateOn.ClientID + "','UpdateOn');"); if (accessType == AccessType.FULL_ACCESS) { btnAddNewFunctionalLocation.Attributes.Add("onclick", "javascript:AddUpdateNewFunctionalLoaction(" + (new JavaScriptSerializer()).Serialize(0) + ");return false;"); uploadFile.Attributes.Add("onchange", "javascript:UploadFunctionalLocationInfo();return false;"); } else { btnAddNewFunctionalLocation.Attributes.Add("disabled", "disabled"); btnUploadExcel.Attributes.Add("disabled", "disabled"); } ScriptManager.RegisterStartupScript(this, this.GetType(), "InitFunctionalLocationInfo", "javascript:InitFunctionalLocationInfo(" + (new JavaScriptSerializer()).Serialize(pagerData) + ",'" + basePath + "','" + imgFunctionalLocProfilePath + "','" + uploaderPath + "','" + hasEditAccess + "','" + hasDeleteAccess + "'," + (new JavaScriptSerializer()).Serialize(filterLocationIds.Split(',')) + ");", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region Script Resource ScriptReference scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/EquipmentModelScriptResource.js"; string[] cultures = ConfigurationManager.AppSettings["SupportLanguages"].ToString().Split(','); scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); scriptManager.Scripts.Add(scriptReference); #endregion int siteID = CommonBLL.ValidateSiteID(Request); if (siteID == 0) { Response.Redirect(ConfigurationManager.AppSettings["NoAccessPage"].ToString()); } int userID = this.CurrentUser.UserID; int accessLevelID = CommonBLL.GetAccessLevelID(this.CurrentUser.AccessLevel); int equipmentID = 0; if (Request.QueryString["eid"] != null && Request.QueryString["eid"].Trim().Length > 0) { equipmentID = Convert.ToInt32(Request.QueryString["eid"].Trim()); } AccessType access = ValidateUserPrivileges(siteID, accessLevelID); if (equipmentID == 0 && access == AccessType.FULL_ACCESS) { btnAddUpdateEquipmentModel.Attributes.Add("onclick", "javascript:AddUpdateEquipmentModel(true);return false;"); uploadImageAccess = true; } else if (equipmentID > 0 && (access == AccessType.FULL_ACCESS || access == AccessType.EDIT_ONLY)) { btnAddUpdateEquipmentModel.Attributes.Add("onclick", "javascript:AddUpdateEquipmentModel(false);return false;"); uploadImageAccess = true; } else { btnAddUpdateEquipmentModel.Attributes.Add("disabled", "disabled"); uploadImageAccess = false; } string basePath = ConfigurationManager.AppSettings["MaintBasePath"].ToString().TrimEnd('/'); string webServicePath = ConfigurationManager.AppSettings["MaintWebServicePath"]; string uploaderPath = ConfigurationManager.AppSettings["uploaderPath"].ToString().Trim('/'); string equipmentModelImgPath = ConfigurationManager.AppSettings["EquipmentModelImagePath"].ToString().Trim('/') + "/" + siteID + "/" + "Thumbnail"; string imagePath = ConfigurationManager.AppSettings["MaintImagePath"].TrimEnd('/') + "/Styles/Images/Measuring_Point.png"; BasicParam basicParam = new BasicParam(); basicParam.SiteID = siteID; basicParam.UserID = userID; basicParam.AccessLevelID = accessLevelID; basicParam.LanguageCode = this.CurrentUser.LanguageCode; UserControls.PagerData pagerData = new UserControls.PagerData(); pagerData.PageIndex = 0; pagerData.PageSize = int.Parse(hdnModelPageSize.Value.ToString()); pagerData.SelectMethod = "LoadEquipmentModelList"; pagerData.ServicePath = webServicePath; pagerData.SiteID = siteID; pagerData.UserID = userID; pagerData.AccessLevelID = accessLevelID; pagerData.LoadControlID = btnAddUpdateEquipmentModel.ClientID; pagerData.PageAccessRights = access.ToString(); //using pager for displaying maintenance master data in configure maintenance types modal popup UserControls.PagerData maintTypePagerData = new UserControls.PagerData(); maintTypePagerData.PageIndex = 0; maintTypePagerData.PageSize = int.Parse(hdnMasterPageSize.Value.ToString()); maintTypePagerData.SelectMethod = "LoadMaintTypesInfo"; maintTypePagerData.ServicePath = webServicePath; maintTypePagerData.SiteID = siteID; maintTypePagerData.UserID = userID; maintTypePagerData.AccessLevelID = accessLevelID; maintTypePagerData.LoadControlID = btnAddUpdateEquipmentModel.ClientID; maintTypePagerData.PageAccessRights = access.ToString(); thMaintTypes.Attributes.Add("onclick", "javascript:SortMaintTypesTabs('" + thMaintTypes.ClientID + "','MasterDataName');"); sortEquipmentModel.Attributes.Add("onclick", "javascript:SortByEquipmentModelName('" + sortEquipmentModel.ClientID + "','EquipmentModelName');"); ScriptManager.RegisterStartupScript(this, this.GetType(), "EquipmentModelLoadInfo", "javascript:EquipmentModelLoadInfo(" + (new JavaScriptSerializer()).Serialize(basicParam) + "," + (new JavaScriptSerializer()).Serialize(pagerData) + "," + (new JavaScriptSerializer()).Serialize(maintTypePagerData) + ",'" + basePath + "','" + webServicePath + "','" + imagePath + "','" + uploaderPath + "','" + uploadImageAccess + "'," + equipmentID + ",'" + equipmentModelImgPath + "','" + hasFullAccess + "');", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region Script Resource ScriptReference scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/DynamicGridScriptResource.js"; string[] cultures = ConfigurationManager.AppSettings["SupportLanguages"].ToString().Split(','); scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); scriptManager.Scripts.Add(scriptReference); scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/WorkOrderOrderViewCalendarScriptResource.js"; scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); scriptManager.Scripts.Add(scriptReference); #endregion int siteID = CommonBLL.ValidateSiteID(Request); if (siteID == 0) { Response.Redirect(ConfigurationManager.AppSettings["NoAccessPage"].ToString()); } int userID = this.CurrentUser.UserID; int accessLevelID = CommonBLL.GetAccessLevelID(this.CurrentUser.AccessLevel); ValidateUserPrivileges(siteID, accessLevelID); string usercontrolPath = ConfigurationManager.AppSettings["MaintUserControls"].ToString().TrimEnd('/'); UserControls.DynamicGridControl dynamicGridControl = (UserControls.DynamicGridControl)Page.LoadControl(usercontrolPath + "/DynamicGridControl.ascx"); divDynamicGridContent.Controls.Add(dynamicGridControl); #region Feature List <string> featureName = new List <string>(); featureName.Add(Language_Resources.MaintenanceFeatures.workOrderOrderView); int featureID = 0; List <ipas_UserService.SiteFeatureInfo> featurePageToLoad = BLL.UserBLL.GetCompanyFeatureConfiguredURL(siteID, 0, featureName); if (featurePageToLoad.Count > 0) { ipas_UserService.SiteFeatureInfo result = featurePageToLoad.SingleOrDefault(x => x.FeatureName == Language_Resources.MaintenanceFeatures.workOrderOrderView); if (result != null) { featureID = result.FeatureID; } } #endregion string maintBasePath = ConfigurationManager.AppSettings["MaintBasePath"].TrimEnd('/').ToString(); SiteDateTimeFormatInfo dateTimeForamt = BLL.MaintenanceBLL.GetSiteDateTimeFormatInfo(siteID); int currentDate = BLL.MaintenanceBLL.GetSiteCurrentDateTime(siteID).CurrentDate; UserControls.PagerData pagerData = new UserControls.PagerData(); pagerData.PageIndex = 1; pagerData.PageSize = Convert.ToInt32(hdnPageSize.Value); pagerData.CurrentPage = 0; pagerData.SelectMethod = "LoadDynamicGridContent"; pagerData.ServicePath = ConfigurationManager.AppSettings["MaintWebServicePath"].TrimEnd('/'); pagerData.SiteID = siteID; pagerData.UserID = userID; pagerData.AccessLevelID = accessLevelID; pagerData.PlantDateFormat = dateTimeForamt.DateFormat; pagerData.PlantTimeFormat = dateTimeForamt.TimeFormat; UserControls.DynamicGridProperties dynamicGridProperties = new UserControls.DynamicGridProperties(); dynamicGridProperties.CurrentDate = currentDate; dynamicGridProperties.FeatureID = featureID; dynamicGridProperties.GridType = UserControls.DynamicGridType.Table; dynamicGridProperties.PagerData = pagerData; dynamicGridProperties.DatePickerFormat = CommonBLL.GetDatePickerDateFormat(dateTimeForamt.DateFormat); dynamicGridProperties.ImagePath = ConfigurationManager.AppSettings["MaintImagePath"].TrimEnd('/') + "/Styles/Images"; dynamicGridProperties.WebServiceName = "Vegam_MaintenanceService.asmx"; dynamicGridProperties.ShowGroupRowsByDefault = false; dynamicGridProperties.ExcelSheetName = "OrderViewWorkOrders"; Page.ClientScript.RegisterStartupScript(GetType(), "LoadOrderViewBasicInfo", "LoadOrderViewBasicInfo(" + (new JavaScriptSerializer()).Serialize(dynamicGridProperties) + ",'" + maintBasePath + "');", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region Script Resource ScriptReference scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/MeasurementDocumentScriptResource.js"; string[] cultures = ConfigurationManager.AppSettings["SupportLanguages"].ToString().Split(','); scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); scriptManager.Scripts.Add(scriptReference); #endregion int siteID = CommonBLL.ValidateSiteID(Request); if (siteID == 0) { Response.Redirect(ConfigurationManager.AppSettings["NoAccessPage"].ToString()); } //if loading page in edit mode int maintScheduleID = 0; if (Request.QueryString["maintscheduleid"] != null && Request.QueryString["maintscheduleid"].Trim().Length > 0) { maintScheduleID = Convert.ToInt32(Request.QueryString["maintscheduleid"].ToString().Trim()); } if (maintScheduleID > 0) { btnAdd.Text = "Update"; } int userID = this.CurrentUser.UserID; int accessLevelID = CommonBLL.GetAccessLevelID(this.CurrentUser.AccessLevel); bool hasDeleteAccess = false; bool hasEditAccess = false; AccessType accessType = ValidateUserPrivileges(siteID, accessLevelID); if (accessType == AccessType.FULL_ACCESS) { hasDeleteAccess = true; } if (accessType == AccessType.FULL_ACCESS || accessType == AccessType.EDIT_ONLY) { hasEditAccess = true; } if (accessType == AccessType.FULL_ACCESS || (maintScheduleID > 0 && accessType == AccessType.EDIT_ONLY)) { btnAdd.Attributes.Add("onclick", "javascript:AddUpdateMeasurementDocument();return false;"); } else { btnAdd.Attributes.Add("disabled", "disabled"); } if (accessType == AccessType.FULL_ACCESS) { btnActivateSchedule.Attributes.Add("onclick", "javascript:ActivateScheduleInfoCinfirm();return false;"); } else { btnActivateSchedule.Attributes.Add("disabled", "disabled"); } string basePath = ConfigurationManager.AppSettings["MaintBasePath"].ToString().TrimEnd('/'); string webServicePath = ConfigurationManager.AppSettings["MaintWebServicePath"].Trim(); //using pager for displaying maintenance types in configure maintenance types modal popup UserControls.PagerData measPointPagerData = new UserControls.PagerData(); measPointPagerData.PageIndex = 0; measPointPagerData.PageSize = int.Parse(hdnPageSize.Value.ToString()); measPointPagerData.SelectMethod = "LoadAvailableMeasuringPoints"; measPointPagerData.ServicePath = webServicePath; measPointPagerData.SiteID = siteID; measPointPagerData.UserID = userID; measPointPagerData.AccessLevelID = accessLevelID; measPointPagerData.LoadControlID = btnAdd.ClientID; measPointPagerData.PageAccessRights = accessType.ToString(); thAMFLocName.Attributes.Add("onclick", "javascript:SortMeasuringPointsTabs('" + thAMFLocName.ClientID + "','FLocationName'," + (new JavaScriptSerializer()).Serialize(true) + ");"); thAMEquipment.Attributes.Add("onclick", "javascript:SortMeasuringPointsTabs('" + thAMEquipment.ClientID + "','Equipment'," + (new JavaScriptSerializer()).Serialize(true) + ");"); thAMMeasPoint.Attributes.Add("onclick", "javascript:SortMeasuringPointsTabs('" + thAMMeasPoint.ClientID + "','MeasuringPoint'," + (new JavaScriptSerializer()).Serialize(true) + ");"); thAMCategory.Attributes.Add("onclick", "javascript:SortMeasuringPointsTabs('" + thAMCategory.ClientID + "','Category'," + (new JavaScriptSerializer()).Serialize(true) + ");"); thSMFLocName.Attributes.Add("onclick", "javascript:SortMeasuringPointsTabs('" + thSMFLocName.ClientID + "','FLocationName'," + (new JavaScriptSerializer()).Serialize(false) + ");"); thSMEquipment.Attributes.Add("onclick", "javascript:SortMeasuringPointsTabs('" + thSMEquipment.ClientID + "','Equipment'," + (new JavaScriptSerializer()).Serialize(false) + ");"); thSMMeasPoint.Attributes.Add("onclick", "javascript:SortMeasuringPointsTabs('" + thSMMeasPoint.ClientID + "','MeasuringPoint'," + (new JavaScriptSerializer()).Serialize(false) + ");"); thSMCategory.Attributes.Add("onclick", "javascript:SortMeasuringPointsTabs('" + thSMCategory.ClientID + "','Category'," + (new JavaScriptSerializer()).Serialize(false) + ");"); ScriptManager.RegisterStartupScript(this, this.GetType(), "InitMeasurementDocumentInfo", "javascript:InitMeasurementDocumentInfo(" + (new JavaScriptSerializer()).Serialize(measPointPagerData) + ",'" + basePath + "','" + maintScheduleID + "','" + hasDeleteAccess + "','" + hasEditAccess + "');", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region Script Resource ScriptReference scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/EquipmentInfoScriptResource.js"; string[] cultures = ConfigurationManager.AppSettings["SupportLanguages"].ToString().Split(','); scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); scriptManager.Scripts.Add(scriptReference); scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/JQueryCalendarScriptResource.js"; scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); scriptManager.Scripts.Add(scriptReference); #endregion int fLocationID = 0; int equipmentID = 0; int siteID = CommonBLL.ValidateSiteID(Request); int userID = this.CurrentUser.UserID; if (siteID == 0) { Response.Redirect(ConfigurationManager.AppSettings["NoAccessPage"].ToString()); } int accessLevelID = CommonBLL.GetAccessLevelID(this.CurrentUser.AccessLevel); //functional location id if (Request.QueryString["flid"] != null && Request.QueryString["flid"].Trim().Length > 0) { fLocationID = Convert.ToInt32(Request.QueryString["flid"].Trim()); } //equipment id if (Request.QueryString["eid"] != null && Request.QueryString["eid"].Trim().Length > 0) { equipmentID = Convert.ToInt32(Request.QueryString["eid"].Trim()); } AccessType access = ValidateUserPrivileges(siteID, accessLevelID); FilterObject filterObject = new FilterObject(); if (Request.QueryString["filterTextValue"] != null && Request.QueryString["filterTextValue"].Trim().Length > 0) { filterObject.FilterTextValue = Request.QueryString["filterTextValue"].Trim(); } if (Request.QueryString["fids"] != null && Request.QueryString["fids"].Trim().Length > 0) { filterObject.FilterLocationIds = Request.QueryString["fids"].Trim(); } if (Request.QueryString["cids"] != null && Request.QueryString["cids"].Trim().Length > 0) { filterObject.FilterCategoryIds = Request.QueryString["cids"].Trim(); } string basePath = ConfigurationManager.AppSettings["MaintBasePath"].ToString().TrimEnd('/'); string webServicePath = ConfigurationManager.AppSettings["MaintWebServicePath"].Trim(); ImagePathInfo imagePathInfo = new ImagePathInfo(); imagePathInfo.UploaderPath = ConfigurationManager.AppSettings["uploaderPath"].ToString().Trim('/'); imagePathInfo.ImgDefaultProfilePath = ConfigurationManager.AppSettings["MaintImagePath"].TrimEnd('/') + "/Styles/Images/Equipments.png"; imagePathInfo.EquipmentImgPath = ConfigurationManager.AppSettings["EquipmentImagePath"].ToString().Trim('/') + "/" + siteID + "/" + "Thumbnail"; Vegam_MaintenanceService.SiteDateTimeFormatInfo dateTimeFormat = BLL.MaintenanceBLL.GetSiteDateTimeFormatInfo(siteID); hdfDatePickerFormat.Value = CommonBLL.GetDatePickerDateFormat(dateTimeFormat.DateFormat); BasicParam basicParam = new BasicParam(); basicParam.SiteID = siteID; basicParam.UserID = userID; basicParam.AccessLevelID = accessLevelID; basicParam.LanguageCode = this.CurrentUser.LanguageCode; UserControls.PagerData pagerData = new UserControls.PagerData(); pagerData.PageIndex = 0; pagerData.PageSize = int.Parse(hdnEquipmentPageSize.Value.ToString()); pagerData.SelectMethod = "LoadAllEquipmentInfo"; pagerData.ServicePath = webServicePath; pagerData.SiteID = siteID; pagerData.UserID = userID; pagerData.AccessLevelID = accessLevelID; pagerData.LoadControlID = divModelInfo.ClientID; pagerData.PageAccessRights = access.ToString(); # region PagerData for Equipment model and master popup //using pager for equipment model selection UserControls.PagerData modelPagerData = new UserControls.PagerData(); modelPagerData.PageIndex = 0; modelPagerData.PageSize = int.Parse(hdnModelPageSize.Value.ToString()); modelPagerData.SelectMethod = "LoadEquipmentModelInfo"; modelPagerData.ServicePath = webServicePath; modelPagerData.SiteID = siteID; modelPagerData.UserID = userID; modelPagerData.PageAccessRights = access.ToString(); //using pager for displaying maintenance master data in configure maintenance types modal popup UserControls.PagerData maintTypePagerData = new UserControls.PagerData(); maintTypePagerData.PageIndex = 0; maintTypePagerData.PageSize = int.Parse(hdnModelPageSize.Value.ToString()); maintTypePagerData.SelectMethod = "LoadMaintTypesInfo"; maintTypePagerData.ServicePath = webServicePath; maintTypePagerData.SiteID = siteID; maintTypePagerData.UserID = userID; maintTypePagerData.AccessLevelID = accessLevelID; maintTypePagerData.LoadControlID = divModelInfo.ClientID; maintTypePagerData.PageAccessRights = access.ToString(); #endregion if (access == AccessType.FULL_ACCESS) { btnAddMaintType.Attributes.Add("onclick", "javascript:InsertOrUpdateMaintType(" + (new JavaScriptSerializer()).Serialize(0) + ");return false;"); } else { btnAddMaintType.Attributes.Add("disabled", "disabled"); } thMaintTypes.Attributes.Add("onclick", "javascript:SortMaintTypesTabs('" + thMaintTypes.ClientID + "','MasterDataName');"); sortEquipment.Attributes.Add("onclick", "javascript:SortByEquipmentName('" + sortEquipment.ClientID + "','EquipmentName');"); ScriptManager.RegisterStartupScript(this, this.GetType(), "LoadEquipmentBasicInfo", "javascript:LoadEquipmentBasicInfo(" + (new JavaScriptSerializer()).Serialize(basicParam) + "," + (new JavaScriptSerializer()).Serialize(pagerData) + "," + (new JavaScriptSerializer()).Serialize(maintTypePagerData) + "," + (new JavaScriptSerializer()).Serialize(modelPagerData) + ",'" + basePath + "','" + webServicePath + "','" + equipmentID + "','" + hasEditAccess + "','" + hasDeleteAccess + "'," + (new JavaScriptSerializer()).Serialize(imagePathInfo) + ",'" + fLocationID + "','" + hdfDatePickerFormat.Value + "');", true); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region Script Resource ScriptReference scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/DynamicGridScriptResource.js"; string[] cultures = ConfigurationManager.AppSettings["SupportLanguages"].ToString().Split(','); scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); ScriptManager1.Scripts.Add(scriptReference); scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/ManageWorkOrderScriptResource.js"; scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); ScriptManager1.Scripts.Add(scriptReference); scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/jQueryCalendarScriptResource.js"; scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); ScriptManager1.Scripts.Add(scriptReference); #endregion int siteID = CommonBLL.ValidateSiteID(Request); if (siteID == 0) { Response.Redirect(ConfigurationManager.AppSettings["NoAccessPage"].ToString()); } int userID = this.CurrentUser.UserID; int accessLevelID = CommonBLL.GetAccessLevelID(this.CurrentUser.AccessLevel); ValidateUserPrivileges(userID, siteID, accessLevelID); string basePath = ConfigurationManager.AppSettings["MaintBasePath"].ToString().TrimEnd('/'); string userControlPath = ConfigurationManager.AppSettings["MaintUserControls"].ToString().TrimEnd('/'); SiteDateTimeFormatInfo dateTimeForamt = BLL.MaintenanceBLL.GetSiteDateTimeFormatInfo(siteID); UserControls.DynamicGridControl dynamicGridControl = (UserControls.DynamicGridControl)Page.LoadControl(userControlPath + "/DynamicGridControl.ascx"); divDynamicGridContent.Controls.Add(dynamicGridControl); int featureID = 0; List <string> featureName = new List <string>(); featureName.Add(Language_Resources.MaintenanceFeatures.ManageWorkOrder); List <ipas_UserService.SiteFeatureInfo> featurePageToLoad = BLL.UserBLL.GetCompanyFeatureConfiguredURL(siteID, 0, featureName); if (featurePageToLoad.Count > 0) { ipas_UserService.SiteFeatureInfo result = featurePageToLoad.SingleOrDefault(x => x.FeatureName == featureName[0]); if (result != null) { featureID = result.FeatureID; } } Vegam_MaintenanceService.SiteDateTimeFormatInfo dateTimeFormat = BLL.MaintenanceBLL.GetSiteDateTimeFormatInfo(siteID); string dateFormat = CommonBLL.GetDatePickerDateFormat(dateTimeFormat.DateFormat); UserControls.PagerData pagerData = new UserControls.PagerData(); pagerData.PageIndex = 0; pagerData.PageSize = Convert.ToInt32(hdnPageSize.Value); pagerData.CurrentPage = 0; pagerData.SelectMethod = "LoadDynamicGridContent"; pagerData.ServicePath = ConfigurationManager.AppSettings["MaintWebServicePath"].Trim(); pagerData.SiteID = siteID; pagerData.UserID = userID; pagerData.PlantDateFormat = dateTimeForamt.DateFormat; pagerData.PlantTimeFormat = dateTimeForamt.TimeFormat; pagerData.AccessLevelID = accessLevelID; string imagePath = ConfigurationManager.AppSettings["MaintImagePath"].TrimEnd('/') + "/Styles/Images"; UserControls.DynamicGridProperties dynamicGridProperties = new UserControls.DynamicGridProperties(); dynamicGridProperties.FeatureID = featureID; dynamicGridProperties.DatePickerFormat = CommonBLL.GetDatePickerDateFormat(dateTimeForamt.DateFormat); dynamicGridProperties.GridType = UserControls.DynamicGridType.Table; dynamicGridProperties.PagerData = pagerData; dynamicGridProperties.TableHeaderText = Language_Resources.ManageWorkOrder_Resource.listOfWorkOrders; dynamicGridProperties.WebServiceName = "Vegam_MaintenanceService.asmx"; dynamicGridProperties.ExcelSheetName = "MaintenanceWorkOrder"; dynamicGridProperties.ImagePath = imagePath; string newWorkOrderHTML = "<input id='btnNewWorkOrder' type='button'class='btn btn-sm btn-success pull-xs-right pover' data-placement='top' data-content='" + Language_Resources.ManageWorkOrder_Resource.addMaintWorkOrder + "' value='" + Language_Resources.ManageWorkOrder_Resource.addMaintWorkOrder + "' disabled='disabled'/>"; string editWorkOrderHTML = "<i class='fa fa-edit linkcolor big tiny-leftmargin tiny-rightmargin v-icon cursor-pointer icon-muted'></i>"; string deleteWorkOrderHTML = "<i class='fa fa-trash-o red big tiny-leftmargin tiny-rightmargin v-icon cursor-pointer icon-muted '></i>"; //if (_manageWorkOrderAccess.ToLower() != "read_only") //{ editWorkOrderHTML = "<i class='fa fa-edit linkcolor big tiny-leftmargin tiny-rightmargin v-icon cursor-pointer' onclick='javascript:EditWorkOrderInfo(this);' title='Edit'></i>"; if (_manageWorkOrderAccess.ToLower() == "full_access") { newWorkOrderHTML = "<input id='btnNewWorkOrder' type='button'class='btn btn-sm btn-success pull-xs-right pover' data-placement='top' data-content='" + Language_Resources.ManageWorkOrder_Resource.addMaintWorkOrder + "' value='" + Language_Resources.ManageWorkOrder_Resource.addMaintWorkOrder + "' onclick='javascript:AddNewWorkOrder();'/>"; deleteWorkOrderHTML = "<i class='fa fa-trash-o red big tiny-leftmargin tiny-rightmargin v-icon cursor-pointer' onclick='javascript:DeleteWorkOrderInfoConfirm(this);' title='Delete'></i>"; } //} Page.ClientScript.RegisterStartupScript(GetType(), "LoadManageWorkOrderInfo", "LoadManageWorkOrderInfo(" + (new JavaScriptSerializer()).Serialize(dynamicGridProperties) + ",'" + _manageWorkOrderAccess + "',\"" + newWorkOrderHTML + "\",\"" + editWorkOrderHTML + "\",\"" + deleteWorkOrderHTML + "\",'" + basePath + "','" + dateFormat + "')", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region Script Resource ScriptReference scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/ViewWorkOrderInfoScriptResource.js"; string[] cultures = ConfigurationManager.AppSettings["SupportLanguages"].ToString().Split(','); scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); scriptManager.Scripts.Add(scriptReference); scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/JQueryCalendarScriptResource.js"; scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); scriptManager.Scripts.Add(scriptReference); scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/DynamicGridScriptResource.js"; scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); scriptManager.Scripts.Add(scriptReference); #endregion int siteID = CommonBLL.ValidateSiteID(Request); if (siteID == 0) { Response.Redirect(ConfigurationManager.AppSettings["NoAccessPage"].ToString()); } int userID = this.CurrentUser.UserID; int accessLevelID = CommonBLL.GetAccessLevelID(this.CurrentUser.AccessLevel); string workOrder = string.Empty; if (Request.QueryString["workorder"] != null && Request.QueryString["workorder"].Trim().Length > 0) { workOrder = Request.QueryString["workorder"].Trim(); } if (Request.QueryString["equipment"] != null && Request.QueryString["equipment"].Trim().Length > 0) { equipmentID = Convert.ToInt32(Request.QueryString["equipment"].Trim()); } string pType = string.Empty; if (Request.QueryString["ptype"] != null && Request.QueryString["ptype"].Trim().Length > 0) { pType = Request.QueryString["ptype"].Trim(); } AccessType accessType = ValidateUserPrivileges(siteID, accessLevelID); string servicePath = ConfigurationManager.AppSettings["MaintWebServicePath"].TrimEnd('/'); string imagePath = ConfigurationManager.AppSettings["MaintImagePath"].TrimEnd('/') + "/Styles/Images/"; string basePath = ConfigurationManager.AppSettings["MaintBasePath"].ToString().TrimEnd('/'); string uploaderPath = ConfigurationManager.AppSettings["uploaderPath"].ToString().Trim('/'); string maintScheduleAttachmentPath = ConfigurationManager.AppSettings["MaintScheduleAttachmentPath"].TrimEnd('/'); Vegam_MaintenanceService.SiteDateTimeFormatInfo dateTimeFormat = BLL.MaintenanceBLL.GetSiteDateTimeFormatInfo(siteID); hdfDatePickerFormat.Value = CommonBLL.GetDatePickerDateFormat(dateTimeFormat.DateFormat); Vegam_MaintenanceService.BasicParam basicParam = new Vegam_MaintenanceService.BasicParam(); basicParam.SiteID = siteID; basicParam.UserID = userID; basicParam.AccessLevelID = accessLevelID; basicParam.LanguageCode = this.CurrentUser.LanguageCode; UserControls.PagerData pagerData = new UserControls.PagerData(); pagerData.PageIndex = 0; pagerData.PageSize = int.Parse(hdnEquipmentHistoryPageSize.Value.ToString()); pagerData.SelectMethod = "LoadEquipmentHistory"; pagerData.ServicePath = servicePath; pagerData.SiteID = siteID; pagerData.UserID = userID; pagerData.AccessLevelID = accessLevelID; string usercontrolPath = ConfigurationManager.AppSettings["MaintUserControls"].ToString().TrimEnd('/'); UserControls.DynamicGridControl dynamicGridControl = (UserControls.DynamicGridControl)Page.LoadControl(usercontrolPath + "/DynamicGridControl.ascx"); divDynamicGridContent.Controls.Add(dynamicGridControl); #region Feature List <string> featureName = new List <string>(); featureName.Add(Language_Resources.MaintenanceFeatures.viewMeasuringPointReadings); int featureID = 0; List <ipas_UserService.SiteFeatureInfo> featurePageToLoad = BLL.UserBLL.GetCompanyFeatureConfiguredURL(siteID, 0, featureName); if (featurePageToLoad.Count > 0) { ipas_UserService.SiteFeatureInfo result = featurePageToLoad.SingleOrDefault(x => x.FeatureName == Language_Resources.MaintenanceFeatures.viewMeasuringPointReadings); if (result != null) { featureID = result.FeatureID; } } #endregion SiteDateTimeFormatInfo dateTimeForamt = BLL.MaintenanceBLL.GetSiteDateTimeFormatInfo(siteID); int currentDate = BLL.MaintenanceBLL.GetSiteCurrentDateTime(siteID).CurrentDate; UserControls.DynamicGridProperties dynamicGridProperties = new UserControls.DynamicGridProperties(); dynamicGridProperties.CurrentDate = currentDate; dynamicGridProperties.TableHeaderText = Language_Resources.ViewWorkOrderResource.measuringPointList; //dynamicGridProperties.CustomRowNavigationMethod = "ViewWorkOrderInfo"; dynamicGridProperties.FeatureID = featureID; dynamicGridProperties.GridType = UserControls.DynamicGridType.Table; dynamicGridProperties.PagerData = pagerData; //dynamicGridProperties.ImagePath = ConfigurationManager.AppSettings["MaintImagePath"].TrimEnd('/') + "/Styles/Images"; dynamicGridProperties.WebServiceName = "Vegam_MaintenanceService.asmx"; dynamicGridProperties.DatePickerFormat = CommonBLL.GetDatePickerDateFormat(dateTimeForamt.DateFormat); // dynamicGridProperties.ShowGroupRowsByDefault = false; dynamicGridProperties.ExcelSheetName = "MeasuringPointList"; ScriptManager.RegisterStartupScript(this, this.GetType(), "LoadWorkOrderBasicInfo", "javascript:LoadWorkOrderBasicInfo(" + (new JavaScriptSerializer()).Serialize(basicParam) + "," + (new JavaScriptSerializer()).Serialize(pagerData) + "," + (new JavaScriptSerializer()).Serialize(dynamicGridProperties) + ",'" + servicePath + "','" + workOrder + "','" + imagePath + "','" + basePath + "','" + uploaderPath + "','" + maintScheduleAttachmentPath + "','" + accessType.ToString() + "','" + hdfDatePickerFormat.Value + "'," + equipmentID + "," + "'" + dateTimeFormat.DateFormat + "','" + dateTimeFormat.TimeFormat + "','" + pType + "');", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region Script Resource ScriptReference scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/TaskGroupScriptResource.js"; string[] cultures = ConfigurationManager.AppSettings["SupportLanguages"].ToString().Split(','); scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); scriptManager.Scripts.Add(scriptReference); #endregion int siteID = CommonBLL.ValidateSiteID(Request); int versionNumber = 0; int.TryParse(Request.QueryString["v"], out versionNumber); int taskGroupIdentifier = 0; if (Request.QueryString["gid"] != null && Request.QueryString["gid"].Trim().Length > 0) { taskGroupIdentifier = Convert.ToInt32(Request.QueryString["gid"].Trim()); } if (siteID == 0 || versionNumber < 0 || taskGroupIdentifier < 0) { Response.Redirect(ConfigurationManager.AppSettings["NoAccessPage"].ToString()); } bool isMaintShowAll = false; if (Request.QueryString["showall"] != null && Request.QueryString["showall"].Trim().Length > 0) { isMaintShowAll = Request.QueryString["showall"].Trim().ToLower() == "true" ? true : false; } int userID = this.CurrentUser.UserID; int accessLevelID = CommonBLL.GetAccessLevelID(this.CurrentUser.AccessLevel); AccessType access = ValidateUserPrivileges(siteID, accessLevelID); AccessType approveAccess = CommonBLL.ValidateUserPrivileges(siteID, this.CurrentUser.SiteID, this.CurrentUser.UserID, accessLevelID, Convert.ToInt32(Language_Resources.MaintenancePageID_Resource.taskGroupApprove)); Vegam_MaintenanceService.BasicParam basicParam = new Vegam_MaintenanceService.BasicParam(); basicParam.SiteID = siteID; basicParam.UserID = userID; basicParam.AccessLevelID = accessLevelID; string basePath = ConfigurationManager.AppSettings["MaintBasePath"].ToString().TrimEnd('/'); string webServicePath = ConfigurationManager.AppSettings["MaintWebServicePath"].Trim(); string uploaderPath = ConfigurationManager.AppSettings["uploaderPath"].ToString().Trim('/'); string imagePath = ConfigurationManager.AppSettings["MaintImagePath"].TrimEnd('/'); string taskDocumentPath = ConfigurationManager.AppSettings["MaintenanceTaskDocumentsPath"].TrimEnd('/'); if (access == AccessType.FULL_ACCESS) { btnGroupInfoSave.Attributes.Add("onclick", "javascript:SaveTaskGroupInfo();return false;"); if (taskGroupIdentifier == 0) { btnGroupInfoSave.InnerText = Language_Resources.TaskGroup_Resource.save; } else { btnGroupInfoSave.InnerText = Language_Resources.TaskGroup_Resource.update; } } else if (access == AccessType.EDIT_ONLY) { btnGroupInfoSave.Attributes.Add("onclick", "javascript:SaveTaskGroupInfo();return false;"); btnGroupInfoSave.InnerText = Language_Resources.TaskGroup_Resource.update; } else { btnGroupInfoSave.Attributes.Add("disabled", "disabled"); } bool isUserHasApprovePermission = false; if (approveAccess == AccessType.FULL_ACCESS) { isUserHasApprovePermission = true; } //else if (approveAccess == AccessType.READ_ONLY) //{ // isUserHasApproveVisiblePermission = true; //} //using pager for displaying maintenance master data in configure maintenance types modal popup UserControls.PagerData maintTypePagerData = new UserControls.PagerData(); maintTypePagerData.PageIndex = 0; maintTypePagerData.PageSize = int.Parse(hdnPageSize.Value.ToString()); maintTypePagerData.SelectMethod = "LoadMaintTypesInfo"; maintTypePagerData.ServicePath = webServicePath; maintTypePagerData.SiteID = siteID; maintTypePagerData.UserID = userID; maintTypePagerData.AccessLevelID = accessLevelID; maintTypePagerData.LoadControlID = btnAddMaintType.ClientID; maintTypePagerData.PageAccessRights = access.ToString(); if (access == AccessType.FULL_ACCESS) { btnAddMaintType.Attributes.Add("onclick", "javascript:InsertOrUpdateMaintType(" + (new JavaScriptSerializer()).Serialize(0) + ");return false;"); } else { btnAddMaintType.Attributes.Add("disabled", "disabled"); } thMaintTypes.Attributes.Add("onclick", "javascript:SortMaintTypesTabs('" + thMaintTypes.ClientID + "','MasterDataName');"); Page.ClientScript.RegisterStartupScript(GetType(), "LoadTaskGroupInfo", "LoadTaskGroupInfo(" + (new JavaScriptSerializer()).Serialize(maintTypePagerData) + "," + (new JavaScriptSerializer()).Serialize(basicParam) + ",'" + basePath + "','" + webServicePath + "','" + uploaderPath + "','" + imagePath + "'," + taskGroupIdentifier + "," + versionNumber + ",'" + btnGroupInfoSave.ClientID + "','" + access.ToString() + "','" + taskDocumentPath + "','" + isUserHasApprovePermission + "','" + maintScheduleID + "','" + isMaintShowAll + "');", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region Script Resource ScriptReference scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/MeasuringPointScriptResource.js"; string[] cultures = ConfigurationManager.AppSettings["SupportLanguages"].ToString().Split(','); scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); scriptManager.Scripts.Add(scriptReference); #endregion int siteID = CommonBLL.ValidateSiteID(Request); int equipmentID = 0; int fLocationID = 0; int measuringPointID = 0; string mptDataType = Request.QueryString["type"];//E : Equipment, L:Location, M: Master if (Request.QueryString["flid"] != null && Request.QueryString["flid"].Trim().Length > 0) { fLocationID = Convert.ToInt32(Request.QueryString["flid"].Trim()); } if (Request.QueryString["eid"] != null && Request.QueryString["eid"].Trim().Length > 0) { equipmentID = Convert.ToInt32(Request.QueryString["eid"].Trim()); } if (Request.QueryString["mpid"] != null && Request.QueryString["mpid"].Trim().Length > 0) { measuringPointID = Convert.ToInt32(Request.QueryString["mpid"].Trim()); } if (siteID == 0 && string.IsNullOrEmpty(mptDataType) && equipmentID < 0) { Response.Redirect(ConfigurationManager.AppSettings["NoAccessPage"].ToString()); } int userID = this.CurrentUser.UserID; int accessLevelID = CommonBLL.GetAccessLevelID(this.CurrentUser.AccessLevel); ValidateUserPrivileges(siteID, accessLevelID, mptDataType); Vegam_MaintenanceService.BasicParam basicParam = new Vegam_MaintenanceService.BasicParam(); basicParam.SiteID = siteID; basicParam.UserID = userID; basicParam.AccessLevelID = accessLevelID; string basePath = ConfigurationManager.AppSettings["MaintBasePath"].ToString().TrimEnd('/'); string webServicePath = ConfigurationManager.AppSettings["MaintWebServicePath"].Trim(); string uploaderPath = ConfigurationManager.AppSettings["uploaderPath"].ToString().Trim('/'); string restAPIPath = ConfigurationManager.AppSettings["VegamViewServicePath"].TrimEnd('/'); string measuringPointImgPath = ConfigurationManager.AppSettings["MeasuringPointImagePath"].ToString().Trim('/') + "/" + basicParam.SiteID + "/" + "Thumbnail"; string imagePath = ConfigurationManager.AppSettings["MaintImagePath"].TrimEnd('/') + "/Styles/Images/Measuring_Point.png"; UserControls.PagerData measuringPointpagerData = new UserControls.PagerData(); measuringPointpagerData.PageIndex = 0; measuringPointpagerData.PageSize = int.Parse(hdnMeasuringPointPageSize.Value.ToString()); measuringPointpagerData.CurrentPage = currentPage; measuringPointpagerData.SelectMethod = "LoadMeasuringPointList"; measuringPointpagerData.ServicePath = webServicePath; measuringPointpagerData.SiteID = siteID; measuringPointpagerData.UserID = userID; measuringPointpagerData.AccessLevelID = accessLevelID; measuringPointpagerData.PageAccessRights = PageAccessRights.ToString(); if (measuringPointpagerData.PageAccessRights == AccessType.FULL_ACCESS.ToString()) { btnSaveMeasuringPoint.Attributes.Add("onclick", "javascript:InsertOrUpdateMeasuringPointInfo(" + (new JavaScriptSerializer()).Serialize(0) + ");return false;"); } else { btnSaveMeasuringPoint.Attributes.Add("disabled", "disabled"); btnGenerateCode.Attributes.Add("disabled", "disabled"); } if (measuringPointpagerData.PageAccessRights == AccessType.FULL_ACCESS.ToString() || measuringPointpagerData.PageAccessRights == AccessType.EDIT_ONLY.ToString()) { uploadImageAccess = true; } else { uploadImageAccess = false; } //using pager for displaying master data in configure maintenance types modal popup UserControls.PagerData maintTypePagerData = new UserControls.PagerData(); maintTypePagerData.PageIndex = 0; maintTypePagerData.PageSize = int.Parse(hdnModelPageSize.Value.ToString()); maintTypePagerData.CurrentPage = currentPage; maintTypePagerData.SelectMethod = "LoadMaintTypesInfo"; maintTypePagerData.ServicePath = webServicePath; maintTypePagerData.SiteID = siteID; maintTypePagerData.UserID = userID; maintTypePagerData.AccessLevelID = accessLevelID; maintTypePagerData.PageAccessRights = PageAccessRights.ToString(); if (maintTypePagerData.PageAccessRights == AccessType.FULL_ACCESS.ToString()) { btnAddMaintType.Attributes.Add("onclick", "javascript:InsertOrUpdateMaintType(" + (new JavaScriptSerializer()).Serialize(0) + ");return false;"); } else { btnAddMaintType.Attributes.Add("disabled", "disabled"); } thMaintTypes.Attributes.Add("onclick", "javascript:SortMaintenanceTypeTabs('" + thMaintTypes.ClientID + "','MasterDataName');"); sortMeasuringPoint.Attributes.Add("onclick", "javascript:SortByMeasuringPointName('" + sortMeasuringPoint.ClientID + "','MeasuringPointName');"); Page.ClientScript.RegisterStartupScript(GetType(), "LoadMeasuringPointInfo", "LoadMeasuringPointInfo(" + (new JavaScriptSerializer()).Serialize(basicParam) + ",'" + basePath + "','" + imagePath + "','" + uploaderPath + "','" + measuringPointImgPath + "','" + restAPIPath + "','" + btnSaveMeasuringPoint.ClientID + "','" + mptDataType + "'," + equipmentID + "," + fLocationID + "," + measuringPointID + "," + (new JavaScriptSerializer()).Serialize(measuringPointpagerData) + "," + (new JavaScriptSerializer()).Serialize(maintTypePagerData) + ");", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region Script Resource ScriptReference scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/MaintenanceScheduleScriptResource.js"; string[] cultures = ConfigurationManager.AppSettings["SupportLanguages"].ToString().Split(','); scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); scriptManager.Scripts.Add(scriptReference); scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/jQueryCalendarScriptResource.js"; scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); scriptManager.Scripts.Add(scriptReference); #endregion int siteID = CommonBLL.ValidateSiteID(Request); if (siteID == 0) { Response.Redirect(ConfigurationManager.AppSettings["NoAccessPage"].ToString()); } //if loading page from manage schedule option if (Request.QueryString["isschedule"] != null && Request.QueryString["isschedule"].Trim().Length > 0) { scheduleType = Request.QueryString["isschedule"].ToString().Trim() == "true" ? "S" : scheduleType; } //if loading page from manage work order option else if (Request.QueryString["isworkorder"] != null && Request.QueryString["isworkorder"].Trim().Length > 0) { scheduleType = Request.QueryString["isworkorder"].ToString().Trim() == "true" ? "W" : scheduleType; } //if loading page from measuring point else if (Request.QueryString["isinspection"] != null && Request.QueryString["isinspection"].Trim().Length > 0) { scheduleType = Request.QueryString["isinspection"].ToString().Trim() == "true" ? "I" : scheduleType; } //if loading page in edit mode int maintScheduleID = 0; if (Request.QueryString["maintscheduleid"] != null && Request.QueryString["maintscheduleid"].Trim().Length > 0) { maintScheduleID = Convert.ToInt32(Request.QueryString["maintscheduleid"].ToString().Trim()); } //if creating workorder for notification int notificationID = 0; if (Request.QueryString["notificationid"] != null && Request.QueryString["notificationid"].Trim().Length > 0 && scheduleType == "W") { notificationID = Convert.ToInt32(Request.QueryString["notificationid"].ToString().Trim()); } string workOrderID = string.Empty; //workorder will be there if its workorder of schedule if (Request.QueryString["workorderid"] != null && Request.QueryString["workorderid"].Trim().Length > 0 && scheduleType == "W") { workOrderID = Request.QueryString["workorderid"].ToString().Trim(); } string workOrderScheduleType = string.Empty; //workorder schedule type will be there if its workorder of schedule if (Request.QueryString["scheduletype"] != null && Request.QueryString["scheduletype"].Trim().Length > 0 && !string.IsNullOrEmpty(workOrderID)) { workOrderScheduleType = Request.QueryString["scheduletype"].ToString().Trim(); } bool isFromManageNotify = false; if (Request.QueryString["ismn"] != null && Request.QueryString["ismn"].Trim().Length > 0 && scheduleType == "W") { isFromManageNotify = Request.QueryString["ismn"].ToString().Trim().ToLower() == "true"; } int userID = this.CurrentUser.UserID; int accessLevelID = CommonBLL.GetAccessLevelID(this.CurrentUser.AccessLevel); AccessType accessType = ValidateUserPrivileges(siteID, accessLevelID); if ((accessType == AccessType.FULL_ACCESS || accessType == AccessType.EDIT_ONLY) && maintScheduleID > 0) { btnCancelWorkOrder.Attributes.Add("onclick", "javascript:CancelWorkOrderConfirm();return false;"); } else { btnCancelWorkOrder.Attributes.Add("disabled", "disabled"); } btnCancelWorkOrder.Visible = false; if (!string.IsNullOrEmpty(workOrderID) && !string.IsNullOrEmpty(workOrderScheduleType) && workOrderScheduleType == "S") { accessType = AccessType.READ_ONLY; btnActivateSchedule.Visible = false; btnCancelWorkOrder.Visible = true; } if (!string.IsNullOrEmpty(workOrderID) && !string.IsNullOrEmpty(workOrderScheduleType) && workOrderScheduleType == "W") { btnCancelWorkOrder.Visible = false; btnActivateSchedule.Visible = true; } string basePath = ConfigurationManager.AppSettings["MaintBasePath"].ToString().TrimEnd('/'); string webServicePath = ConfigurationManager.AppSettings["MaintWebServicePath"].Trim(); string defaultImage = ConfigurationManager.AppSettings["MaintImagePath"].TrimEnd('/') + "/Styles/Images/Equipments.png"; string imagePath = ConfigurationManager.AppSettings["MaintImagePath"].TrimEnd('/'); string taskDocumentPath = ConfigurationManager.AppSettings["MaintenanceTaskDocumentsPath"].TrimEnd('/'); string uploaderPath = ConfigurationManager.AppSettings["uploaderPath"].ToString().Trim('/'); string maintScheduleAttachmentPath = ConfigurationManager.AppSettings["MaintScheduleAttachmentPath"].TrimEnd('/'); Vegam_MaintenanceService.SiteDateTimeFormatInfo dateTimeFormat = BLL.MaintenanceBLL.GetSiteDateTimeFormatInfo(siteID); string datePickerFormat = CommonBLL.GetDatePickerDateFormat(dateTimeFormat.DateFormat); //using pager for displaying maintenance types in configure maintenance types modal popup UserControls.PagerData maintTypePagerData = new UserControls.PagerData(); maintTypePagerData.PageIndex = 0; maintTypePagerData.PageSize = int.Parse(hdnPageSize.Value.ToString()); maintTypePagerData.SelectMethod = "LoadMaintTypesInfo"; maintTypePagerData.ServicePath = webServicePath; maintTypePagerData.SiteID = siteID; maintTypePagerData.UserID = userID; maintTypePagerData.AccessLevelID = accessLevelID; maintTypePagerData.LoadControlID = btnSaveMaintInfo.ClientID; maintTypePagerData.PageAccessRights = maintTypeAccess.ToString(); //using pager for displaying equipment and locations in modal popup UserControls.PagerData equipmentPagerData = new UserControls.PagerData(); equipmentPagerData.PageIndex = 0; equipmentPagerData.PageSize = int.Parse(hdnPageSize.Value.ToString()); equipmentPagerData.SelectMethod = "LoadAllEquipmentFLoaction"; equipmentPagerData.ServicePath = webServicePath; equipmentPagerData.SiteID = siteID; equipmentPagerData.UserID = userID; equipmentPagerData.AccessLevelID = accessLevelID; equipmentPagerData.LoadControlID = btnSaveMaintInfo.ClientID; if (accessType == AccessType.FULL_ACCESS || (accessType == AccessType.EDIT_ONLY && maintScheduleID > 0)) { btnSaveMaintInfo.Attributes.Add("onclick", "javascript:AddNewMaintenance();return false;"); btnSaveWorkInstruction.Attributes.Add("onclick", "javascript:SaveWorkInstructionInfo();return false;"); btnSaveSparePartInfo.Attributes.Add("onclick", "javascript:SaveSparePartInformation();return false;"); } else { btnSaveMaintInfo.Attributes.Add("disabled", "disabled"); btnSaveWorkInstruction.Attributes.Add("disabled", "disabled"); btnSaveSparePartInfo.Attributes.Add("disabled", "disabled"); } if (maintReleaseAccess == AccessType.FULL_ACCESS) { btnActivateSchedule.Attributes.Add("onclick", "javascript:ActivateScheduleConfirm();return false;"); } else { btnActivateSchedule.Attributes.Add("disabled", "disabled"); } if (accessType == AccessType.FULL_ACCESS) { btnAddMaintType.Attributes.Add("onclick", "javascript:InsertOrUpdateMaintType(" + (new JavaScriptSerializer()).Serialize(0) + ");return false;"); } else { btnAddMaintType.Attributes.Add("disabled", "disabled"); } thMaintTypes.Attributes.Add("onclick", "javascript:SortMaintTypesTabs('" + thMaintTypes.ClientID + "','MasterDataName');"); thFLocation.Attributes.Add("onclick", "javascript:SortEquipmentTabs('" + thFLocation.ClientID + "','LocationName');"); thEquipment.Attributes.Add("onclick", "javascript:SortEquipmentTabs('" + thEquipment.ClientID + "','EquipmentName');"); thEquipmentType.Attributes.Add("onclick", "javascript:SortEquipmentTabs('" + thEquipmentType.ClientID + "','EquipmentType');"); ScriptManager.RegisterStartupScript(this, this.GetType(), "InitMaintenanceScheduleInfo", "javascript:InitMaintenanceScheduleInfo(" + (new JavaScriptSerializer()).Serialize(maintTypePagerData) + "," + (new JavaScriptSerializer()).Serialize(equipmentPagerData) + ",'" + basePath + "','" + datePickerFormat + "','" + dateTimeFormat.DateFormat + "','" + dateTimeFormat.TimeFormat + "','" + defaultImage + "','" + scheduleType + "'," + maintScheduleID + ",'" + imagePath + "','" + taskDocumentPath + "','" + uploaderPath + "','" + accessType + "','" + maintScheduleAttachmentPath + "'," + notificationID + ",'" + workOrderID + "','" + isFromManageNotify + "','" + maintReleaseAccess + "');", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region Script Resource ScriptReference scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/DynamicGridScriptResource.js"; string[] cultures = ConfigurationManager.AppSettings["SupportLanguages"].ToString().Split(','); scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); ScriptManager1.Scripts.Add(scriptReference); scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/ManageScheduleScriptResource.js"; scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); ScriptManager1.Scripts.Add(scriptReference); #endregion int siteID = CommonBLL.ValidateSiteID(Request); if (siteID == 0) { Response.Redirect(ConfigurationManager.AppSettings["NoAccessPage"].ToString()); } int userID = this.CurrentUser.UserID; int accessLevelID = CommonBLL.GetAccessLevelID(this.CurrentUser.AccessLevel); ValidateUserPrivileges(userID, siteID, accessLevelID); string basePath = ConfigurationManager.AppSettings["MaintBasePath"].ToString().TrimEnd('/'); string imagePath = ConfigurationManager.AppSettings["MaintImagePath"].TrimEnd('/') + "/Styles/Images"; string userControlPath = ConfigurationManager.AppSettings["MaintUserControls"].ToString().TrimEnd('/'); UserControls.DynamicGridControl dynamicGridControl = (UserControls.DynamicGridControl)Page.LoadControl(userControlPath + "/DynamicGridControl.ascx"); divDynamicGridContent.Controls.Add(dynamicGridControl); int featureID = 0; List <string> featureName = new List <string>(); featureName.Add(Language_Resources.MaintenanceFeatures.ManageSchedule); List <ipas_UserService.SiteFeatureInfo> featurePageToLoad = BLL.UserBLL.GetCompanyFeatureConfiguredURL(siteID, 0, featureName); if (featurePageToLoad.Count > 0) { ipas_UserService.SiteFeatureInfo result = featurePageToLoad.SingleOrDefault(x => x.FeatureName == featureName[0]); if (result != null) { featureID = result.FeatureID; } } string webServicePath = ConfigurationManager.AppSettings["MaintWebServicePath"].Trim(); UserControls.PagerData pagerData = new UserControls.PagerData(); pagerData.PageIndex = 0; pagerData.PageSize = Convert.ToInt32(hdnPageSize.Value); pagerData.CurrentPage = 0; pagerData.SelectMethod = "LoadDynamicGridContent"; pagerData.ServicePath = webServicePath; pagerData.SiteID = siteID; pagerData.UserID = userID; pagerData.AccessLevelID = accessLevelID; UserControls.DynamicGridProperties dynamicGridProperties = new UserControls.DynamicGridProperties(); dynamicGridProperties.FeatureID = featureID; dynamicGridProperties.GridType = UserControls.DynamicGridType.Table; dynamicGridProperties.PagerData = pagerData; dynamicGridProperties.TableHeaderText = Language_Resources.ManageSchedule_Resource.listOfSchedules; dynamicGridProperties.WebServiceName = "Vegam_MaintenanceService.asmx"; dynamicGridProperties.ExcelSheetName = "MaintenanceSchedule"; //using pager for displaying work order details UserControls.PagerData workOrderPagerData = new UserControls.PagerData(); workOrderPagerData.PageIndex = 0; workOrderPagerData.PageSize = int.Parse(hdnWorkOrderPageSize.Value.ToString()); workOrderPagerData.SelectMethod = "LoadScheduleWorkOrderDetails"; workOrderPagerData.ServicePath = webServicePath; workOrderPagerData.SiteID = siteID; workOrderPagerData.UserID = userID; workOrderPagerData.AccessLevelID = accessLevelID; workOrderPagerData.LoadControlID = tBodyWorkOrderDetails.ClientID; string newScheduleHTML = "<input id='btnNewSchedule' type='button'class='btn btn-sm btn-success pull-xs-right pover' data-placement='top' disabled='disabled' data-content='" + Language_Resources.ManageSchedule_Resource.addMaintSchedule + "' value='" + Language_Resources.ManageSchedule_Resource.addMaintSchedule + "'/>"; string editScheduleHTML = "<i class='fa fa-edit linkcolor big tiny-leftmargin tiny-rightmargin v-icon cursor-pointer icon-muted'></i>"; string deleteScheduleHTML = "<i class='fa fa-trash-o red big tiny-leftmargin tiny-rightmargin v-icon cursor-pointer icon-muted '></i>"; string activateScheduleHTML = string.Empty; //if (_manageScheduleAccess.ToLower() != "read_only") //{ editScheduleHTML = "<i class='fa fa-edit linkcolor big tiny-leftmargin tiny-rightmargin v-icon cursor-pointer' title='Edit' onclick='javascript:EditScheduleInfo(this);'></i>"; if (_manageScheduleAccess.ToLower() == "full_access") { newScheduleHTML = "<input id='btnNewSchedule' type='button'class='btn btn-sm btn-success pull-xs-right pover' data-placement='top' data-content='" + Language_Resources.ManageSchedule_Resource.addMaintSchedule + "' value='" + Language_Resources.ManageSchedule_Resource.addMaintSchedule + "' onclick='javascript:AddNewSchedule();'/>"; deleteScheduleHTML = "<i class='fa fa-trash-o red big tiny-leftmargin tiny-rightmargin v-icon cursor-pointer' title='Delete' onclick='javascript:DeleteScheduleInfoConfirm(this);'></i>"; //activateScheduleHTML = "<li><label onclick='javascript:ActivateScheduleInfoConfirm(this);' class='font-small push-down full-width cursor-pointer'><span><i class='fa myicon text-danger big tiny-leftmargin tiny-rightmargin v-icon'></i><span name='activate'>ActivateButtonValue</span></span></label></li>"; } //} Page.ClientScript.RegisterStartupScript(GetType(), "LoadManageScheduleInfo", "LoadManageScheduleInfo(" + (new JavaScriptSerializer()).Serialize(dynamicGridProperties) + ",'" + _manageScheduleAccess + "',\"" + newScheduleHTML + "\",\"" + editScheduleHTML + "\",\"" + deleteScheduleHTML + "\",\"" + activateScheduleHTML + "\",'" + basePath + "','" + imagePath + "'," + (new JavaScriptSerializer()).Serialize(workOrderPagerData) + ")", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region Script Resource ScriptReference scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/NotificationScriptResource.js"; string[] cultures = ConfigurationManager.AppSettings["SupportLanguages"].ToString().Split(','); scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); scriptManager.Scripts.Add(scriptReference); scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/jQueryCalendarScriptResource.js"; scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); scriptManager.Scripts.Add(scriptReference); #endregion int siteID = CommonBLL.ValidateSiteID(Request); if (siteID == 0) { Response.Redirect(ConfigurationManager.AppSettings["NoAccessPage"].ToString()); } int userID = this.CurrentUser.UserID; int accessLevelID = CommonBLL.GetAccessLevelID(this.CurrentUser.AccessLevel); if (Request.QueryString["nid"] != null && Request.QueryString["nid"].Trim().Length > 0) { notificationID = Convert.ToInt32(Request.QueryString["nid"].Trim()); } AccessType access = ValidateUserPrivileges(siteID, accessLevelID); if (access == AccessType.FULL_ACCESS || access == AccessType.EDIT_ONLY) { btnSaveNotification.Attributes.Add("onclick", "javascript:AddUpdateNotification(false);return false;"); } else { btnSaveNotification.Attributes.Add("disabled", "disabled"); } string basePath = ConfigurationManager.AppSettings["MaintBasePath"].ToString().TrimEnd('/'); string webServicePath = ConfigurationManager.AppSettings["MaintWebServicePath"]; string uploaderPath = ConfigurationManager.AppSettings["uploaderPath"].ToString().Trim('/'); string imagePath = ConfigurationManager.AppSettings["MaintImagePath"].TrimEnd('/'); string notificationAttachmentPath = ConfigurationManager.AppSettings["NotificationAttachmentPath"].TrimEnd('/'); Vegam_MaintenanceService.SiteDateTimeFormatInfo dateTimeFormat = BLL.MaintenanceBLL.GetSiteDateTimeFormatInfo(siteID); string datePickerFormat = CommonBLL.GetDatePickerDateFormat(dateTimeFormat.DateFormat); BasicParam basicParam = new BasicParam(); basicParam.SiteID = siteID; basicParam.UserID = userID; basicParam.AccessLevelID = accessLevelID; basicParam.LanguageCode = this.CurrentUser.LanguageCode; #region notification PagerData UserControls.PagerData pagerData = new UserControls.PagerData(); pagerData.PageIndex = 0; pagerData.PageSize = int.Parse(hdnPageSize.Value.ToString()); pagerData.SelectMethod = "LoadNotificationList"; pagerData.ServicePath = webServicePath; pagerData.SiteID = siteID; pagerData.UserID = userID; pagerData.AccessLevelID = accessLevelID; pagerData.LoadControlID = btnSaveNotification.ClientID; pagerData.PageAccessRights = access.ToString(); #endregion #region notification type PagerData ////using pager for notification types modal popup UserControls.PagerData maintTypePagerData = new UserControls.PagerData(); maintTypePagerData.PageIndex = 0; maintTypePagerData.PageSize = int.Parse(hdnMasterPageSize.Value.ToString()); maintTypePagerData.SelectMethod = "LoadMaintTypesInfo"; maintTypePagerData.ServicePath = webServicePath; maintTypePagerData.SiteID = siteID; maintTypePagerData.UserID = userID; maintTypePagerData.AccessLevelID = accessLevelID; maintTypePagerData.LoadControlID = btnSaveNotification.ClientID; maintTypePagerData.PageAccessRights = access.ToString(); #endregion #region FLocation and Equipment modal pagerdata //using pager for displaying equipment and locations in modal popup UserControls.PagerData equipmentPagerData = new UserControls.PagerData(); equipmentPagerData.PageIndex = 0; equipmentPagerData.PageSize = int.Parse(hdnEquipmentPageSize.Value.ToString()); equipmentPagerData.SelectMethod = "LoadAllEquipmentFLoaction"; equipmentPagerData.ServicePath = webServicePath; equipmentPagerData.SiteID = siteID; equipmentPagerData.UserID = userID; equipmentPagerData.AccessLevelID = accessLevelID; equipmentPagerData.LoadControlID = btnSaveNotification.ClientID; #endregion thMaintTypes.Attributes.Add("onclick", "javascript:SortMaintTypesTabs('" + thMaintTypes.ClientID + "','MasterDataName');"); thFLocation.Attributes.Add("onclick", "javascript:SortEquipmentTabs('" + thFLocation.ClientID + "','LocationName');"); thEquipment.Attributes.Add("onclick", "javascript:SortEquipmentTabs('" + thEquipment.ClientID + "','EquipmentName');"); thEquipmentType.Attributes.Add("onclick", "javascript:SortEquipmentTabs('" + thEquipmentType.ClientID + "','EquipmentType');"); sortNotifications.Attributes.Add("onclick", "javascript:SortByNotificationName('" + sortNotifications.ClientID + "','NotificationName');"); ScriptManager.RegisterStartupScript(this, this.GetType(), "NotificationBasicLoadInfo", "javascript:NotificationBasicLoadInfo(" + (new JavaScriptSerializer()).Serialize(basicParam) + "," + (new JavaScriptSerializer()).Serialize(pagerData) + "," + (new JavaScriptSerializer()).Serialize(equipmentPagerData) + "," + (new JavaScriptSerializer()).Serialize(maintTypePagerData) + ",'" + basePath + "','" + webServicePath + "','" + notificationID + "','" + hasEditAccess + "','" + hasDeleteAccess + "','" + workOrderHasFullAccess + "','" + uploaderPath + "','" + notificationAttachmentPath + "','" + imagePath + "','" + datePickerFormat + "','" + dateTimeFormat.DateFormat + "','" + dateTimeFormat.TimeFormat + "');", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region Script_Resource_Refernce ScriptReference scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/DynamicGridScriptResource.js"; string[] cultures = ConfigurationManager.AppSettings["SupportLanguages"].ToString().Split(','); scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); ScriptManager1.Scripts.Add(scriptReference); scriptReference = new ScriptReference(); scriptReference.Path = ConfigurationManager.AppSettings["MaintJsPath"].ToString().TrimEnd('/') + "/ScriptResources/NotificationScriptResource.js"; scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path); ScriptManager1.Scripts.Add(scriptReference); #endregion userID = this.CurrentUser.UserID; siteID = this.CurrentUser.SiteID; accessLevelID = CommonBLL.GetAccessLevelID(this.CurrentUser.AccessLevel); AccessType accessType = ValidateUserPrivileges(siteID, accessLevelID); Vegam_MaintenanceService.BasicParam basicParam = new Vegam_MaintenanceService.BasicParam(); basicParam.SiteID = siteID; basicParam.UserID = userID; string usercontrolPath = ConfigurationManager.AppSettings["MaintUserControls"].ToString().TrimEnd('/'); string webServicePath = ConfigurationManager.AppSettings["MaintWebServicePath"].ToString().TrimEnd('/'); string basePath = ConfigurationManager.AppSettings["MaintBasePath"].ToString().TrimEnd('/'); SiteDateTimeFormatInfo dateTimeForamt = BLL.MaintenanceBLL.GetSiteDateTimeFormatInfo(siteID); UserControls.DynamicGridControl dynamicGridControl = (UserControls.DynamicGridControl)Page.LoadControl(usercontrolPath + "/DynamicGridControl.ascx"); divDynamicGridContent.Controls.Add(dynamicGridControl); #region Feature Equipment Model List <string> featureName = new List <string>(); featureName.Add(Language_Resources.MaintenanceFeatures.manageNotification); int featureID = 0; List <ipas_UserService.SiteFeatureInfo> featurePageToLoad = BLL.UserBLL.GetCompanyFeatureConfiguredURL(siteID, 0, featureName); if (featurePageToLoad.Count > 0) { ipas_UserService.SiteFeatureInfo result = featurePageToLoad.SingleOrDefault(x => x.FeatureName == Language_Resources.MaintenanceFeatures.manageNotification); if (result != null) { featureID = result.FeatureID; } } #endregion UserControls.PagerData pagerData = new UserControls.PagerData(); pagerData.PageIndex = 0; pagerData.PageSize = int.Parse(hdnPageSize.Value.ToString()); pagerData.CurrentPage = currentPage; pagerData.ServicePath = webServicePath; pagerData.SelectMethod = "LoadDynamicGridContent"; pagerData.LoadControlID = divDynamicGridContent.ClientID; pagerData.SiteID = siteID; pagerData.UserID = userID; pagerData.AccessLevelID = accessLevelID; pagerData.PlantDateFormat = dateTimeForamt.DateFormat; pagerData.PlantTimeFormat = dateTimeForamt.TimeFormat; pagerData.PageAccessRights = accessType.ToString(); UserControls.DynamicGridProperties dynamicGridProperties = new UserControls.DynamicGridProperties(); dynamicGridProperties.GridType = UserControls.DynamicGridType.Table; dynamicGridProperties.FeatureID = featureID; dynamicGridProperties.DatePickerFormat = CommonBLL.GetDatePickerDateFormat(dateTimeForamt.DateFormat); dynamicGridProperties.TableHeaderText = Language_Resources.ManageNotification_Resource.listOfNotification; dynamicGridProperties.ImagePath = ConfigurationManager.AppSettings["MaintImagePath"].TrimEnd('/') + "/Styles/Images"; dynamicGridProperties.PagerData = pagerData; dynamicGridProperties.WebServiceName = "Vegam_MaintenanceService.asmx"; dynamicGridProperties.ExcelSheetName = "NotificationlList"; string addNotificationHtml = string.Empty; if (accessType == AccessType.FULL_ACCESS) { addNotificationHtml = "<input id='btnAddNewNotification' type='button' class='btn btn-sm btn-success pull-xs-right pover' data-placement='top' data-content='" + Language_Resources.ManageNotification_Resource.addEditNotificationInfo + "' value='" + Language_Resources.ManageNotification_Resource.addEditNotificationInfo + "' onclick='javascript:AddNewNotification();return false;'/>"; } else { addNotificationHtml = "<input id='btnAddNewNotification' type='button' class='btn btn-sm btn-success pull-xs-right' value='" + Language_Resources.ManageNotification_Resource.addEditNotificationInfo + "' disabled/>"; } Page.ClientScript.RegisterStartupScript(GetType(), "LoadNotificationInfo", "LoadNotificationInfo(" + (new JavaScriptSerializer()).Serialize(dynamicGridProperties) + ",'" + basePath + "',\"" + addNotificationHtml + "\")", true); } }