public async Task <IActionResult> Edit(int id, [Bind("ID,strNume,strPrenume,strCNP,strNrTelefon,strEmail,strAdresaFarmacie,strParola")] Farmacist farmacist)
        {
            if (id != farmacist.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(farmacist);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FarmacistExists(farmacist.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(farmacist));
        }
        public async Task <IActionResult> Create([Bind("ID,strNume,strPrenume,strCNP,strNrTelefon,strEmail,strAdresaFarmacie,strParola")] Farmacist farmacist)
        {
            if (ModelState.IsValid)
            {
                Farmacist f = new Farmacist();
                f.CreateValueObject(farmacist);
                f.CreateDBObject();

                _context.Add(f);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(farmacist));
        }
        public ActionResult Validate(Farmacist farmacist)
        {
            var _admin = _context.farmacisti.Where(s => s.strEmail == farmacist.strEmail);

            if (_admin != null)
            {
                if (_admin != null)
                {
                    return(Json(new { status = true, message = "Login Successfull!" }));
                }
                else
                {
                    return(Json(new { status = false, message = "Invalid Password!" }));
                }
            }
            else
            {
                return(Json(new { status = false, message = "Invalid Email!" }));
            }
        }
 public async Task Create(Farmacist farmacist)
 {
     fcontext.Add(farmacist);
     await fcontext.SaveChangesAsync();
 }