public string Authentication(string username, string password) { PsmartAuthUser _user = _pSmartAuthManager.LoginValidate(username); string response = @"{""status"":""false"", ""DisplayName"":""""}"; if (null != _user) { Utility util = new Utility(); if (_user.Password == util.Encrypt(password)) { response = @"{""status"":""true"", ""DisplayName"":""" + _user.DisplayName + "}"; } } return(response); }
public DtoUserAuth Authentication(string username, string password) { DtoUserAuth objAuth = new DtoUserAuth(); PsmartAuthUser _user = _pSmartAuthManager.LoginValidate(username); objAuth.STATUS = "false"; objAuth.DISPLAYNAME = ""; // string response = @"{""status"":""false"", ""DisplayName"":""""}"; if (null != _user) { Utility util = new Utility(); if (_user.Password == util.Encrypt(password)) { //response = @"{ ""STATUS"":""true"", ""DISPLAYNAME"":" + _user.DisplayName + " }"; objAuth.STATUS = "true"; objAuth.DISPLAYNAME = _user.DisplayName; objAuth.FACILITY = _user.FACILITY; } //response = _user.DisplayName; } return(objAuth); }