Пример #1
0
        public static RepairNoteList GetInternalNotes(int userID, int employeeID, int recordID)
        {
            QueryOutput queryOutput;
            var         list = new RepairNoteList();

            list.Data = Query <RepairNote>(new DbQuery(userID, employeeID, DbAction.Repair.View, InternalNoteQuery(recordID)), out queryOutput).ToList();
            return(list);
        }
Пример #2
0
        public static RepairNoteList SaveInternalNote(int userID, int employeeID, RepairNote note)
        {
            QueryOutput queryOutput;
            var         query = String.Format(
                @"insert into RepairInternalNote(RepairID, EmployeeID, SubmitDate, Message)
                values ({0}, {1}, {2}, N'{3}') {4}", note.RepairID, employeeID, DateTime.Now.DbValue(), note.Message, InternalNoteQuery(note.RepairID));
            var list = new RepairNoteList();

            list.Data = Query <RepairNote>(new DbQuery(userID, employeeID, DbAction.Repair.View, query), out queryOutput).ToList();
            return(list);
        }
Пример #3
0
        public static RepairNoteList RemoveInternalNote(int userID, int employeeID, int noteID)
        {
            QueryOutput queryOutput;
            var         query = String.Format(
                @"declare @recordID int = (select top 1 RepairID from RepairInternalNote where ID = {0})
                delete RepairInternalNote where ID = {0} {1}",
                noteID, InternalNoteQuery("@recordID"));
            var list = new RepairNoteList();

            list.Data = Query <RepairNote>(new DbQuery(userID, employeeID, DbAction.Repair.View, query), out queryOutput).ToList();
            return(list);
        }