Ejemplo n.º 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);
        }
Ejemplo n.º 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)));
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 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());
        }
Ejemplo n.º 7
0
        private Tracking RejectedTracking(RemarksViewModel model, string status)
        {
            var currentTracking = _context.Tracking.FirstOrDefault(x => x.Code.Equals(model.Code));

            return(currentTracking);
        }
Ejemplo n.º 8
0
 public RemarksView()
 {
     InitializeComponent();
     _remarksViewModel = new RemarksViewModel(Navigation);
     BindingContext    = _remarksViewModel;
 }
Ejemplo n.º 9
0
        public ProcResult Delete(int id)
        {
            RemarksViewModel remarks = new RemarksViewModel();

            return(_iOrderRepository.DeleteOrder(id));
        }