public GetViewTableDataResponse GetViewTableData (WebServiceLogin login, int? lane_id, string lane, int? host_id, string host, int page, int page_size) { GetViewTableDataResponse response = new GetViewTableDataResponse (); using (DB db = new DB ()) { Authenticate (db, login, response); response.Lane = FindLane (db, lane_id, lane); response.Host = FindHost (db, host_id, host); response.Count = DBRevisionWork_Extensions.GetCount (db, response.Lane.id, response.Host.id); response.Page = page; response.PageSize = page_size; response.RevisionWorkViews = DBRevisionWorkView_Extensions.Query (db, response.Lane, response.Host, response.PageSize, response.Page); var hl = db.GetHostLane (response.Host.id, response.Lane.id); if (hl != null) response.Enabled = hl.enabled; } return response; }
public void SwitchHostHiddenForLane (WebServiceLogin login, int lane_id, int host_id) { using (DB db = new DB ()) { VerifyUserInRole (db, login, Roles.Administrator); DBHostLane hostlane = db.GetHostLane (host_id, lane_id); hostlane.hidden = !hostlane.hidden; hostlane.Save (db); } }
public void SwitchHostHiddenForLane (WebServiceLogin login, int lane_id, int host_id) { using (DB db = new DB ()) { var lane = DBLane_Extensions.Create (db, lane_id); VerifyUserInRoles (db, login, lane.additional_roles, false); DBHostLane hostlane = db.GetHostLane (host_id, lane.id); hostlane.hidden = !hostlane.hidden; hostlane.Save (db); } }