public ActionResult Login(string username, string functionName) { ConnectionManagement connectionManagement = new ConnectionManagement(); DbBusiness dbBusiness = new DbBusiness(); string result = "NG"; string description = ""; try { //if (!dbBusiness.ExistUser(username, connectionManagement.GetDefaultConnection())) //{ // result = "NG"; // description = "Tài khoản này không tồn tại"; //} //else { //if (!dbBusiness.CheckAuthorization(username, functionName, connectionManagement.GetDefaultConnection())) //{ // result = "NG"; // description = "Tài khoản này không có quyền"; //} //else { result = "OK"; description = ""; } } } catch { result = "NG"; description = "Không thể kết nối với máy chủ"; } return(Content(result + "#" + description)); }
public TradePartner(Character pOwner, DbBusiness dbBusiness) { m_pOwner = pOwner; m_dbObj = dbBusiness; m_dwIdentity = dbBusiness.Business; m_szName = dbBusiness.Name; m_dwAddDate = dbBusiness.Date; m_pPacket = new MsgTradeBuddy { Identity = m_dwIdentity, Name = m_szName, HoursLeft = HoursLeft, Online = TargetOnline }; }