Beispiel #1
0
        private Tracking CancelTracking(RemarksViewModel model, string status)
        {
            var currentTracking = _context.Tracking.FirstOrDefault(x => x.Code.Equals(model.Code));

            currentTracking.Status    = status;
            currentTracking.Remarks   = model.Remarks;
            currentTracking.UpdatedAt = DateTime.Now;
            return(currentTracking);
        }
Beispiel #2
0
        public ProcResult Add(OrderViewModel model)
        {
            RemarksViewModel remarks = new RemarksViewModel();

            remarks.EID     = SessionWrapper.Get <int>(AppConstant.UserId);
            remarks.EIDDate = DateTime.Now;
            remarks.Comment = model.Comment;
            return(_iOrderRepository.AddOrder(Mapper.Map <Order>(model), Mapper.Map <Remark>(remarks)));
        }
Beispiel #3
0
        public Tracking AcceptedTracking(RemarksViewModel model, string status)
        {
            var updateTracking = _context.Tracking.FirstOrDefault(x => x.Code.Equals(model.Code));

            updateTracking.Remarks      = model.Remarks;
            updateTracking.Status       = status;
            updateTracking.DateAccepted = DateTime.Now;
            updateTracking.UpdatedAt    = DateTime.Now;

            return(updateTracking);
        }
Beispiel #4
0
        public async Task <IActionResult> CallRequest([Bind] RemarksViewModel model, string code)
        {
            if (ModelState.IsValid)
            {
                var tracking = _context.Tracking.FirstOrDefault(x => x.Code.Equals(model.Code));
                NewActivity(tracking, DateTime.Now);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Incoming", "ViewPatients"));
            }

            return(PartialView(model));
        }
Beispiel #5
0
        public async Task <IActionResult> AcceptedRemark([Bind] RemarksViewModel model, string code)
        {
            if (ModelState.IsValid)
            {
                var tracking = AcceptedTracking(model, _status.Value.ACCEPTED);
                var activity = NewActivity(tracking, DateTime.Now);
                _context.Update(tracking);
                _context.Add(activity);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Incoming", "ViewPatients"));
            }
            return(PartialView(model));
        }
Beispiel #6
0
        public async Task <IActionResult> CancelRemark([Bind] RemarksViewModel model)
        {
            if (ModelState.IsValid)
            {
                var tracking = CancelTracking(model, _status.Value.CANCELLED);
                var activity = NewActivity(tracking, DateTime.Now);
                _context.Update(activity);
                _context.Update(tracking);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Referred", "ViewPatients"));
            }
            return(PartialView());
        }
Beispiel #7
0
        private Tracking RejectedTracking(RemarksViewModel model, string status)
        {
            var currentTracking = _context.Tracking.FirstOrDefault(x => x.Code.Equals(model.Code));

            return(currentTracking);
        }
 public RemarksView()
 {
     InitializeComponent();
     _remarksViewModel = new RemarksViewModel(Navigation);
     BindingContext    = _remarksViewModel;
 }
Beispiel #9
0
        public ProcResult Delete(int id)
        {
            RemarksViewModel remarks = new RemarksViewModel();

            return(_iOrderRepository.DeleteOrder(id));
        }