コード例 #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
ファイル: PosRepository.cs プロジェクト: prasannapattam/epos
 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
ファイル: PosRepository.cs プロジェクト: prasannapattam/epos
 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();
     }
 }