Beispiel #1
0
        public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context)
        {
            // Initialization.
            string    email           = context.UserName;
            string    passwordVal     = context.Password;
            IDALLayer dllLayer        = new DALLayer();;
            var       loginController = new LoginController(dllLayer);
            Login     login           = new Login();

            login.Email    = email;
            login.Password = passwordVal;
            var user = loginController.UserLogin(login);

            if (user == null || user.Status == "Invalid")
            {
                // Settings.
                context.SetError("invalid_grant", "The email or password is incorrect.");
                return;
            }
            var claims = new List <Claim>();

            claims.Add(new Claim(ClaimTypes.Name, "email"));
            ClaimsIdentity       oAuthClaimIdentity = new ClaimsIdentity(claims, OAuthDefaults.AuthenticationType);
            AuthenticationTicket ticket             = new AuthenticationTicket(oAuthClaimIdentity, new AuthenticationProperties()
            {
            });

            context.Validated(ticket);
        }
        public void DeletePOMaster([FromBody] string id)
        {
            DALLayer dalObj = new DALLayer();

            dalObj.DeletePOMaster(id);
        }
        public void AddPOMaster([FromBody] POMaster value)
        {
            DALLayer dalObj = new DALLayer();

            dalObj.AddPOMaster(value);
        }
        public List <PODetail> GetPODetails()
        {
            DALLayer dalObj = new DALLayer();

            return(dalObj.GetPODetails());
        }
        public List <POMaster> GetPOMaster()
        {
            DALLayer dalObj = new DALLayer();

            return(dalObj.GetPOMaster());
        }
        public List <Item> GetItems()
        {
            DALLayer dalObj = new DALLayer();

            return(dalObj.GetItems());
        }
        public List <Supplier> GetSuppliers()
        {
            DALLayer dalObj = new DALLayer();

            return(dalObj.GetSuppliers());
        }