예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // 1st time only
            if (!IsPostBack)
            {
                SetUpIsTestingDropdown();
                SetupThemeDropdown();
                SetUpCountryDropDown();
                SetUpMenuCategoryDropDown();
                SetUpLanguageDropDown();
                drpDefaultClickAction.SelectedValue = PerferenceUtility.GetUserPreferenceByKey(ApplicationCommon.GridDefaultClickActionKey);
                txtAuditId.Text            = SessionVariables.RequestProfile.AuditId.ToString();
                drpIsTesting.SelectedValue = SessionVariables.IsTesting.ToString().ToLower();
                if (!string.IsNullOrEmpty(SessionVariables.UserTheme))
                {
                    drpTheme.SelectedValue = SessionVariables.UserTheme;
                }
                else
                {
                    //drpTheme.SelectedValue = ApplicationVariables.Branding;

                    string   strTmp     = ApplicationVariables.Branding;
                    string[] strTmpArry = strTmp.Split(new char[] { '/' });
                    if (strTmpArry.Length > 0)
                    {
                        drpTheme.SelectedValue = strTmpArry[strTmpArry.Length - 1];
                    }
                }
            }
        }
예제 #2
0
        protected override void GetSettings()
        {
            var searchKeyId = Convert.ToString(Page.RouteData.Values["SearchKey"]);

            if (!string.IsNullOrEmpty(searchKeyId))
            {
                var dataSearchKey = new SearchKeyDataModel();
                dataSearchKey.SearchKeyId = Convert.ToInt32(searchKeyId);

                var ds = Framework.Components.Core.SearchKeyDataManager.SearchByKey(dataSearchKey, SessionVariables.RequestProfile);

                for (var i = 0; i < SearchColumns.Rows.Count; i++)
                {
                    var colName = Convert.ToString(SearchColumns.Rows[i]["Name"]);


                    CheckAndSetFieldValue(colName, GetSearchKeyValue(colName, ds) + "&" +
                                          GetSearchKeyValue(colName + "2", ds) + "&" +
                                          GetSearchKeyValue(colName + "Checked", ds));
                }
            }
            else
            {
                var category = SettingCategory;
                var value    = String.Empty;

                for (var i = 0; i < SearchColumns.Rows.Count; i++)
                {
                    CheckAndSetFieldValue(
                        SearchColumns.Rows[i]["Name"].ToString(), PerferenceUtility.GetUserPreferenceByKey(SearchColumns.Rows[i]["Name"].ToString(),
                                                                                                           category));
                }
            }
        }
예제 #3
0
        public static Dictionary <string, string> GetUserPreferencesForActivityStream(string upCategory)
        {
            var settings = new Dictionary <string, string>();

            //Get Current User's Preferences
            if (SessionVariables.UserPreferences == null)
            {
                PerferenceUtility.RefreshUserPreferencesCache();
            }

            var listKeys = new List <string>()
            {
                DateRangeKey
                , BackGroungColorKey
                , WidthKey
                , DataTypeKey
                , HeightKey
                , ActivityStreamAuditId
                , ActivityStreamPageSize
                , ActivityStreamTitle
                , ActivityStreamPagingStyle
                , ActivityStreamGroupInterval
            };


            var userPreferences = SessionVariables.UserPreferences;

            foreach (var upKey in listKeys)
            {
                settings.Add(upKey, PerferenceUtility.GetUserPreferenceByKey(upKey, upCategory));
            }

            return(settings);
        }
예제 #4
0
        protected override void GetSettings()
        {
            var category = SettingCategory;
            var value    = String.Empty;

            txtSearchConditionStoredProcedureLogId.Text = PerferenceUtility.GetUserPreferenceByKey(Framework.Components.LogAndTrace.StoredProcedureLogRawDataModel.DataColumns.StoredProcedureLogId, category);
        }
예제 #5
0
        private void SetUpMenuCategoryDropDown()
        {
            var menuCategoryData = Framework.Components.Core.MenuCategoryDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(menuCategoryData, drpMenuCategory, StandardDataModel.StandardDataColumns.Name,
                                  StandardDataModel.StandardDataColumns.Name);

            drpMenuCategory.SelectedValue = PerferenceUtility.GetUserPreferenceByKey(ApplicationCommon.UserMenuCategory);
        }
예제 #6
0
        private void SetUpLanguageDropDown()
        {
            var languageData = Framework.Components.Core.LanguageDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(languageData, drpLanguage, StandardDataModel.StandardDataColumns.Name,
                                  LanguageDataModel.DataColumns.LanguageId);

            drpLanguage.SelectedValue = PerferenceUtility.GetUserPreferenceByKey(ApplicationCommon.Language);
        }
예제 #7
0
        public JObject GetUPData(string value, string value1)
        {
            var jObject = new JObject();

            var upKey = value;
            var settingCategoryName = value1;

            jObject["Result"] = PerferenceUtility.GetUserPreferenceByKey(upKey, settingCategoryName);
            return(jObject);
        }
예제 #8
0
        protected override void GetSettings()
        {
            var category = SettingCategory;
            var value    = String.Empty;

            drpSearchConditionSystemEntityType.SelectedIndex = drpSearchConditionSystemEntityType.Items.IndexOf(drpSearchConditionSystemEntityType.Items.
                                                                                                                FindByText(PerferenceUtility.GetUserPreferenceByKey(SuperKeyDataModel.DataColumns.SystemEntityTypeId,
                                                                                                                                                                    category)));
            txtSearchConditionSystemEntityType.Text = drpSearchConditionSystemEntityType.SelectedValue;

            txtSearchConditionName.Text = PerferenceUtility.GetUserPreferenceByKey(StandardDataModel.StandardDataColumns.Name, category);
        }
예제 #9
0
        private int GetSearchKey()
        {
            var searchKeyId = 0;

            var data = new SearchKeyDataModel();

            data.Name        = DateTime.Now.ToLongTimeString();
            data.View        = "ScheduleDetail";
            data.SortOrder   = 1;
            data.Description = "ScheduleDetail";

            searchKeyId = SearchKeyDataManager.Create(data, SessionVariables.RequestProfile);

            var listKeys = new List <string>();

            listKeys.Add(ScheduleDetailDataModel.DataColumns.PersonId);
            listKeys.Add(ScheduleDetailDataModel.DataColumns.ScheduleDetailActivityCategoryId);

            listKeys.Add(ScheduleDetailDataModel.DataColumns.Message);
            listKeys.Add(ScheduleDetailDataModel.DataColumns.WorkDate);

            listKeys.Add(ApplicationCommon.XAxisKey);
            listKeys.Add(ApplicationCommon.YAxisKey);
            listKeys.Add(ApplicationCommon.ZAxisKey);
            listKeys.Add(ApplicationCommon.AggeregateFunctionKey);
            listKeys.Add(ApplicationCommon.ShowAggeregateKey);

            foreach (var key in listKeys)
            {
                //try
                //{
                var columnName  = key;
                var columnValue = PerferenceUtility.GetUserPreferenceByKey(key, SettingCategory);

                var dataDetail = new SearchKeyDetailDataModel();
                dataDetail.SearchKeyId = searchKeyId;

                //ApplicationCommon.UpdateUserPreference(SettingCategory, columnName, columnValue);
                dataDetail.SearchParameter = columnName;
                dataDetail.SortOrder       = 1;
                var detailId = SearchKeyDetailDataManager.Create(dataDetail, SessionVariables.RequestProfile);

                var dataDetailItem = new SearchKeyDetailItemDataModel();
                dataDetailItem.SearchKeyDetailId = detailId;
                dataDetailItem.SortOrder         = 1;

                dataDetailItem.Value = columnValue;
                SearchKeyDetailItemDataManager.Create(dataDetailItem, SessionVariables.RequestProfile);
            }

            return(searchKeyId);
        }
예제 #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var appData = Framework.Components.ApplicationUser.ApplicationDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(appData, ddlApplication, DataModel.Framework.AuthenticationAndAuthorization.ApplicationDataModel.DataColumns.Name,
                                      DataModel.Framework.AuthenticationAndAuthorization.ApplicationDataModel.DataColumns.ApplicationId);


                drpGroupBy.SelectedValue = PerferenceUtility.GetUserPreferenceByKey(ApplicationCommon.GroupBy, SettingCategory);
                //ddlApplication.SelectedValue = PerferenceUtility.GetUserPreferenceByKey("DefaultViewApplicationId", SettingCategory);

                DataBind();
            }
        }
예제 #11
0
        public JObject GetStoredSearchData(string value)
        {
            var settingCategoryName = value;

            var fields = new List<string>(){ 
                    ApplicationCommon.Computer, 
                    ApplicationCommon.ConnectionKey, 
                    ApplicationCommon.LogUser, 
                    ApplicationCommon.GroupBy};

            var jObject = new JObject();

            foreach (var fieldName in fields)
            {               
                jObject[fieldName] = PerferenceUtility.GetUserPreferenceByKey(fieldName, settingCategoryName);
            }

            return jObject;
           
        }
예제 #12
0
        public JObject GetStoredSearchData(string value)
        {
            var settingCategoryName = value;

            var fields = new List <string>()
            {
                "ApplicationUserId",
                "FromSearchDate",
                "ToSearchDate"
            };

            var jObject = new JObject();

            foreach (var fieldName in fields)
            {
                jObject[fieldName] = PerferenceUtility.GetUserPreferenceByKey(fieldName, settingCategoryName);
            }

            return(jObject);
        }
예제 #13
0
        public static DataTable GetExcludedSystemEntities(string categoryName)
        {
            var upValue = PerferenceUtility.GetUserPreferenceByKey(ActivityStreamExcludedEntities, categoryName, categoryName);

            var data = new UserPreferenceSelectedItemDataModel();

            data.ApplicationUserId = SessionVariables.RequestProfile.AuditId;
            data.ParentKey         = upValue;
            var dt = UserPreferenceSelectedItemDataManager.Search(data, SessionVariables.RequestProfile);

            if (dt != null)
            {
                var rowFilter = String.Empty;
                rowFilter = " UserPreferenceKey = '" + ActivityStreamExcludedEntities + "' ";
                var dv = dt.DefaultView;
                dv.RowFilter = rowFilter;
                return(dv.ToTable());
            }
            return(dt);
        }
예제 #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (this.Parent.ID != null)
                {
                    if (!this.Parent.ID.Equals("datepanel"))
                    {
                        SettingCategory = this.Parent.ID;
                    }
                    else
                    {
                        var parent = (Panel)this.Parent;
                        if (parent.ToolTip.Contains("Date"))
                        {
                            SettingCategory = parent.ToolTip;
                        }
                        else
                        {
                            return;
                        }
                    }
                }
                else
                {
                    SettingCategory = "General";
                }
                LoadText();

                var dateRangeData = Framework.Components.UserPreference.DateRangeTitleDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dateRangeData, drpDateRange, StandardDataModel.StandardDataColumns.Name,
                                      DateRangeTitleDataModel.DataColumns.DateRangeTitleId);

                drpDateRange.SelectedItem.Value = PerferenceUtility.GetUserPreferenceByKey(ApplicationCommon.DateRangeFormat, SettingCategory);

                var Dates = DateRangeHelper.FillUpDate(drpDateRange.SelectedItem.Text, SessionVariables.UserDateFormat);
                txtSearchVerticalFromDate.Text = Dates[0];
                txtSearchVerticalToDate.Text   = Dates[1];
                lblUserDateFormat.Text         = SessionVariables.UserDateFormat;
            }
        }
예제 #15
0
        public static void SetExcludedSystemEntities(List <string> lst, string categoryName)
        {
            var upValue = PerferenceUtility.GetUserPreferenceByKey(ActivityStreamExcludedEntities, categoryName, categoryName);
            var upkId   = PerferenceUtility.GetUserPreferenceKey(ActivityStreamExcludedEntities);

            var data = new UserPreferenceSelectedItemDataModel();

            data.UserPreferenceKeyId = upkId;
            UserPreferenceSelectedItemDataManager.Delete(data, SessionVariables.RequestProfile);

            foreach (var strValue in lst)
            {
                data = new UserPreferenceSelectedItemDataModel();
                data.UserPreferenceKeyId = upkId;
                data.ApplicationUserId   = SessionVariables.RequestProfile.AuditId;
                data.ParentKey           = upValue;
                data.Value     = strValue;
                data.SortOrder = 1;
                UserPreferenceSelectedItemDataManager.Create(data, SessionVariables.RequestProfile);
            }
        }
예제 #16
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            PrimaryEntity         = SystemEntity.FunctionalityEntityStatus;
            PrimaryEntityKey      = "FunctionalityEntityStatus";
            PrimaryEntityIdColumn = "FunctionalityEntityStatusId";

            MasterPageCore   = Master;
            SubMenuCore      = Master.SubMenuObject;
            BreadCrumbObject = Master.BreadCrumbObject;

            SearchFilterCore = oSearchFilter;
            GroupListCore    = oGroupList;

            IsDynamicSearchControl = true;

            VisibilityManagerCore = oVC;

            oSearchFilter.ShowGraph = bool.Parse(PerferenceUtility.GetUserPreferenceByKey("ShowGraph", "FunctionalityEntityStatusDefaultViewSearchControl"));
        }
예제 #17
0
        protected void drpGridViewMode_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (drpGridViewMode.SelectedValue == "classic")
            {
                ViewMode = GridViewMode.Classic;
                dynAdvancedMode.Visible = false;
            }
            else
            {
                txtInterval.Text        = PerferenceUtility.GetUserPreferenceByKey(ApplicationCommon.HistoryAdvancedModeIntervalKey);
                dynAdvancedMode.Visible = true;
                ViewMode = GridViewMode.Advanced;
            }

            var primaryKeyId = ViewState["PrimaryKey"].ToString();

            dtGlobal = GetData();

            Sample(dtGlobal, primaryKeyId, HideData, SessionVariables.IsTesting);
            MainGridView.DataSource = dtGlobal;
            MainGridView.DataBind();
        }
예제 #18
0
        private int SetUpDropDownFCMode()
        {
            //var systemEntityTypeId = (int)Enum.Parse(typeof(SystemEntity), "ScheduleDetail");
            ///var dt = GetApplicableModesList(systemEntityTypeId);
            var systemEntityType = (SystemEntity)Enum.Parse(typeof(SystemEntity), "ScheduleDetail");
            var dt              = FieldConfigurationUtility.GetApplicableModesList(systemEntityType);
            var modeSelected    = SessionVariables.GetSessionInstanceFCMode("ScheduleDetail");
            var settingCategory = "ScheduleDetailDefaultViewListControl";
            var upcId           = PerferenceUtility.CreateUserPreferenceCategoryIfNotExists(settingCategory, settingCategory);
            var fcModeSelected  = PerferenceUtility.GetUserPreferenceByKey(ApplicationCommon.FieldConfigurationMode, settingCategory);
            var currentEntity   = "ScheduleDetail";

            if (dt.Rows.Count > 0)
            {
                ddlFieldConfigurationMode.DataSource     = dt;
                ddlFieldConfigurationMode.DataTextField  = "Name";
                ddlFieldConfigurationMode.DataValueField = "FieldConfigurationModeId";
                ddlFieldConfigurationMode.DataBind();
                ddlFieldConfigurationMode.SelectedValue = modeSelected.ToString();

                if (Convert.ToInt32(fcModeSelected) > 0)
                {
                    ddlFieldConfigurationMode.SelectedValue = fcModeSelected.ToString();
                    SessionVariables.SaveSessionInstanceFCMode(Convert.ToInt32(fcModeSelected), currentEntity);
                    modeSelected = (int)Session["ScheduleDetail" + "SelectedMode"];
                }
                else
                {
                    ddlFieldConfigurationMode.SelectedValue = modeSelected.ToString();
                }
            }
            else
            {
                ddlFieldConfigurationMode.Visible = false;
            }

            return(modeSelected);
        }
예제 #19
0
        private void LoadUserPreferences()
        {
            drpPersons.SelectedValue      = PerferenceUtility.GetUserPreferenceByKey(ScheduleDetailDataModel.DataColumns.PersonId, SettingCategory);
            drpWorkCategory.SelectedValue = PerferenceUtility.GetUserPreferenceByKey(ScheduleDetailDataModel.DataColumns.ScheduleDetailActivityCategoryId, SettingCategory);
            txtMessage.Text = PerferenceUtility.GetUserPreferenceByKey(ScheduleDetailDataModel.DataColumns.Message, SettingCategory);

            drpXAxis.SelectedValue = PerferenceUtility.GetUserPreferenceByKey(ApplicationCommon.XAxisKey, SettingCategory);
            drpYAxis.SelectedValue = PerferenceUtility.GetUserPreferenceByKey(ApplicationCommon.YAxisKey, SettingCategory);
            drpZAxis.SelectedValue = PerferenceUtility.GetUserPreferenceByKey(ApplicationCommon.ZAxisKey, SettingCategory);

            drpFunction.SelectedValue       = PerferenceUtility.GetUserPreferenceByKey(ApplicationCommon.AggeregateFunctionKey, SettingCategory);
            drpShowAggeregate.SelectedValue = PerferenceUtility.GetUserPreferenceByKey(ApplicationCommon.ShowAggeregateKey, SettingCategory);

            var searchDates = PerferenceUtility.GetUserPreferenceByKey(ScheduleDetailDataModel.DataColumns.WorkDate, SettingCategory);
            var dates       = searchDates.Split('&');

            oDateRange.SettingCategory = SettingCategory + "DateRangeControl";
            oDateRange.SetDateValues(searchDates);

            if (dates.Length > 2)
            {
                oDateRange.Checked = bool.Parse(dates[2]);
            }
        }
예제 #20
0
        public IEnumerable <FieldConfigurationDataModel> GetSearchFilterColumns(string value, string value1)
        {
            var settingCategory     = value1;
            var searchControlModeId = SessionVariables.SearchControlColumnsModeId.ToString();
            var entityName          = value;
            var lstColumns          = GetFieldConfigurations(searchControlModeId, entityName).ToList();

            // get previously stored values using Setting Category and Name of the Field Configuration,
            // storing it in Value field as that is used as the model in angular
            for (var i = 0; i < lstColumns.Count; i++)
            {
                lstColumns[i].Value = PerferenceUtility.GetUserPreferenceByKey(lstColumns[i].Name, settingCategory);
                if (string.IsNullOrEmpty(lstColumns[i].Value))
                {
                    lstColumns[i].Value = "";
                }
                else if (lstColumns[i].Value == "None")
                {
                    lstColumns[i].Value = "-1";
                }
            }

            return(lstColumns);
        }
예제 #21
0
 public static string GetWildCardSearchPostfix(string category)
 {
     return(PerferenceUtility.GetUserPreferenceByKey("WildCardSearchPostfix", category));
 }
예제 #22
0
        protected override void GetSettings()
        {
            var category = SettingCategory;
            var value    = String.Empty;

            drpSearchConditionPerson.SelectedIndex = drpSearchConditionPerson.Items.IndexOf(drpSearchConditionPerson.Items.
                                                                                            FindByText(PerferenceUtility.GetUserPreferenceByKey(SystemDevNumbersDataModel.DataColumns.PersonId,
                                                                                                                                                category)));
            txtSearchConditionPerson.Text = drpSearchConditionPerson.SelectedValue;
        }
예제 #23
0
 protected override void GetSettings()
 {
     txtSearchConditionName.Text = PerferenceUtility.GetUserPreferenceByKey(HelpPageDataModel.DataColumns.Name, SettingCategory);
     drpSearchConditionHelpPageContext.SelectedValue  = PerferenceUtility.GetUserPreferenceByKey(HelpPageContexDataModel.DataColumns.HelpPageContextId, SettingCategory);
     drpSearchConditionSystemEntityType.SelectedValue = PerferenceUtility.GetUserPreferenceByKey(SystemEntityTypeDataModel.DataColumns.SystemEntityTypeId, SettingCategory);
 }
예제 #24
0
        // reName to better
        private void SetHyperLink(DataColumn dataColumn, string[] str, string entity, bool enableLInk)
        {
            var tableFolder = Convert.ToString(ViewState["TableFolder"]);
            //var bField = new BoundField();
            //bField.DataField = dataColumn.ColumnName;
            //bField.SortExpression = dataColumn.Caption;
            //bField.HeaderText = dataColumn.ColumnName;
            //bField.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
            //MainGridView.Columns.Add(bField);

            var hypField       = new HyperLinkField();
            var flagGridFormat = false;

            var headerWidth     = "100";
            var headerAlignment = "Center";
            var headerTextValue = "";
            //ConsoleColor headerColor	;

            //string imgArrowDown = Application["Branding"] + "/Images/arrow-down.jpg";
            //string imgArrowUp = Application["Branding"] + "/Images/arrow-up.jpg";

            var split = " ";

            if (dataColumn.ColumnName == "ApplicationId")
            {
                hypField.Visible = false;
            }

            var gridFormatdt = GetGridFormatSettings();

            foreach (DataRow row in gridFormatdt.Rows)
            {
                var headerTextName = row[FieldConfigurationDataModel.DataColumns.Name].
                                     ToString();

                headerTextValue = row[FieldConfigurationDataModel.DataColumns.Value].
                                  ToString();

                if (dataColumn.ColumnName == headerTextName)
                {
                    headerWidth = row[FieldConfigurationDataModel.DataColumns.Width].ToString();

                    headerAlignment = row[FieldConfigurationDataModel.DataColumns.HorizontalAlignment].
                                      ToString();

                    //headerColor		= row[FieldConfiguration.DataColumns.Formatting].
                    //ToString();

                    flagGridFormat = true;
                    break;
                }

                //else
                //{
                //    hypField.HeaderText = dataColumn.ColumnName;
                //    hypField.HeaderStyle.BackColor = System.Drawing.Color.Cyan;
                //}
                //if (e.Row.Cells[i].Text == headerText)
                //{


                //    e.Row.Cells[i].Style.Add("width", headerWidth);
                //    //foreach (DataColumn column in MainGridView.Columns)
                //    //{
                //    //    if (column.ColumnName == headerText)
                //    //    {
                //    //        column.MaxLength = headerWidth;
                //    //        break;
                //    //    }
                //    //}
                //    //MainGridView.Columns[1].HeaderStyle.Width = headerWidth;
                //    e.Row.Cells[i].Style.Add("text-align", headerAlignment);
                //    //e.Row.Cells[i].Width = headerWidth;
                //    //e.Row.Cells[i].BackColor = headerColor;
                //    e.Row.Cells[i].Style.Add("text-color", headerColor);
                //    break;
                //}
            }

            if (dataColumn.ColumnName.Contains("Name"))
            {
                split = dataColumn.ColumnName.Replace("Name", " Name");
                hypField.HeaderText = split;
            }
            else if (dataColumn.ColumnName.Contains("Id"))
            {
                split = dataColumn.ColumnName.Replace("Id", " Id");
                hypField.HeaderText = split;
            }
            else
            {
                hypField.HeaderText = dataColumn.ColumnName;

                //hypField.HeaderStyle.ForeColor =
            }


            if (flagGridFormat)
            {
                hypField.HeaderStyle.Width           = Unit.Parse(headerWidth);
                hypField.HeaderStyle.HorizontalAlign = GetHeaderAlignment(headerAlignment);
                hypField.HeaderStyle.BackColor       = Color.Black;
                hypField.HeaderText = headerTextValue;
            }

            //if (dataColumn.ColumnName.Contains("Name"))
            //{
            //    split = dataColumn.ColumnName.Replace("Name", " Name");
            //    hypField.HeaderText = split;
            //}
            //else if (dataColumn.ColumnName.Contains("Id"))
            //{
            //    split = dataColumn.ColumnName.Replace("Id", " Id");
            //    hypField.HeaderText = split;
            //}
            //else
            //{
            //    hypField.HeaderText = dataColumn.ColumnName;
            //    hypField.HeaderStyle.Width = 1000;
            //    hypField.HeaderStyle.HorizontalAlign = HorizontalAlign.Right;
            //    //hypField.HeaderStyle.ForeColor =
            //}

            hypField.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
            hypField.DataTextField             = dataColumn.ColumnName;

            if (!enableLInk)
            {
                hypField.SortExpression = dataColumn.ColumnName;
                //hypField.HeaderText += "<img src='"+imgArrowDown+"' alt='' />";
                hypField.DataNavigateUrlFields = str;

                var userClickAction = String.Empty;
                //userClickAction = ApplicationCommon.GetDefaultActionLink();
                userClickAction = PerferenceUtility.GetUserPreferenceByKey(ApplicationCommon.GridDefaultClickActionKey);
                userClickAction = userClickAction.ToLower();
                var actionPage = String.Empty;

                if (userClickAction == "detail")
                {
                    actionPage = "Details";
                }
                else if (userClickAction == "update")
                {
                    actionPage = "Update";
                }
                else
                {
                    actionPage = "Details";
                }

                if (tableFolder == " ")
                {
                    hypField.DataNavigateUrlFormatString = "~/" + entity + "/" + actionPage + ".aspx?SetId={0}";
                }
                else
                {
                    hypField.DataNavigateUrlFormatString = "~/" + tableFolder + "/" + entity + "/" + actionPage + ".aspx?SetId={0}";
                }
            }
            //hypField.NavigateUrl = "~/" + tableName + "/Details.aspx?SetId=" + dt.Columns[primaryKeyId];

            MainGridView.Columns.Add(hypField);
        }
예제 #25
0
        public void Setup(int systemEntityId, int entityKey, string UserPreferenceCategory = "")
        {
            var tableName  = "AuditHistory";
            var primaryKey = "AuditHistoryId";
            var isPaging   = true;

            SystemEntityTypeId = systemEntityId;
            EntityKey          = entityKey;
            Prefix             = entityKey.ToString();

            var userPreferenceCategory = UserPreferenceCategory;

            if (string.IsNullOrEmpty(userPreferenceCategory))
            {
                userPreferenceCategory = tableName;
            }

            SetViewState();

            var userGrouping = PerferenceUtility.GetUserPreferenceByKey(ApplicationCommon.HistoryAdvancedModeGroupingKey, userPreferenceCategory);

            if (userGrouping == "timeinterval")
            {
                AdvancedModeGrouping = GridViewAdvancedModeGrouping.TimeInterval;
                txtInterval.Text     = Convert.ToString(ConvertTimeIntervalInMinute(PerferenceUtility.GetUserPreferenceByKeyAsInt(ApplicationCommon.HistoryAdvancedModeIntervalKey)));
                drpAdvancedModeGrouping.SelectedValue = "timeinterval";
                dynIntervalMode.Visible = true;
            }
            else
            {
                dynIntervalMode.Visible = false;
                if (userGrouping == "auditaction")
                {
                    AdvancedModeGrouping = GridViewAdvancedModeGrouping.AuditAction;
                    drpAdvancedModeGrouping.SelectedValue = "auditaction";
                }
                else if (userGrouping == "actionby")
                {
                    AdvancedModeGrouping = GridViewAdvancedModeGrouping.ActionByAndAuditAction;
                    drpAdvancedModeGrouping.SelectedValue = "actionby";
                }
            }


            dtGlobal = GetData();

            Sample(dtGlobal, primaryKey, HideData, SessionVariables.IsTesting);
            MainGridView.DataSource = dtGlobal;

            if (isPaging)
            {
                MainGridView.PageSize = SessionVariables.DefaultRowCount;

                oGridPagiation = new GridPagiation();
                oGridPagiation.Setup(plcPaging, litPagingSummary, lblCacheStatus, dtGlobal, MainGridView, Page, SettingCategory);
                oGridPagiation.Changed += oGridPagiation_Changed;

                if (ViewState[Prefix + "CurrentPageIndex"] != null)
                {
                    oGridPagiation.PageIndexInSession = int.Parse(ViewState[Prefix + "CurrentPageIndex"].ToString());
                }

                oGridPagiation.ManagePaging(dtGlobal);
            }
            else
            {
                MainGridView.AllowPaging = isPaging;
            }
            MainGridView.DataBind();
        }
예제 #26
0
 public static int GetDropDownSelectedIndex(DropDownList ddlObject, string key, string category)
 {
     return(ddlObject.Items.IndexOf(ddlObject.Items.FindByText(PerferenceUtility.GetUserPreferenceByKey(key, category))));
 }
예제 #27
0
        protected override void GetSettings()
        {
            var category = SettingCategory;
            var value    = String.Empty;

            drpSearchConditionSuperKey.SelectedIndex = drpSearchConditionSuperKey.Items.IndexOf(drpSearchConditionSuperKey.Items.
                                                                                                FindByText(PerferenceUtility.GetUserPreferenceByKey(SuperKeyDetailDataModel.DataColumns.SuperKeyId,
                                                                                                                                                    category)));
            txtSearchConditionSuperKey.Text = drpSearchConditionSuperKey.SelectedValue;
        }