Esempio n. 1
0
        public ActionResult GetListQueue(string clinics, string status)
        {
            var _draw          = Request.Form.GetValues("draw").FirstOrDefault();
            var _start         = Request.Form.GetValues("start").FirstOrDefault();
            var _length        = Request.Form.GetValues("length").FirstOrDefault();
            var _sortColumn    = Request.Form.GetValues("columns[" + Request.Form.GetValues("order[0][column]").FirstOrDefault() + "][name]").FirstOrDefault();
            var _sortColumnDir = Request.Form.GetValues("order[0][dir]").FirstOrDefault();
            var _searchValue   = Request.Form.GetValues("search[value]").FirstOrDefault();

            int _pageSize = _length != null?Convert.ToInt32(_length) : 0;

            int _skip = _start != null?Convert.ToInt32(_start) : 0;

            var request = new LoketRequest
            {
                Draw          = _draw,
                SearchValue   = _searchValue,
                SortColumn    = _sortColumn,
                SortColumnDir = _sortColumnDir,
                PageSize      = _pageSize,
                Skip          = _skip,
                Data          = new LoketModel {
                    ClinicID = Convert.ToInt32(clinics), Status = Convert.ToInt32(status)
                }
            };

            if (Session["UserLogon"] != null)
            {
                request.Data.Account = (AccountModel)Session["UserLogon"];
            }

            var response = new CashierHandler(_unitOfWork).GetListData(request);

            return(Json(new { data = response.Data, recordsFiltered = response.RecordsFiltered, recordsTotal = response.RecordsTotal, draw = response.Draw }, JsonRequestBehavior.AllowGet));
        }
Esempio n. 2
0
        public ActionResult Detail(long medicalid)
        {
            var response    = new CashierHandler(_unitOfWork).GetDetail(medicalid);
            var formmedical = _unitOfWork.FormMedicalRepository.Get(a => a.ID == medicalid).FirstOrDefault();

            ViewBag.Formmedicalid = formmedical;
            ViewBag.Detail        = response.Data;

            if (response.Data != null)
            {
                ViewBag.Sum = response.Data.Sum(a => a.Price);
            }
            else
            {
                ViewBag.Sum = "";
            };
            return(View(formmedical));
        }
Esempio n. 3
0
        public ActionResult Invoice(long medicalid)
        {
            var response    = new CashierHandler(_unitOfWork).GetDetail(medicalid);
            var formmedical = _unitOfWork.FormMedicalRepository.Get(a => a.ID == medicalid).FirstOrDefault();

            ViewBag.Formmedicalid = formmedical;
            ViewBag.Detail        = response.Data;
            ViewBag.ClinicName    = formmedical.Clinic.Name;
            ViewBag.PatienName    = formmedical.Patient.Name;

            if (response.Data != null)
            {
                ViewBag.Sum = response.Data.Sum(a => a.Price);
            }
            else
            {
                ViewBag.Sum = "";
            };
            ViewBag.Total = Convert.ToInt32(response.Data.Sum(a => a.Price)) - Convert.ToInt32(formmedical.DiscountAmount);
            return(View(formmedical));
        }
Esempio n. 4
0
        public ActionResult Save(long medicalid, FormMedical formMedical)
        {
            var response = new CashierHandler(_unitOfWork).update(medicalid, formMedical);

            return(RedirectToAction("ListPatien", "Cashier"));
        }