当前位置: 首页>>代码示例>>C#>>正文


C# User_Object.Add_Setting方法代码示例

本文整理汇总了C#中SobekCM.Library.Users.User_Object.Add_Setting方法的典型用法代码示例。如果您正苦于以下问题:C# User_Object.Add_Setting方法的具体用法?C# User_Object.Add_Setting怎么用?C# User_Object.Add_Setting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SobekCM.Library.Users.User_Object的用法示例。


在下文中一共展示了User_Object.Add_Setting方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Track_Item_MySobekViewer

        /// <summary> Constructor for a new instance of the Track_Item_MySobekViewer class </summary>
        /// <param name="User"> Authenticated user information </param>
        /// <param name="Current_Mode"> Mode / navigation information for the current request</param>
        /// <param name="Tracer">Trace object keeps a list of each method executed and important milestones in rendering</param>
        public Track_Item_MySobekViewer(User_Object User, SobekCM_Navigation_Object Current_Mode, Custom_Tracer Tracer)
            : base(User)
        {
            Tracer.Add_Trace("Track_Item_MySobekViewer.Constructor", String.Empty);

            currentMode = Current_Mode;

            //If there is no user, go back
            if (user == null)
            {
                currentMode.My_Sobek_Type = My_Sobek_Type_Enum.Home;
                HttpContext.Current.Response.Redirect(currentMode.Redirect_URL());
            }

            //Initialize variables
            tracking_users = new DataTable();
            user_list = new Dictionary<string, User_Object>();
            scanners_list = new List<string>();

            //Determine the page
            page = 1;

            if ((HttpContext.Current.Session["Selected_Tab"] != null) && !(String.IsNullOrEmpty(HttpContext.Current.Session["Selected_Tab"].ToString())) && HttpContext.Current.Session["Selected_Tab"] == "2")
                page = 2;

            string sub_page = HttpContext.Current.Request.Form["tracking_new_page"] ?? "";
            if (sub_page == "2")
            {
                page = 2;
                HttpContext.Current.Session["Selected_Tab"] = "2";
            }
            else if (sub_page == "1")
            {
                page = 1;
                HttpContext.Current.Session["Selected_Tab"] = "1";
            }

            //Get the list of users who are possible Scanning/Processing technicians from the DB
            tracking_users = Database.SobekCM_Database.Tracking_Get_Users_Scanning_Processing();

            foreach (DataRow row in tracking_users.Rows)
            {
                User_Object temp_user = new User_Object();
                temp_user.UserName = row["UserName"].ToString();
                temp_user.Given_Name = row["FirstName"].ToString();
                temp_user.Family_Name = row["LastName"].ToString();
                temp_user.Email = row["EmailAddress"].ToString();
                user_list.Add(temp_user.UserName, temp_user);
            }

            if (!user_list.ContainsKey(User.UserName))
                user_list.Add(User.UserName, User);

            //Get the list of scanning equipment
            DataTable scanners = new DataTable();
            scanners = Database.SobekCM_Database.Tracking_Get_Scanners_List();
            foreach (DataRow row in scanners.Rows)
            {
                scanners_list.Add(row["ScanningEquipment"].ToString());
            }

            //See if there were any hidden requests
            hidden_request = HttpContext.Current.Request.Form["Track_Item_behaviors_request"] ?? String.Empty;
            hidden_value = HttpContext.Current.Request.Form["Track_Item_hidden_value"] ?? String.Empty;

            //Get the equipment value
            //if (HttpContext.Current.Session["Equipment"] != null && !String.IsNullOrEmpty(HttpContext.Current.Session["Equipment"].ToString()))
            //    equipment = HttpContext.Current.Session["Equipment"].ToString();
            if (User.Get_Setting("Track_Item_MySobekViewer:Equipment") != null && !String.IsNullOrEmpty(User.Get_Setting("Track_Item_MySobekViewer:Equipment").ToString()))
                equipment = User.Get_Setting("Track_Item_MySobekViewer:Equipment").ToString();

            else
            {
                equipment = scanners_list[0];
                User.Add_Setting("Track_Item_MySobekViewer:Equipment", equipment);
                //  HttpContext.Current.Session["Equipment"] = equipment;
            }

            //Check the hidden value to see if equipment was previously changed
            if (!String.IsNullOrEmpty(HttpContext.Current.Request.Form["hidden_equipment"]))
            {
                equipment = HttpContext.Current.Request.Form["hidden_equipment"];
                //   HttpContext.Current.Session["equipment"] = equipment;
                User.Add_Setting("Track_Item_MySobekViewer:Equipment", equipment);
            }

            //Also get the currently selected user
            if (HttpContext.Current.Session["Selected_User"] != null)
                current_selected_user = (User_Object)HttpContext.Current.Session["Selected_User"];

            else
            {
                current_selected_user = User;
                HttpContext.Current.Session["Selected_User"] = current_selected_user;
            }

//.........这里部分代码省略.........
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:101,代码来源:Track_Item_MySobekViewer.cs

示例2: build_user_object_from_dataset


//.........这里部分代码省略.........
            user.Department = userRow["Department"].ToString();
            user.College = userRow["College"].ToString();
            user.Unit = userRow["Unit"].ToString();
            user.Default_Rights = userRow["Rights"].ToString();
            user.Preferred_Language = userRow["Language"].ToString();
            user.Is_Internal_User = Convert.ToBoolean(userRow["Internal_User"]);
            user.Edit_Template_Code = userRow["EditTemplate"].ToString();
            user.Edit_Template_MARC_Code = userRow["EditTemplateMarc"].ToString();
            user.Can_Delete_All = Convert.ToBoolean(userRow["Can_Delete_All_Items"]);
            user.Is_System_Admin = Convert.ToBoolean(userRow["IsSystemAdmin"]);
            user.Is_Portal_Admin = Convert.ToBoolean(userRow["IsPortalAdmin"]);
            user.Include_Tracking_In_Standard_Forms = Convert.ToBoolean(userRow["Include_Tracking_Standard_Forms"]);
            user.Receive_Stats_Emails = Convert.ToBoolean(userRow["Receive_Stats_Emails"]);
            user.Has_Item_Stats = Convert.ToBoolean(userRow["Has_Item_Stats"]);
            user.LoggedOn = true;
            user.Internal_Notes = userRow["InternalNotes"].ToString();
            user.Processing_Technician = Convert.ToBoolean(userRow["ProcessingTechnician"]);
            user.Scanning_Technician = Convert.ToBoolean(userRow["ScanningTechnician"]);

            if (Convert.ToInt32(userRow["descriptions"]) > 0)
                user.Has_Descriptive_Tags = true;

            foreach (DataRow thisRow in ResultSet.Tables[1].Rows)
            {
                user.Add_Template(thisRow["TemplateCode"].ToString(), Convert.ToBoolean(thisRow["GroupDefined"].ToString()));
            }

            foreach (DataRow thisRow in ResultSet.Tables[2].Rows)
            {
                user.Add_Default_Metadata_Set(thisRow["MetadataCode"].ToString(), Convert.ToBoolean(thisRow["GroupDefined"].ToString()));
            }

            user.Items_Submitted_Count = ResultSet.Tables[3 ].Rows.Count;
            foreach (DataRow thisRow in ResultSet.Tables[3 ].Rows)
            {
                if (!user.BibIDs.Contains(thisRow["BibID"].ToString().ToUpper()))
                    user.Add_BibID(thisRow["BibID"].ToString().ToUpper());
            }

            // Add links to regular expressions
            foreach (DataRow thisRow in ResultSet.Tables[4 ].Rows)
            {
                user.Add_Editable_Regular_Expression(thisRow["EditableRegex"].ToString());
            }

            // Add links to aggregations
            foreach (DataRow thisRow in ResultSet.Tables[5 ].Rows)
            {

                user.Add_Aggregation(thisRow["Code"].ToString(), thisRow["Name"].ToString(), Convert.ToBoolean(thisRow["CanSelect"]), Convert.ToBoolean(thisRow["CanEditMetadata"]), Convert.ToBoolean(thisRow["CanEditBehaviors"]), Convert.ToBoolean(thisRow["CanPerformQc"]), Convert.ToBoolean(thisRow["CanUploadFiles"]), Convert.ToBoolean(thisRow["CanChangeVisibility"]), Convert.ToBoolean(thisRow["CanDelete"]), Convert.ToBoolean(thisRow["IsCollectionManager"]), Convert.ToBoolean(thisRow["OnHomePage"]), Convert.ToBoolean(thisRow["IsAggregationAdmin"]), Convert.ToBoolean(thisRow["GroupDefined"]));

            }

            // Add the current folder names
            Dictionary<int, User_Folder> folderNodes = new Dictionary<int, User_Folder>();
            List<User_Folder> parentNodes = new List<User_Folder>();
            foreach (DataRow folderRow in ResultSet.Tables[6 ].Rows)
            {
                string folderName = folderRow["FolderName"].ToString();
                int folderid = Convert.ToInt32(folderRow["UserFolderID"]);
                int parentid = Convert.ToInt32(folderRow["ParentFolderID"]);
                bool isPublic = Convert.ToBoolean(folderRow["isPublic"]);

                User_Folder newFolderNode = new User_Folder(folderName, folderid) {isPublic = isPublic};
                if (parentid == -1)
                    parentNodes.Add(newFolderNode);
                folderNodes.Add(folderid, newFolderNode);
            }
            foreach (DataRow folderRow in ResultSet.Tables[6 ].Rows)
            {
                int folderid = Convert.ToInt32(folderRow["UserFolderID"]);
                int parentid = Convert.ToInt32(folderRow["ParentFolderID"]);
                if (parentid > 0)
                {
                    folderNodes[parentid].Add_Child_Folder(folderNodes[folderid]);
                }
            }
            foreach (User_Folder rootFolder in parentNodes)
                user.Add_Folder(rootFolder);

            // Get the list of BibID/VID associated with this
            foreach (DataRow itemRow in ResultSet.Tables[7 ].Rows)
            {
                user.Add_Bookshelf_Item(itemRow["BibID"].ToString(), itemRow["VID"].ToString());
            }

            // Add the user groups to which this user is a member
            foreach (DataRow groupRow in ResultSet.Tables[8].Rows)
            {
                user.Add_User_Group(groupRow[0].ToString());
            }

            // Get all the user settings
            foreach (DataRow settingRow in ResultSet.Tables[9].Rows)
            {
                user.Add_Setting(settingRow["Setting_Key"].ToString(), settingRow["Setting_Value"].ToString(), false);
            }

            return user;
        }
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:101,代码来源:SobekCM_Database.cs

示例3: QC_ItemViewer


//.........这里部分代码省略.........
            {
                // Parse the values and save to the session
                if (Int32.TryParse(temp_width, out allThumbnailsOuterDiv1Width))
                    HttpContext.Current.Session["QC_AllThumbnailsWidth"] = allThumbnailsOuterDiv1Width;
                if (Int32.TryParse(temp_height, out allThumbnailsOuterDiv1Height))
                    HttpContext.Current.Session["QC_AllThumbnailsHeight"] = allThumbnailsOuterDiv1Height;

            }
            else
            {
                object session_width = HttpContext.Current.Session["QC_AllThumbnailsWidth"];
                if (session_width != null)
                    allThumbnailsOuterDiv1Width = (int) session_width;
                object session_height = HttpContext.Current.Session["QC_AllThumbnailsHeight"];
                if (session_height != null)
                    allThumbnailsOuterDiv1Height = (int) session_height;
            }

            // See if there were hidden requests
            hidden_request = HttpContext.Current.Request.Form["QC_behaviors_request"] ?? String.Empty;
            hidden_main_thumbnail = HttpContext.Current.Request.Form["Main_Thumbnail_File"] ?? String.Empty;
            hidden_move_relative_position = HttpContext.Current.Request.Form["QC_move_relative_position"] ?? String.Empty;
            hidden_move_destination_fileName = HttpContext.Current.Request.Form["QC_move_destination"] ?? String.Empty;
            autonumber_number_system = HttpContext.Current.Request.Form["Autonumber_number_system"] ?? String.Empty;
            string temp = HttpContext.Current.Request.Form["autonumber_mode_from_form"] ?? "0";
            Int32.TryParse(temp, out autonumber_mode_from_form);
            autonumber_text_only = HttpContext.Current.Request.Form["Autonumber_text_without_number"] ?? String.Empty;
            autonumber_number_only = HttpContext.Current.Request.Form["Autonumber_number_only"] ?? String.Empty;
            autonumber_number_system = HttpContext.Current.Request.Form["Autonumber_number_system"] ?? String.Empty;
            hidden_autonumber_filename = HttpContext.Current.Request.Form["Autonumber_last_filename"] ?? String.Empty;
            temp = HttpContext.Current.Request.Form["QC_sortable_option"] ?? "-1";
            if (Int32.TryParse(temp, out makeSortable) && (makeSortable > 0) && (makeSortable <= 3))
            {
                CurrentUser.Add_Setting("QC_ItemViewer:SortableMode",makeSortable);
            }
            temp = HttpContext.Current.Request.Form["QC_autonumber_option"] ?? "-1";
            if ((Int32.TryParse(temp, out autonumber_mode)) && ( autonumber_mode >= 0 ) && ( autonumber_mode <= 2 ))
            {
                CurrentUser.Add_Setting("QC_ItemViewer:AutonumberingMode", autonumber_mode);
            }

            //Get any notes/comments entered by the user
            notes = HttpContext.Current.Request.Form["txtComments"] ?? String.Empty;

            if (!(Int32.TryParse(HttpContext.Current.Request.Form["QC_Sortable"], out makeSortable))) makeSortable = 3;
            // If the hidden move relative position is BEFORE, it is before the very first page
            if (hidden_move_relative_position == "Before")
                hidden_move_destination_fileName = "[BEFORE FIRST]";

            try
            {

                //Call the JavaScript autosave function based on the option selected
                bool autosaveCacheValue = true;
                bool autosaveCache = false;

                //Conversion result of autosaveCacheValue(conversion successful or not) saved in autosaveCache

                if (HttpContext.Current.Session["autosave_option"] != null)
                    autosaveCache = bool.TryParse(HttpContext.Current.Session["autosave_option"].ToString(), out autosaveCacheValue);
                bool convert = bool.TryParse(HttpContext.Current.Request.Form["Autosave_Option"], out autosave_option);
                if (!convert && !autosaveCache)
                {
                    autosave_option = true;
                }
                else if (!convert && autosaveCache)
开发者ID:randomyed,项目名称:SobekCM-Web-Application,代码行数:67,代码来源:QC_ItemViewer.cs


注:本文中的SobekCM.Library.Users.User_Object.Add_Setting方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。