protected ServiceBase(MedContext dbContext, UserManager <User> userManager, RoleManager <IdentityRole> roleManager, SignInManager <User> signInManager) { DbContext = dbContext ?? throw new ArgumentNullException(nameof(dbContext)); UserManager = userManager ?? throw new ArgumentNullException(nameof(userManager)); RoleManager = roleManager ?? throw new ArgumentNullException(nameof(roleManager)); SignInManager = signInManager ?? throw new ArgumentNullException(nameof(signInManager)); Mapper = new Mapper(new MapperConfiguration(cfg => cfg.AddProfile <AutoMapperProfile>())); }
public void Count_Starts_At_Zero() { var db = new MedContext(); var underTest = new IRepository(db); var count = underTest.Count(); Assert.Equal(1, count); }
public ActionResult MedicineSearch() { ViewBag.MedicineSearch = "active"; List <MedicineInformation> info; using (var ctx = new MedContext()) { info = ctx.MedicineInformations.ToList(); } return(View(info)); }
public ActionResult Contact(Contact contact) { ViewBag.Contact = "active"; using (var ctx = new MedContext()) { ctx.ContactInfo.Add(contact); ctx.SaveChanges(); } ViewBag.Yes = '1'; return(View()); }
public ActionResult Notification() { ViewBag.Notification = "active"; List <Contact> noti = new List <Contact>(); using (var db = new MedContext()) { noti = db.ContactInfo.ToList(); } return(View(noti)); }
public ActionResult CustomerOrderList() { ViewBag.CustomerOrderList = "active"; List <OrderList> noti = new List <OrderList>(); using (var db = new MedContext()) { noti = db.Orderinfo.ToList(); } return(View(noti)); }
//suggetion public ActionResult MedicineSuggestion() { ViewBag.MedicineSuggestion = "active"; List <Problems> pro = new List <Problems>(); using (var ctx = new MedContext()) { pro = ctx.Problemses.ToList(); ViewBag.Problems = pro; } return(View()); }
public ActionResult AddMedicine(PharmacyMedicine medicine) { ViewBag.AddMedicine = "active"; int id = Convert.ToInt32(Session["PharmacyId"]); using (var ctx = new MedContext()) { medicine.PharmacyId = id; ctx.PharmacyMedicines.Add(medicine); ctx.SaveChanges(); } ViewBag.Yes = '1'; return(View()); }
public ActionResult Order(OrderList orderList) { string a = (orderList.MedicineAmount * Convert.ToInt32(orderList.Price)).ToString(); ViewBag.Order = "active"; using (var ctx = new MedContext()) { orderList.TotalPrice = a + " " + "BDT"; ctx.Orderinfo.Add(orderList); ctx.SaveChanges(); } ViewBag.Yes = '1'; return(View()); }
public ActionResult Graph(string dt) { string ll = dt + "/01/20"; string hl = dt + "/31/20"; int[] ar = new int[32]; for (int i = 1; i <= 31; i++) { ar[i] = 0; } using (var ctx = new MedContext()) { string sql = "SELECT Count(a.Id) as val,a.Date FROM OrderLists as a " + "WHERE a.Date>='" + ll + "' AND a.Date<='" + hl + "' GROUP BY a.Date"; SqlConnection cn = new SqlConnection(ctx.Database.Connection.ConnectionString); SqlCommand command = new SqlCommand(sql, cn); cn.Open(); using (SqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { int a = Convert.ToInt32(reader["val"]); string b = reader["Date"].ToString(); string kl = b[3].ToString() + b[4].ToString(); int dd = Convert.ToInt32(kl); ar[dd - 1] = a; } } cn.Close(); } string dataStr = JsonConvert.SerializeObject(ar, Formatting.None); ViewBag.Data = dataStr; ViewBag.mon = dt; return(View()); }
public ActionResult Profile() { ViewBag.Profile = "active"; Register pharmacyuser = new Register(); int pharmacyid = Convert.ToInt32(Session["PharmacyId"]); using (var db = new MedContext()) { var u = db.Registers.Where(k => k.Id == pharmacyid).Select(c => new { c.PharmacyName, c.Address, c.PhoneNo }); foreach (var j in u) { pharmacyuser.PharmacyName = security.Decrypt(j.PharmacyName); pharmacyuser.Address = security.Decrypt(j.Address); pharmacyuser.PhoneNo = security.Decrypt(j.PhoneNo); } ViewBag.Patient = pharmacyuser; return(View()); } }
public ActionResult Update(Register pharmacyuser) { int id = Convert.ToInt32(Session["PharmacyId"]); string useremail = security.Encrypt(pharmacyuser.Email); using (var db = new MedContext()) { Register pa = db.Registers.Single(e => e.Id == id); if (pa.Email == useremail) { pa.PharmacyName = security.Encrypt(pharmacyuser.PharmacyName); pa.Address = security.Encrypt(pharmacyuser.Address); pa.PhoneNo = security.Encrypt(pharmacyuser.PhoneNo); db.SaveChanges(); return(RedirectToAction("Profile", "Medicine")); } return(RedirectToAction("Profile", "Medicine")); } }
public ActionResult Registration(Register register) { using (var db = new MedContext()) { register.Email = security.Encrypt(register.Email); var e = db.Registers.Where(c => c.Email == register.Email).ToList().Count; if (e == 0) { register.Password = EncodePassword(register.Password); register.PharmacyName = security.Encrypt(register.PharmacyName); register.Address = security.Encrypt(register.Address); register.PhoneNo = security.Encrypt(register.PhoneNo); db.Registers.Add(register); db.SaveChanges(); } else { ViewBag.Error = "Already Registered"; } } ViewBag.Yes = '1'; return(View()); }
public ActionResult AdminLogin(Admin admin) { string password = EncodePassword(admin.Password); string email = security.Encrypt(admin.Email); using (var ctx = new MedContext()) { var p = ctx.Admins.Where(c => c.Email == email && c.Password == password).Select(c => new { c.Id, c.Email }).ToList(); if (p.Any()) { foreach (var k in p) { Session["AdminId"] = k.Id; Session["AdminEmail"] = k.Email; } return(RedirectToAction("HomeIndex", "Medicine")); } else { ViewBag.Error = "Login Failed"; } } return(View()); }
public DoctorFacilityService(MedContext dbContext, UserManager <User> userManager, RoleManager <IdentityRole> roleManager, SignInManager <User> signInManager) : base(dbContext, userManager, roleManager, signInManager) { }
public CategoryController(MedContext context) { _context = context; }
public LoginController(MedContext context) { _context = context; }
public AdminQualificationService(MedContext dbContext, UserManager <User> userManager, RoleManager <IdentityRole> roleManager, SignInManager <User> signInManager) : base(dbContext, userManager, roleManager, signInManager) { }
public MedicineController(MedContext context, IWebHostEnvironment env) { _context = context; _env = env; }
public AdminFacilityService(MedContext dbContext, UserManager <User> userManager, RoleManager <IdentityRole> roleManager, SignInManager <User> signInManager, IServerNewsService newsService) : base(dbContext, userManager, roleManager, signInManager) => this.newsService = newsService;
public IRepository(MedContext db) { this.db = db; }
public OrderController(MedContext context) { _context = context; }
public ServerVisitStatusService(MedContext dbContext, UserManager <User> userManager, RoleManager <IdentityRole> roleManager, SignInManager <User> signInManager) : base(dbContext, userManager, roleManager, signInManager) { }
public PatientRegController(MedContext context) { _context = context; }
public DoctorController(MedContext context) { _context = context; }
public StateController(MedContext context) { _context = context; }
public PatCareerController(MedContext context) { _context = context; }
public AboutUsController(MedContext context) { _context = context; }
public HomeController(MedContext Db) { _Db = Db; }
public PatMedicineController(MedContext context1) { // _context = context; _context1 = context1; }