Пример #1
0
    public SCT_AuthUser authenticateUser(string UserId, string UserPwd)
    {
        logger.Info("Method : authenticateUser Start");
        logger.DebugFormat("Input parameter Id : {0} ", UserId);
        logger.DebugFormat("Input parameter Password : {0} ", UserPwd);

        try
        {
            SCT_AuthUser result = new SCT_AuthUser();
            SCTInterface authUsr_SI = new SCTInterface();
            result = authUsr_SI.authenticateUser_SI(UserId, UserPwd);

            logger.Info("Method : authenticateUser Stop");

            return result;
        }
        catch (Exception ex)
        {
            webServiceExHandling.ExceptionLog(ex);
            //string mailBody = string.Format(SCT_Constants.mail_BodyFormat, System.DateTime.Now.ToString("F"), PReqNo, ex.TargetSite.ToString(), ex.ToString());
            //webServiceExHandling.Send_Email(SCT_Constants.Email_Dic, mailBody);

            SCT_AuthUser Error = new SCT_AuthUser();
            Error.StatusFlag = 1;
            Error.Message = SCT_Constants.Error;

            logger.Debug("Return object Error : ErrorCode = " + Error.StatusFlag.ToString());
            logger.Debug("Return object Error : ErrorMessage = " + Error.Message);
            logger.Error("Method : searchEmployee Stop");

            return Error;
        }
    }
Пример #2
0
        //***************************************************************************************************
        public SCT_AuthUser authenticateUser_BAL(string UserId_BAL, string Pwd_BAL)
        {
            try
            {
                logger.Info("Method : authenticateUser_BAL Start");
                logger.DebugFormat("Input parameter Id : {0} ", UserId_BAL);
                logger.DebugFormat("Input parameter Password : {0} ", Pwd_BAL);

                string[] userIds = {"4400","8297","7327","9308"};
                string[] userNames = { "Rajat Gautam", "Harish", "Atul", "Deepak Jain" };
                SCT_AuthUser authResult = new SCT_AuthUser();
                authResult.StatusFlag = 1;
                authResult.Message = SCT_Constants.AuthFailure;

                for (int i = 0; i < userIds.Length; i++)
                {
                    if (UserId_BAL.Equals(userIds[i]) && Pwd_BAL.Equals("password"))
                    {
                        authResult.StatusFlag = 0;
                        authResult.Message = SCT_Constants.AuthSuccess;
                        authResult.Name = userNames[i];
                        break;
                    }
                }

                logger.DebugFormat("Authentication StatusFlag value : {0}", authResult.StatusFlag);
                logger.DebugFormat("Authentication Message value : {0}", authResult.Message);
                logger.Info("Method : authenticateUser_BAL Stop");
                return authResult;
            }

            catch (Exception ex)
            {
                logger.Fatal("Exception  At BAL - authenticateUser_BAL  : " + ex.Message.ToString());
                logger.Error("Method : authenticateUser_BAL Stop");
                throw ex;
            }
        }