public static AssetTicketModel[] GetAssetTickets(TicketModel ticket) { OrganizationModel organization = ticket.Organization; //int[] ids = IDReader.Read(TicketChild.Asset, ticket); // $"SELECT AssetID From AssetTickets WITH (NOLOCK) WHERE TicketID = {ticket.TicketID}" string query = $"SELECT AssetID From AssetTickets WITH (NOLOCK) WHERE TicketID = {ticket.TicketID}"; int[] ids = ticket.ExecuteQuery <int>(query).ToArray(); AssetTicketModel[] models = new AssetTicketModel[ids.Length]; for (int i = 0; i < ids.Length; ++i) { models[i] = new AssetTicketModel(new AssetModel(organization, ids[i]), ticket, false); } return(models); }
public ConnectionContext(AuthenticationModel authentication, bool useTransaction = false) { // SqlConnection Authentication = authentication; _connection = new SqlConnection(Authentication.ConnectionString); // using _connection.Open(); // connection must be open to begin transaction // DataContext _db = new DataContext(_connection); //_db.ObjectTrackingEnabled = false; // use linq read-only //db.DeferredLoadingEnabled = true; // don't use DataLoadOptions if (useTransaction) { _transaction = _connection.BeginTransaction(); _db.Transaction = _transaction; } // Create Logical Model! - note that OrganizationID and UserID come from Authentication Organization = new OrganizationModel(this); User = new UserModel(this); }
public OrganizationTicketModel(TicketModel ticket, OrganizationModel organization) : this(ticket, organization, true) { }
public WatercoolerMsgModel(ConnectionContext connection, int messageID) : base(connection) { Organization = connection.Organization; MessageID = messageID; Verify(); }
public WatercoolerMsgModel(OrganizationModel organization, int messageID) : base(organization) { Organization = organization; MessageID = messageID; Verify(); }
/// <summary> top down - existing ticket </summary> public TicketModel(OrganizationModel organization, int ticketID) : base(organization) { Organization = organization; // user session on customer TicketID = ticketID; Verify(); }
public ProductModel(OrganizationModel organization, int productID) : base(organization) { }
public TagModel(OrganizationModel organization, int tagID) : base(organization) { }
public AssetModel(OrganizationModel organization, int assetID) : base(organization) { Organization = organization; AssetID = assetID; Verify(); }
public TaskModel(ConnectionContext connection, int taskID) : base(connection) { Organization = connection.Organization; TaskID = taskID; Verify(); }
public TaskModel(OrganizationModel organization, int taskID) : base(organization) { Organization = organization; TaskID = taskID; Verify(); }