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


C# DB.GetWork方法代码示例

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


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

示例1: GetNextWork

		/// <summary>
		/// Finds pending steps for the current revision
		/// </summary>
		/// <returns></returns>
		public static List<DBWorkView2> GetNextWork (this DBRevisionWork rw, DB db, DBLane lane, DBHost host, DBRevision revision, bool multiple_work)
		{
			List<DBWorkView2> result = new List<DBWorkView2> (); ;

			if (revision == null)
				throw new ArgumentNullException ("revision");

			if (lane == null)
				throw new ArgumentNullException ("lane");

			if (host == null)
				throw new ArgumentNullException ("host");

			rw.FilterPendingWork (db, db.GetWork (rw), result, multiple_work);

			if (result.Count == 0 && !rw.completed) {
				rw.completed = true;
				rw.UpdateState (db);
			}

			return result;
		}
开发者ID:rolfbjarne,项目名称:monkeywrench,代码行数:26,代码来源:DBRevisionWork_Extensions.cs

示例2: GetViewLaneData2

		public GetViewLaneDataResponse GetViewLaneData2 (WebServiceLogin login, int? lane_id, string lane, int? host_id, string host, int? revision_id, string revision, bool include_hidden_files)
		{
			GetViewLaneDataResponse response = new GetViewLaneDataResponse ();
			using (DB db = new DB ()) {
				Authenticate (db, login, response);

				response.Now = db.Now;
				response.Lane = FindLane (db, lane_id, lane);
				response.Host = FindHost (db, host_id, host);
				if (response.Lane != null)
					response.Revision = revision_id.HasValue ? FindRevision (db, revision_id.Value) : FindRevision (db, response.Lane, revision);

				if (response.Lane == null || response.Revision == null)
					throw new HttpException (404, "Revision work not found");

				response.RevisionWork = DBRevisionWork_Extensions.Find (db, response.Lane, response.Host, response.Revision);
				if (response.RevisionWork != null && response.RevisionWork.workhost_id.HasValue) {
					response.WorkHost = FindHost (db, response.RevisionWork.workhost_id, null);
				}
				response.WorkViews = db.GetWork (response.RevisionWork);
				response.WorkFileViews = new List<List<DBWorkFileView>> ();
				for (int i = 0; i < response.WorkViews.Count; i++) {
					response.WorkFileViews.Add (DBWork_Extensions.GetFiles (db, response.WorkViews [i].id, include_hidden_files));
				}
				response.Links = DBWork_Extensions.GetLinks (db, response.WorkViews.Select<DBWorkView2, int> ((DBWorkView2 a, int b) => a.id));
			}

			return response;
		}
开发者ID:joewstroman,项目名称:monkeywrench,代码行数:29,代码来源:WebServices.asmx.cs

示例3: GetViewLaneData2

		public GetViewLaneDataResponse GetViewLaneData2 (WebServiceLogin login, int? lane_id, string lane, int? host_id, string host, int? revision_id, string revision, bool include_hidden_files)
		{
			GetViewLaneDataResponse response = new GetViewLaneDataResponse ();

			using (DB db = new DB ()) {
				Authenticate (db, login, response);

				response.Now = db.Now;
				response.Lane = FindLane (db, lane_id, lane);
				response.Host = FindHost (db, host_id, host);
				response.Revision = FindRevision (db, revision_id, revision);
				response.RevisionWork = DBRevisionWork_Extensions.Find (db, response.Lane, response.Host, response.Revision);
				if (response.RevisionWork != null && response.RevisionWork.workhost_id.HasValue) {
					response.WorkHost = FindHost (db, response.RevisionWork.workhost_id, null);
				}
				response.WorkViews = db.GetWork (response.RevisionWork);
				response.WorkFileViews = new List<List<DBWorkFileView>> ();
				for (int i = 0; i < response.WorkViews.Count; i++) {
					response.WorkFileViews.Add (DBWork_Extensions.GetFiles (db, response.WorkViews [i].id, include_hidden_files));
				}
			}

			return response;
		}
开发者ID:DavidS,项目名称:monkeywrench,代码行数:24,代码来源:WebServices.asmx.cs


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