public object AddUser(LICENSE_USER lICENSE_USER)
        {
            l_repo = new LicenseRepository(lICENSE_USER.Product_Key);
            string ErrMsg = string.Empty;

            if (l_repo.ProductKey != "")
            {
                if (ValidateUser(lICENSE_USER.LOGIN_ID, out ErrMsg))
                {
                    l_repo.AddUser(lICENSE_USER);
                    response.status_Description = "Successfully User Created";
                    response.status_code        = "1";
                }
                else
                {
                    response.status_Description = ErrMsg;
                    response.status_code        = "0";
                }
            }
            else
            {
                response.status_Description = "Invalid Product Key";
                response.status_code        = "0";
            }
            return(Result(response));
        }
        private bool ValidateUser(string loginID, out string ErrorMsg)
        {
            LICENSE_USER l_user = l_repo.GetUser(loginID);

            ErrorMsg = string.Empty;
            if (l_user != null)
            {
                ErrorMsg = "User Name already exists";
                return(false);
            }
            return(true);
        }
        public bool AddUser(LICENSE_USER user)
        {
            LICENSE_USER l_logHistory = new LICENSE_USER();

            l_logHistory.LOGIN_ID     = user.LOGIN_ID;
            l_logHistory.PASSWORD     = user.PASSWORD;
            l_logHistory.Product_Key  = user.Product_Key;
            l_logHistory.ACTIVESTATUS = "Y";
            l_logHistory.USER_NAME    = user.USER_NAME;
            context.LICENSE_USER.Add(l_logHistory);
            context.Entry(l_logHistory).State = EntityState.Added;
            context.SaveChanges();
            return(true);
        }
        private bool validateCrdential(string loginId, string Password, out string ErrorMsg)
        {
            LICENSE_USER l_user = l_repo.GetUser(loginId);

            ErrorMsg = string.Empty;

            if (l_user == null)
            {
                ErrorMsg = "Invalid User Name";
                return(false);
            }
            else
            {
                if (l_user.PASSWORD != Password)
                {
                    ErrorMsg = "Invalid Password";
                    return(false);
                }
            }
            return(true);
        }
        public object AddUser([FromBody] LICENSE_USER lICENSE_USER)
        {
            var result = l_services.AddUser(lICENSE_USER);

            return(result);
        }
        public LICENSE_USER GetUser(string loginID)
        {
            LICENSE_USER user = context.LICENSE_USER.Where(w => w.LOGIN_ID == loginID && w.Product_Key == ProductKey).FirstOrDefault();

            return(user);
        }