Beispiel #1
0
        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_Refernce

                ScriptReference scriptReference = new ScriptReference();
                scriptReference.Path = ConfigurationManager.AppSettings["MaintBasePath"].ToString().TrimEnd('/') + "/ScriptResources/MaintenanceInfoScriptResource.js";
                string[] cultures = ConfigurationManager.AppSettings["SupportLanguages"].ToString().Split(',');
                scriptReference.ResourceUICultures = CommonBLL.GetCultures(cultures, scriptReference.Path);
                scriptManager1.Scripts.Add(scriptReference);

                #endregion

                //Below values must be updated,it will effect full page
                userID        = this.CurrentUser.UserID;
                siteID        = CommonBLL.ValidateSiteID(Request);
                accessLevelID = CommonBLL.GetAccessLevelID(this.CurrentUser.AccessLevel);

                if (siteID == 0)
                {
                    Response.Redirect(ConfigurationManager.AppSettings["NoAccessPage"].ToString());
                }

                //validate user privileges
                #region Feature Info
                List <int> pageIDList = new List <int>();
                pageIDList.Add(Convert.ToInt32(Language_Resources.MaintenancePageID_Resource.Configure_Functional_Loc));
                pageIDList.Add(Convert.ToInt32(Language_Resources.MaintenancePageID_Resource.Configure_Equipment_Models));
                pageIDList.Add(Convert.ToInt32(Language_Resources.MaintenancePageID_Resource.Configure_Equipments));
                pageIDList.Add(Convert.ToInt32(Language_Resources.MaintenancePageID_Resource.Configure_Measuring_Point));
                #endregion

                List <Tuple <string, bool> > manageFeatureInfoList = ValidateManageUserPrivileges(siteID, accessLevelID, pageIDList);

                string MaintBasePath       = ConfigurationManager.AppSettings["MaintBasePath"].ToString().TrimEnd('/');
                string coreBasePath        = ConfigurationManager.AppSettings["coreBasePath"].ToString().TrimEnd('/');
                string maintWebServicePath = ConfigurationManager.AppSettings["MaintWebServicePath"].ToString().TrimEnd('/');

                Vegam_MaintenanceService.BasicParam basicParam = new Vegam_MaintenanceService.BasicParam();
                basicParam.SiteID        = siteID;
                basicParam.UserID        = userID;
                basicParam.AccessLevelID = accessLevelID;

                ScriptManager.RegisterStartupScript(this, this.GetType(), "LoadMaintenanceInfo", "javascript:LoadMaintenanceInfo(" + (new JavaScriptSerializer()).Serialize(basicParam) + "," + (new JavaScriptSerializer()).Serialize(manageFeatureInfoList) + ",'" + MaintBasePath + "','" + coreBasePath + "','" + maintWebServicePath + "');", 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/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);
            }
        }
Beispiel #5
0
        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);
            }
        }
Beispiel #6
0
        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_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);
            }
        }