예제 #1
0
        public AjaxModel<PrintQueueModel> Post(PrintQueueItem item)
        {
            AjaxModel<PrintQueueModel> ajax = null;

            try
            {
                PosRepository.PrintQueueRemove(item);
                ajax = new AjaxModel<PrintQueueModel>() { Success = true, Message = PosMessage.PrintQueueDeleteSuccessful, Model = null };
            }
            catch (Exception e)
            {
                ajax = new AjaxModel<PrintQueueModel>() { Success = false, Message = PosMessage.PrintQueueDeleteError + " - " + e.Message, Model = null };
            }

            return ajax;
        }
예제 #2
0
 public static void PrintQueueRemove(PrintQueueItem item)
 {
     using (var db = new PosEntities())
     {
         var queueItem = (from queue in db.PrintQueues where queue.PrintQueueID == item.PrintQueueID select queue).First();
         db.PrintQueues.Remove(queueItem);
         db.SaveChanges();
     }
 }
예제 #3
0
 public static void PrintQueueAdd(PrintQueueItem item)
 {
     using(var db = new PosEntities())
     {
         PrintQueue queue = new PrintQueue() { ExamID = item.ExamID, UserName = item.UserName, PrintExamNote = item.PrintExamNote };
         db.PrintQueues.Add(queue);
         db.SaveChanges();
     }
 }