Re: Name in the Live Support Chat window

  •  04-21-2011, 6:39 PM

    Re: Name in the Live Support Chat window

    Dear Neeraj,
     
    Please open global.asax, you will find the following method, please update the highlighted code and set the nickname:
     
    public static bool GetUserInfo(string loginName,ref string nickName,ref string password,ref bool isAdmin)
     {
      loginName=loginName.ToLower();
      Hashtable table=(Hashtable)System.Web.HttpRuntime.Cache["UserInfo:"+loginName];
      if(table==null)
      {
       using(System.Data.IDbConnection conn=Instance.CreateConnection())
       {
        conn.Open();
        using(System.Data.IDbCommand cmd=conn.CreateCommand())
        {
         cmd.CommandText="SELECT * FROM SampleUsers WHERE "+LowerLoginName+"="+SqlEncode(loginName);
         using(System.Data.IDataReader sdr=cmd.ExecuteReader())
         {
          if(!sdr.Read())
           return false;
          table=new Hashtable(new CaseInsensitiveHashCodeProvider(),new CaseInsensitiveComparer());
          for(int i=0;i<sdr.FieldCount;i++)
           table[sdr.GetName(i)]=sdr.IsDBNull(i)?null:sdr.GetValue(i);
         }
        }
       }
       System.Web.HttpRuntime.Cache["UserInfo:"+loginName]=table;
      }
      nickName=table["NickName"].ToString();
      //nickName="firstname"+"lastname"; please customize the nickName based on your requirement      
      password=table["Password"].ToString();
      isAdmin=(1==Convert.ToInt32(table["IsAdmin"]));
      return true;
     }
     
    Thank you for asking
View Complete Thread