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));
        }
        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));
        }
Example #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));
        }
Example #4
0
 public IEnumerable <ReportFeedback> GetAllFeedbackForPharmacy()
 {
     return(_medicineReportService.GetAllFeedback().Where(x => x.MedicineReport.PharmacyId == AuthenticatedUserModel.GetUserFromIdentity().Id));
 }
Example #5
0
 public IEnumerable <MedicineReport> GetAllForPharmacy()
 {
     return(_medicineReportService.GetAllForPharmacy(AuthenticatedUserModel.GetUserFromIdentity().Id));
 }
Example #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));
 }