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


C# IIdentity.GetUdfFieldPermissionLevel方法代码示例

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


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

示例1: print_bug


//.........这里部分代码省略.........
			// start of the table with the bug fields
			Response.Write ("\n<table border=1 cellpadding=3 cellspacing=0>");
            Response.Write("\n<tr><td>Last changed by<td>"
				+ format_username((string)dr["last_updated_user"],(string)dr["last_updated_fullname"])
				+ "&nbsp;");
            Response.Write("\n<tr><td>Reported By<td>"
				+ format_username((string)dr["reporter"],(string)dr["reporter_fullname"])
				+ "&nbsp;");
            Response.Write("\n<tr><td>Reported On<td>" + btnet.Util.format_db_date_and_time(dr["reported_date"]) + "&nbsp;");

            if (identity.GetTagsFieldPermissionLevel() > 0)
	            Response.Write("\n<tr><td>Tags<td>" + dr["bg_tags"] + "&nbsp;");

            if (identity.GetProjectFieldPermissionLevel() > 0)
	            Response.Write("\n<tr><td>Project<td>" + dr["current_project"] + "&nbsp;");

            if (identity.GetOrgFieldPermissionLevel() > 0)
	            Response.Write("\n<tr><td>Organization<td>" + dr["og_name"] + "&nbsp;");

            if (identity.GetCategoryFieldPermissionLevel()> 0)
	            Response.Write("\n<tr><td>Category<td>" + dr["category_name"] + "&nbsp;");

            if (identity.GetPriorityFieldPermissionLevel() > 0)
	            Response.Write("\n<tr><td>Priority<td>" + dr["priority_name"] + "&nbsp;");

            if (identity.GetAssignedToFieldPermissionLevel() > 0)
	            Response.Write("\n<tr><td>Assigned<td>"
					+ format_username((string)dr["assigned_to_username"],(string)dr["assigned_to_fullname"])
					+ "&nbsp;");

            if (identity.GetStatusFieldPermissionLevel() > 0)
            	Response.Write("\n<tr><td>Status<td>" + dr["status_name"] + "&nbsp;");

			if (identity.GetUdfFieldPermissionLevel() > 0)
				if (btnet.Util.get_setting("ShowUserDefinedBugAttribute","1") == "1")
				{
					Response.Write("\n<tr><td>"
						+ btnet.Util.get_setting("UserDefinedBugAttributeName","YOUR ATTRIBUTE")
						+ "<td>"
						+ dr["udf_name"] + "&nbsp;");
				}

			// Get custom column info  (There's an inefficiency here - we just did this
			// same call in get_bug_datarow...)				

			// create project custom dropdowns
			if ((int)dr["project"] != 0)
			{

				var sql = new SQLString(@"select
					isnull(pj_enable_custom_dropdown1,0) [pj_enable_custom_dropdown1],
					isnull(pj_enable_custom_dropdown2,0) [pj_enable_custom_dropdown2],
					isnull(pj_enable_custom_dropdown3,0) [pj_enable_custom_dropdown3],
					isnull(pj_custom_dropdown_label1,'') [pj_custom_dropdown_label1],
					isnull(pj_custom_dropdown_label2,'') [pj_custom_dropdown_label2],
					isnull(pj_custom_dropdown_label3,'') [pj_custom_dropdown_label3]
					from projects where pj_id = @pj");

				sql = sql.AddParameterWithValue("pj", Convert.ToString((int)dr["project"]));

				DataRow project_dr = btnet.DbUtil.get_datarow(sql);


				if (project_dr != null)
				{
					for (int i = 1; i < 4; i++)
开发者ID:jhadwen,项目名称:BugTracker.NET,代码行数:67,代码来源:print_bug.cs

示例2: write_posts

		///////////////////////////////////////////////////////////////////////
		public static int write_posts(DataSet ds_posts, HttpResponse Response, int bugid, int permission_level, bool write_links, bool images_inline, bool history_inline, bool internal_posts, IIdentity identity)
		{

			if (Util.get_setting("ForceBordersInEmails","0") == "1")
			{
				Response.Write ("\n<table id='posts_table' border=1 cellpadding=0 cellspacing=3>");
			}
			else
			{
				Response.Write ("\n<table id='posts_table' border=0 cellpadding=0 cellspacing=3>");
			}

			int post_cnt = ds_posts.Tables[0].Rows.Count;
			
			int bp_id;
			int prev_bp_id = -1;

			
			foreach (DataRow dr in ds_posts.Tables[0].Rows)
			{

                if (!internal_posts)
                {
                    if ((int)dr["bp_hidden_from_external_users"] == 1)
                    {
                        continue; 
                    }
                }

                bp_id = (int) dr["bp_id"];

				if ((string)dr["bp_type"] == "update")
				{

					string comment = (string) dr["bp_comment"];

					if (identity.GetTagsFieldPermissionLevel() == PermissionLevel.None
					&& comment.StartsWith("changed tags from"))
						continue;

					if (identity.GetProjectFieldPermissionLevel() == PermissionLevel.None
					&& comment.StartsWith("changed project from"))
						continue;

					if (identity.GetOrgFieldPermissionLevel() == PermissionLevel.None
					&& comment.StartsWith("changed organization from"))
						continue;

					if (identity.GetCategoryFieldPermissionLevel() == PermissionLevel.None
					&& comment.StartsWith("changed category from"))
						continue;

					if (identity.GetPriorityFieldPermissionLevel() == PermissionLevel.None
					&& comment.StartsWith("changed priority from"))
						continue;

					if (identity.GetAssignedToFieldPermissionLevel() == PermissionLevel.None
					&& comment.StartsWith("changed assigned_to from"))
						continue;

					if (identity.GetStatusFieldPermissionLevel() == PermissionLevel.None
					&& comment.StartsWith("changed status from"))
						continue;

					if (identity.GetUdfFieldPermissionLevel() == PermissionLevel.None
					&& comment.StartsWith("changed " + Util.get_setting("UserDefinedBugAttributeName","YOUR ATTRIBUTE") + " from"))
						continue;

                    
				}

				if (bp_id == prev_bp_id)
				{
					// show another attachment
					write_email_attachment(Response, bugid, dr, write_links, images_inline);
				}
				else
				{
					// show the comment and maybe an attachment
					if (prev_bp_id != -1) {
						Response.Write ("\n</table>"); // end the previous table
					}

                    write_post(Response, bugid, permission_level, dr, bp_id, write_links, images_inline,
						identity.IsInRole(BtnetRoles.Admin),
						identity.GetCanEditAndDeletePosts(),
						identity.GetIsExternalUser());


					if (Convert.ToString(dr["ba_file"]) != "") // intentially "ba"
					{
						write_email_attachment(Response, bugid, dr, write_links, images_inline);
					}
					prev_bp_id = bp_id;
				}

			}

			if (prev_bp_id != -1)
//.........这里部分代码省略.........
开发者ID:jhadwen,项目名称:BugTracker.NET,代码行数:101,代码来源:print_bug.cs


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