Beispiel #1
0
        public static string GetUserDisplayName(int userID)
        {
            try
            {
                string displayName = null;

                DataSet ds = null;

                if (bool.Parse(VMuktiAPI.VMuktiInfo.Port80) && VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType != PeerType.BootStrap)
                {
                    ds = clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select * from vUserInfo where ID='" + userID + "'").dsInfo;
                }
                else
                {
                    if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                    {
                        ds = clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select * from vUserInfo where ID='" + userID + "'").dsInfo;
                    }
                    else
                    {
                        ds = new VMukti.DataAccess.clsProfile().GetUserDisplayName(userID);
                    }
                }

                if (ds.Tables[0] != null)
                {
                    DataRow dr;
                    if (ds.Tables[0].Rows.Count != 0)
                    {
                        dr          = ds.Tables[0].Rows[0];
                        displayName = dr["DisplayName"].ToString();
                    }
                    else
                    {
                        return(null);
                    }
                }

                return(displayName);
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "GetUserDisplayName()", "clsProfile.cs");
                return(null);
            }
        }
Beispiel #2
0
        public static List<object> GetAllCountries()
        {
            try
            {
                List<object> objList = new List<object>();
                DataSet ds = null;

                if (bool.Parse(VMuktiAPI.VMuktiInfo.Port80) && VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType != PeerType.BootStrap)
                {
                    ds = clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("Select ID,CountryName from vCountryUserProfile order by CountryName").dsInfo;
                }
                else
                {
                if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                {
                    ds = clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("Select ID,CountryName from vCountryUserProfile order by CountryName").dsInfo;
                }
                else
                {
                    ds = new VMukti.DataAccess.clsProfile().GetCountryUserProfile();
                }
                }
                if (ds.Tables[0] != null)
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        string CountryName;
                        CountryName =  (string)dr["CountryName"];
                        objList.Add(CountryName);
                    }
                }


                return objList;

            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "GetAllCountries()", "clsProfile.cs");
                return null;
            }
        }
Beispiel #3
0
        public static List <object> GetAllCountries()
        {
            try
            {
                List <object> objList = new List <object>();
                DataSet       ds      = null;

                if (bool.Parse(VMuktiAPI.VMuktiInfo.Port80) && VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType != PeerType.BootStrap)
                {
                    ds = clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("Select ID,CountryName from vCountryUserProfile order by CountryName").dsInfo;
                }
                else
                {
                    if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                    {
                        ds = clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("Select ID,CountryName from vCountryUserProfile order by CountryName").dsInfo;
                    }
                    else
                    {
                        ds = new VMukti.DataAccess.clsProfile().GetCountryUserProfile();
                    }
                }
                if (ds.Tables[0] != null)
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        string CountryName;
                        CountryName = (string)dr["CountryName"];
                        objList.Add(CountryName);
                    }
                }


                return(objList);
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "GetAllCountries()", "clsProfile.cs");
                return(null);
            }
        }
Beispiel #4
0
        public static string GetUserEmail(int userID)
        {
            try
            {
                string email = null;
                
                DataSet ds = null;

                if (bool.Parse(VMuktiAPI.VMuktiInfo.Port80) && VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType != PeerType.BootStrap)
                {
                    ds = clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select * from vUserInfo where ID='" + userID + "'").dsInfo;
                }
                else
                {

                if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                {
                    ds = clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select * from vUserInfo where ID='" + userID + "'").dsInfo;
                }
                else
                {
                    ds = new VMukti.DataAccess.clsProfile().GetUserDisplayName(userID);
                }
                }
                if (ds.Tables[0] != null)
                {
                    DataRow dr;
                    if (ds.Tables[0].Rows.Count != 0)
                    {
                        dr = ds.Tables[0].Rows[0];
                        email = dr["EMail"].ToString();
                    }
                    else
                        return null;

                }

                return email;
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "GetUserDisplayName()", "clsProfile.cs");
                return null;
            }
        }
Beispiel #5
0
        public static int GetUserID(string displayName)
        {
            try
            {
                int userID =-1;
                
                DataSet ds = null;

                if (bool.Parse(VMuktiAPI.VMuktiInfo.Port80) && VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType != PeerType.BootStrap)
                {
                    ds = clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select * from vUserInfo where DisplayName='" + displayName + "'").dsInfo;
                }
                else
                {

                if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                {
                    ds = clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select * from vUserInfo where DisplayName='"+displayName+"'").dsInfo;
                }
                else
                {
                    ds = new VMukti.DataAccess.clsProfile().GetUserID(displayName);
                }
                }
                if (ds.Tables[0] != null)
                {
                    DataRow dr;
                    if (ds.Tables[0].Rows.Count != 0)
                    {
                        dr = ds.Tables[0].Rows[0];
                        userID = int.Parse(dr["ID"].ToString());
                    }
                    else
                        return -1;
                    
                }

                return userID;
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "GetUserID()", "clsProfile.cs");               
                return -1;
            }
        }