Esempio n. 1
0
        public ClsUserInfo User_GetByID(int ID)
        {
            try
            {
                ClsUserInfo obj = new ClsUserInfo();

                if (bool.Parse(VMuktiAPI.VMuktiInfo.Port80) && VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType != PeerType.BootStrap)
                {
                    List <clsSqlParametersInfo> lstSP = new List <clsSqlParametersInfo>();


                    DataSet ds;
                    try
                    {
                        ds = VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select * from UserInfo where ID=" + ID).dsInfo;
                    }
                    catch (System.ServiceModel.EndpointNotFoundException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, System.Reflection.MethodInfo.GetCurrentMethod().Name, "clsUserInfo.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        ds = VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select * from UserInfo where ID=" + ID).dsInfo;
                    }
                    catch (System.ServiceModel.CommunicationException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, System.Reflection.MethodInfo.GetCurrentMethod().Name, "clsUserInfo.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        ds = VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select * from UserInfo where ID=" + ID).dsInfo;
                    }

                    if (!obj.MapData(ds.Tables[0]))
                    {
                        obj = null;
                    }
                }
                else
                {
                    if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                    {
                        List <clsSqlParametersInfo> lstSP = new List <clsSqlParametersInfo>();


                        DataSet ds;
                        try
                        {
                            ds = VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select * from UserInfo where ID=" + ID).dsInfo;
                        }
                        catch (System.ServiceModel.EndpointNotFoundException e)
                        {
                            VMuktiHelper.ExceptionHandler(e, System.Reflection.MethodInfo.GetCurrentMethod().Name, "clsUserInfo.cs");
                            VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                            ds = VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select * from UserInfo where ID=" + ID).dsInfo;
                        }
                        catch (System.ServiceModel.CommunicationException e)
                        {
                            VMuktiHelper.ExceptionHandler(e, System.Reflection.MethodInfo.GetCurrentMethod().Name, "clsUserInfo.cs");
                            VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                            ds = VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select * from UserInfo where ID=" + ID).dsInfo;
                        }

                        if (!obj.MapData(ds.Tables[0]))
                        {
                            obj = null;
                        }
                    }
                    else
                    {
                        DataSet ds = new VMukti.DataAccess.ClsUserInfoDataService().User_GetByID(ID);

                        if (!obj.MapData(ds.Tables[0]))
                        {
                            obj = null;
                        }
                    }
                }
                return(obj);
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, System.Reflection.MethodInfo.GetCurrentMethod().Name, "clsUserInfo.cs");
                return(null);
            }
        }
Esempio n. 2
0
        public ClsUserInfo User_GetByID(int ID)
        {
            try
            {
                ClsUserInfo obj = new ClsUserInfo();

                if (bool.Parse(VMuktiAPI.VMuktiInfo.Port80) && VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType != PeerType.BootStrap)
                {
                    List<clsSqlParametersInfo> lstSP = new List<clsSqlParametersInfo>();


                    DataSet ds;
                    try
                    {
                        ds = VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select * from UserInfo where ID=" + ID).dsInfo;
                    }
                    catch (System.ServiceModel.EndpointNotFoundException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, System.Reflection.MethodInfo.GetCurrentMethod().Name, "clsUserInfo.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        ds = VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select * from UserInfo where ID=" + ID).dsInfo;
                    }
                    catch (System.ServiceModel.CommunicationException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, System.Reflection.MethodInfo.GetCurrentMethod().Name, "clsUserInfo.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        ds = VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select * from UserInfo where ID=" + ID).dsInfo;
                    }

                    if (!obj.MapData(ds.Tables[0])) obj = null;
                }
                else
                {


                if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                {

                    List<clsSqlParametersInfo> lstSP = new List<clsSqlParametersInfo>();

                
                    DataSet ds;
                    try
                    {
                        ds = VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select * from UserInfo where ID=" + ID).dsInfo;
                    }
                    catch (System.ServiceModel.EndpointNotFoundException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, System.Reflection.MethodInfo.GetCurrentMethod().Name, "clsUserInfo.cs"); 
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        ds = VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select * from UserInfo where ID=" + ID).dsInfo;
                    }
                    catch (System.ServiceModel.CommunicationException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, System.Reflection.MethodInfo.GetCurrentMethod().Name, "clsUserInfo.cs"); 
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        ds = VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select * from UserInfo where ID=" + ID).dsInfo;
                    }

                    if (!obj.MapData(ds.Tables[0])) obj = null;
                }
                else
                {
                    DataSet ds = new VMukti.DataAccess.ClsUserInfoDataService().User_GetByID(ID);

                    if (!obj.MapData(ds.Tables[0])) obj = null;
                    }
                }
                return obj;
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, System.Reflection.MethodInfo.GetCurrentMethod().Name, "clsUserInfo.cs");
                return null;
            }
        }