Пример #1
0
        public bool CheckPassword(MarvelBLL objMarvelBLL, APICredentialsBLL credentials)
        {
            string    funcName = "CheckPassword";
            DataTable dtRecord = new DataTable();
            bool      isReset  = false;

            try
            {
                using (SqlCommand sqlComm = new SqlCommand("proc_CheckPassword"))
                {
                    sqlComm.CommandType = CommandType.StoredProcedure;
                    sqlComm.Parameters.AddWithValue("@UserID", int.Parse(credentials.UserName));
                    sqlComm.Parameters.AddWithValue("@Password", MD5.CreateMd5Hash(credentials.Password));
                    dtRecord = objMarvelBLL.GetData(sqlComm);
                    Logger.Logger.Information(clsName, funcName, "dtRecord.Rows.Count", dtRecord.Rows.Count.ToString());
                    if (dtRecord.Rows.Count > 0)
                    {
                        if (dtRecord.Rows[0]["IsActive"].ToString() == "Exist")
                        {
                            isReset = true;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Logger.WriteErrorLog(clsName, funcName, ex);
                throw new Exception(string.Format("Error occured while Check Password : {0}", ex.Message), ex);
            }
            Logger.Logger.Information(clsName, funcName, "isReset", isReset.ToString());
            return(isReset);
        }
Пример #2
0
        public DataTable GetLogin(MarvelBLL objMarvelBLL, APICredentialsBLL credentials)
        {
            string funcName = "GetLogin";

            Logger.Logger.Information(clsName, funcName, "UserName", credentials.UserName);
            DataTable dtRecord = new DataTable();

            try
            {
                using (SqlCommand sqlComm = new SqlCommand("proc_GetLogin"))
                {
                    sqlComm.CommandType = CommandType.StoredProcedure;
                    sqlComm.Parameters.AddWithValue("@Email", credentials.UserName);
                    sqlComm.Parameters.AddWithValue("@Password", MD5.CreateMd5Hash(credentials.Password));
                    dtRecord = objMarvelBLL.GetData(sqlComm);
                    Logger.Logger.Information(clsName, funcName, "dtRecord.Rows.Count", dtRecord.Rows.Count.ToString());
                }
            }
            catch (Exception ex)
            {
                Logger.Logger.WriteErrorLog(clsName, funcName, ex);
                throw new Exception(string.Format("Error occured while Login : {0}", ex.Message), ex);
            }
            return(dtRecord);
        }
Пример #3
0
        public bool ValidateRequest(APICredentialsBLL objAPICredentials)
        {
            bool IsValidate = false;

            try
            {
                if (objAPICredentials.UserName == CommonObjects.GetCongifValue(ConfigKeys.UserName) && objAPICredentials.Password == CommonObjects.GetCongifValue(ConfigKeys.Password))
                {
                    IsValidate = true;
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(IsValidate);
        }
Пример #4
0
        public DataTable GetLogin(ProjectManagementBLL objProjectManagementBLL, APICredentialsBLL credentials)
        {
            DataTable dtRecord = new DataTable();

            try
            {
                using (SqlCommand sqlComm = new SqlCommand("proc_GetLogin"))
                {
                    sqlComm.CommandType = CommandType.StoredProcedure;
                    sqlComm.Parameters.AddWithValue("@Email", credentials.UserName);
                    sqlComm.Parameters.AddWithValue("@Password", credentials.Password);
                    dtRecord = objProjectManagementBLL.GetData(sqlComm);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error occured while Login : {0}", ex.Message), ex);
            }
            return(dtRecord);
        }
        public bool ValidateRequest(APICredentialsBLL objAPICredentials)
        {
            string funcName   = "ValidateRequest";
            bool   IsValidate = false;

            Logger.Logger.Information(clsName, funcName, "objAPICredentials", JsonConvert.SerializeObject(objAPICredentials));
            try
            {
                if (objAPICredentials.UserName == CommonObjects.GetCongifValue(ConfigKeys.UserName) && objAPICredentials.Password == CommonObjects.GetCongifValue(ConfigKeys.Password))
                {
                    IsValidate = true;
                }
            }
            catch (Exception ex)
            {
                Logger.Logger.WriteErrorLog(clsName, funcName, ex);
                throw;
            }
            Logger.Logger.Information(clsName, funcName, "IsValidate", IsValidate.ToString());
            return(IsValidate);
        }