public static WarrantyNoteList GetInternalNotes(int userID, int employeeID, int recordID) { QueryOutput queryOutput; var list = new WarrantyNoteList(); list.Data = Query <WarrantyNote>(new DbQuery(userID, employeeID, DbAction.Warranty.View, InternalNoteQuery(recordID)), out queryOutput).ToList(); return(list); }
public static WarrantyNoteList SaveInternalNote(int userID, int employeeID, WarrantyNote note) { QueryOutput queryOutput; var query = String.Format( @"insert into WarrantyInternalNote(WarrantyID, EmployeeID, SubmitDate, Message) values ({0}, {1}, {2}, N'{3}') {4}", note.WarrantyID, employeeID, DateTime.Now.DbValue(), note.Message, InternalNoteQuery(note.WarrantyID)); var list = new WarrantyNoteList(); list.Data = Query <WarrantyNote>(new DbQuery(userID, employeeID, DbAction.Warranty.View, query), out queryOutput).ToList(); return(list); }
public static WarrantyNoteList RemoveInternalNote(int userID, int employeeID, int noteID) { QueryOutput queryOutput; var query = String.Format( @"declare @recordID int = (select top 1 WarrantyID from WarrantyInternalNote where ID = {0}) delete WarrantyInternalNote where ID = {0} {1}", noteID, InternalNoteQuery("@recordID")); var list = new WarrantyNoteList(); list.Data = Query <WarrantyNote>(new DbQuery(userID, employeeID, DbAction.Warranty.View, query), out queryOutput).ToList(); return(list); }