예제 #1
0
        public ActionResult Report(string id)
        {
            var model = new MedicineReportModel();

            model.Complainant    = AuthenticatedUserModel.GetUserFromIdentity();
            model.ComplainantId  = model.Complainant.Id;
            model.MedicineInfo   = model.GetMedicineInfo(id);
            model.MedicineInfoId = model.MedicineInfo.Id;
            model.Pharmacies     = model.GetAllPharmacies();
            return(View(model));
        }
예제 #2
0
        public ActionResult Report(MedicineReportModel model)
        {
            if (ModelState.IsValid)
            {
                var newId = model.Add();
                return(RedirectToAction("ReportSuccess"));
            }

            model.Complainant  = AuthenticatedUserModel.GetUserFromIdentity();
            model.MedicineInfo = model.GetMedicineInfo(model.MedicineInfoId);
            model.Pharmacies   = model.GetAllPharmacies();
            return(View(model));
        }
예제 #3
0
        //public IEnumerable<ReportFeedback> GetAllFeedbackForNormalUser()
        //{
        //    return _medicineReportService.GetAllFeedback().Where(x => x.MedicineReport.ComplainantId == AuthenticatedUserModel.GetUserFromIdentity().Id);
        //}

        public IEnumerable <MedicineReport> GetAllPendingForCompany()
        {
            return(_medicineReportService.GetAllPendingForCompany(AuthenticatedUserModel.GetUserFromIdentity().Id));
        }
예제 #4
0
 public IEnumerable <ReportFeedback> GetAllFeedbackForPharmacy()
 {
     return(_medicineReportService.GetAllFeedback().Where(x => x.MedicineReport.PharmacyId == AuthenticatedUserModel.GetUserFromIdentity().Id));
 }
예제 #5
0
 public IEnumerable <MedicineReport> GetAllForPharmacy()
 {
     return(_medicineReportService.GetAllForPharmacy(AuthenticatedUserModel.GetUserFromIdentity().Id));
 }
예제 #6
0
 public string Add()
 {
     this.ImageUrl      = CustomFile.SaveImageFile(this.ImageFileBase, this.Name, this.Id, "Medicine");
     this.ContributorId = AuthenticatedUserModel.GetUserFromIdentity().Id;
     return(_medicineService.AddByAdmin(this));
 }