Beispiel #1
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);
        }