本文整理汇总了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;
}
示例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;
}
示例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;
}