コード例 #1
0
        public static Boolean IsAuthorizedUser(string UserId, string Password)
        {
            string  errorMessage = string.Empty;
            Boolean isAuthorized = false;

            try
            {
                using (var dc = new PinereDataContext(PinereConstant.PinereConnectionString))
                {
                    int isAuthorizedTemp = (from a in dc.IsAuthorizedUser(UserId, Password)
                                            select a.IsAuthorized.Value).SingleOrDefault();
                    if (isAuthorizedTemp == 1)
                    {
                        isAuthorized = true;
                    }
                    return(isAuthorized);
                }
            }
            catch (Exception e)
            {
                return(isAuthorized);
            }
        }