예제 #1
0
        public RespuestaServicio <ARTICULO> Eliminar(int Id)
        {
            RespuestaServicio <ARTICULO> respuesta = new RespuestaServicio <ARTICULO>();

            try
            {
                if (Id <= 0)
                {
                    throw new Exception("El Id es invalido");
                }

                using (var bd = new FarmaciaEntities())
                {
                    var _articulo = bd.ARTICULO.Find(Id);
                    _articulo.Estatus            = false;
                    _articulo.Fecha_Modificacion = DateTime.Now;
                    bd.Entry(_articulo).State    = System.Data.Entity.EntityState.Modified;
                    bd.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                respuesta.Error   = true;
                respuesta.Mensaje = ex.Message;
            }
            return(respuesta);
        }
예제 #2
0
        public async Task <RespuestaServicio <SignInStatus> > Login(LoginModel model)
        {
            RespuestaServicio <SignInStatus> respuesta = new RespuestaServicio <SignInStatus>();

            respuesta.Respuesta = await SignInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, shouldLockout : false);

            return(respuesta);
        }