static object InstantiateDecimal(AppDomain appDomain, Binder binder, CultureInfo cultureInfo, string UName, string P2PUri)
        {
            try
            {
                object instance = appDomain.CreateInstance(
                    "CoAuthering.Presentation",
                    "CoAuthering.Presentation.P2PCoAuthClient",
                    false,
                    BindingFlags.Default,
                    binder,
                    new object[] { UName, P2PUri },
                    cultureInfo,
                    null,
                    null
                    );
                return(instance);
            }
            catch (Exception exp)
            {
                VMuktiHelper.ExceptionHandler(exp, "InstantiateDecimal", "P2PCoAuthDummyClient.cs");

                return(null);
            }
        }
Beispiel #2
0
 private void txtRatePerHour_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
 {
     try
     {
         if (e.Key == Key.RightShift || e.Key == Key.LeftShift)
         {
             isShiftDown = true;
         }
         #region Allowing only numbers , '.'(only 1) and Tab
         if (!((e.Key >= Key.D0 && e.Key <= Key.D9) ||
               ((e.Key == Key.OemPeriod || e.Key == Key.Decimal) && ((TextBox)sender).Text.IndexOf(".") == -1) ||
               e.Key == Key.Tab ||
               (e.Key >= Key.NumPad0 && e.Key <= Key.NumPad9)) ||
             (isShiftDown == true))
         {
             e.Handled = true;
         }
         #endregion
     }
     catch (Exception ex)
     {
         VMuktiHelper.ExceptionHandler(ex, "txtRatePerHour_KeyDown", "CtlUserInfo.xaml.cs");
     }
 }
Beispiel #3
0
        public int[] TotalCount(Int64 LeadFormatID, int ListID, string SelectedTimeZone, string FilterType, int TotalTimeZone, int CountryCode)
        {
            DataSet dsCustomeFieldDetails = new DataSet();

            DataSet StateCountry = ClsList.StateCountry_GetAll();

            DataTable dtTemp = new DataTable();

            //DataRow[] drCollection = null;

            if (FilterType == "TIMEZONE" || FilterType == "SITE")
            {
                DataSet ds = ClsList.AreaCode_GetAll(SelectedTimeZone, "in");
                dtTemp = ds.Tables[0];
                //drCollection = dtTemp.Select("TimezoneName IN (" + strTimezone + ")");
            }


            ClsImportLeadsDataService clsReterive = new ClsImportLeadsDataService();

            dsCustomeFieldDetails = clsReterive.ReteriveCustomeFieldDetails(LeadFormatID);

            DataRow[] drPhoneNumber = dsCustomeFieldDetails.Tables[0].Select("CustomFieldID = 1");
            int       phoneStartpos = Convert.ToInt32(drPhoneNumber[0]["StartPosition"]);
            int       phonelen      = Convert.ToInt32(drPhoneNumber[0]["Length"]);

            DataRow[] drStateID     = dsCustomeFieldDetails.Tables[0].Select("CustomFieldID = 2");
            int       StateStartpos = Convert.ToInt32(drStateID[0]["StartPosition"]);
            int       Statelen      = Convert.ToInt32(drStateID[0]["Length"]);

            DataRow[] drZipID     = dsCustomeFieldDetails.Tables[0].Select("CustomFieldID = 3");
            int       ZipStartpos = Convert.ToInt32(drZipID[0]["StartPosition"]);
            int       Ziplen      = Convert.ToInt32(drZipID[0]["Length"]);

            int[] ResultArray;


            if (drPhoneNumber.Count() > 0)
            {
                FileStream fs         = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.None, 2 << 18, FileOptions.SequentialScan);
                DataTable  dtTimezone = new DataTable();

                DataRow[] drStateCountry = null;

                DataSet dsTimeZone = ClsList.TimeZone_GetAll();
                dtTimezone = dsTimeZone.Tables[0];

                Int64 LeadMaxcount  = ClsList.GetMaxIDLeads();
                Int64 MaxLeadDetail = ClsList.GetMaxLeadDetailID();
                Int64 MaxLocationID = ClsList.GetMaxLocationID();

                createDataTable();


                int TotalColm = dsCustomeFieldDetails.Tables[0].Rows.Count;

                StreamReader sr = new StreamReader(fs);



                // int cntFile = sr.ReadToEnd().Split('\n').Count();

                // string[] FileValueArray = sr.ReadToEnd().Split('\n') ;

                //int[] Fields = new int[TotalColm];
                /// int[] StartPosition = new int[TotalColm];
                // int[] Length = new int[TotalColm];



                //   fs.Close();

                //    sr.Close();

                /*  for (int Colcnt = 0; Colcnt < TotalColm; Colcnt++)
                 * {
                 *
                 *    Fields[Colcnt] = Convert.ToInt32(dsCustomeFieldDetails.Tables[0].Rows[Colcnt]["CustomFieldID"]);
                 *    StartPosition[Colcnt] = Convert.ToInt32(dsCustomeFieldDetails.Tables[0].Rows[Colcnt]["StartPosition"]);
                 *    Length[Colcnt] = Convert.ToInt32(dsCustomeFieldDetails.Tables[0].Rows[Colcnt]["Length"]);
                 *
                 * }*/



                SqlConnection conn = new SqlConnection(VMuktiAPI.VMuktiInfo.MainConnectionString);
                SqlCommand    cmd  = new SqlCommand("select getdate()", conn);
                conn.Open();
                SqlDataReader dr1;
                int           Rowcnt = 0;
                //string Row = "";
                int badNumbers = 0;
                // Byte badNumberFlag = 0;
                // Byte RepeatFlag =0;
                Byte AreaCodeFlag = 0;

                int       repeatNumbers = 0;
                int       NoAreaCode    = 0;
                DataTable dtPhoneNumber = new DataTable();

                DataSet ds1 = ClsList.PhoneNumbers_GetAll(ListID);
                dtPhoneNumber = ds1.Tables[0];


                try
                {
                    while (sr.EndOfStream != true)
                    //for (Rowcnt = 0; Rowcnt < FileValueArray.Count(); Rowcnt++)
                    {
                        Rowcnt = Rowcnt + 1;
                        string Row = sr.ReadLine();
                        //FileValueArray.ElementAt(Rowcnt);

                        Int64 phoneNumber;
                        try
                        {
                            phoneNumber = Convert.ToInt64(Row.Substring(phoneStartpos - 1, phonelen).Replace("-", "").Replace(" ", ""));
                            phoneNumber = Int64.Parse((Math.Pow(10 * CountryCode, (phoneNumber.ToString().Length))).ToString()) + phoneNumber;
                        }
                        catch (Exception exp)
                        {
                            badNumbers++;

                            //  badNumberFlag = 1;
                            continue;
                        }

                        DataRow[] drRepeat = dtPhoneNumber.Select("PhoneNo = " + phoneNumber);
                        if (drRepeat.Length > 0)
                        {
                            repeatNumbers++;
                            //  RepeatFlag = 1;
                            continue;
                        }
                        dtPhoneNumber.Rows.Add(phoneNumber);

                        dr1 = cmd.ExecuteReader();
                        dr1.Read();
                        //if (badNumberFlag == 0 || RepeatFlag == 0)
                        //  {



                        string ZipCode = Row.Substring(ZipStartpos - 1, Ziplen).Replace(" ", "");
                        //Int64 finalzipcode = String.IsNullOrEmpty(ZipCode) ? null : Int64.Parse(ZipCode);
                        drStateCountry = StateCountry.Tables[0].Select("zipcode='" + ZipCode.Substring(0, 5) + "'");

                        if (FilterType == "TIMEZONE")
                        {
                            //int loopcount = drCollection.Length;
                            int     loopcount = dtTemp.Rows.Count;
                            DataRow drLocation;
                            //  DataRow[] AreaCod;
                            //AreaCod = dtTemp.Select("Areacode = '" + dtTrendWestLead.Rows[i][0].ToString() + "'");

                            for (int t = 0; t < loopcount; t++)
                            {
                                if (phoneNumber.ToString().Substring(1, 3) == dtTemp.Rows[t][0].ToString())
                                //if (dtTrendWestLead.Rows[i][15].ToString() == dtTemp[t][0].ToString())
                                {
                                    DataRow[] t1;
                                    t1 = dtTimezone.Select("TimezoneName = '" + dtTemp.Rows[t][1] + "'");

                                    Int64 gotIt = Int64.Parse(t1[0][1].ToString());
                                    if (drStateCountry.Length > 0)
                                    {
                                        drLocation               = dtLocation.NewRow();
                                        drLocation["ID"]         = MaxLocationID;
                                        drLocation["TimeZoneID"] = gotIt;
                                        drLocation["CountryID"]  = Convert.ToInt64(drStateCountry[0][1].ToString());
                                        drLocation["StateID"]    = Convert.ToInt64(drStateCountry[0][0].ToString());
                                        drLocation["AreaCodeID"] = Convert.ToInt64(dtTemp.Rows[t][0].ToString());
                                        drLocation["ZipCodeID"]  = Convert.ToInt64(drStateCountry[0][2].ToString());
                                        dtLocation.Rows.Add(drLocation);
                                    }
                                    else
                                    {
                                        drLocation               = dtLocation.NewRow();
                                        drLocation["ID"]         = MaxLocationID;
                                        drLocation["TimeZoneID"] = gotIt;
                                        drLocation["CountryID"]  = 0;
                                        drLocation["StateID"]    = 0;
                                        drLocation["AreaCodeID"] = Convert.ToInt64(dtTemp.Rows[t][0].ToString());
                                        drLocation["ZipCodeID"]  = 0;
                                        dtLocation.Rows.Add(drLocation);
                                    }
                                    AreaCodeFlag = 1;
                                    break;
                                    // varcount++;
                                }
                            }
                        }

                        if (AreaCodeFlag == 1)
                        {
                            AreaCodeFlag = 0;
                            dtLead.Rows.Add(LeadMaxcount, phoneNumber, LeadFormatID, Convert.ToDateTime(dr1[0].ToString()), VMuktiAPI.VMuktiInfo.CurrentPeer.ID, null, null, false, Convert.ToDateTime(dr1.GetValue(0)), VMuktiAPI.VMuktiInfo.CurrentPeer.ID, false, 0, ListID, MaxLocationID, 0, "Fresh", false);
                            int Colcnt = 0;


                            for (Colcnt = 0; Colcnt < TotalColm; Colcnt++)
                            {
                                Int64 fieldID          = Convert.ToInt32(dsCustomeFieldDetails.Tables[0].Rows[Colcnt]["CustomFieldID"]);;
                                int   StartPositionTmp = Convert.ToInt32(dsCustomeFieldDetails.Tables[0].Rows[Colcnt]["StartPosition"]);
                                int   LengthTmp        = Convert.ToInt32(dsCustomeFieldDetails.Tables[0].Rows[Colcnt]["Length"]);

                                // string Row = FileValueArray.ElementAt(Rowcnt);
                                string Value = Row.Substring(StartPositionTmp - 1, LengthTmp);

                                dtLeadDetail.Rows.Add(MaxLeadDetail, LeadMaxcount, fieldID, Value);
                                MaxLeadDetail = MaxLeadDetail + 1;
                            }

                            MaxLocationID = MaxLocationID + 1;
                            LeadMaxcount  = LeadMaxcount + 1;
                            Row           = "";
                        }
                        else
                        {
                            NoAreaCode++;
                        }
                        dr1.Close();
                        // }
                        // else
                        // {
                        //  badNumberFlag = 0;
                        //  RepeatFlag = 0;
                        //}
                    }
                }
                catch (Exception ex)
                {
                    VMuktiHelper.ExceptionHandler(ex, "TotalCount()", "ClsTextFileInsert.cs");
                }
                finally
                {
                    sr.Close();
                    fs.Close();
                    sr = null;
                    fs = null;
                    GC.Collect(0, GCCollectionMode.Forced);

                    //GC.SuppressFinalize(this);
                }



                SqlBulkCopy sqlBulkLocation = new SqlBulkCopy(VMuktiAPI.VMuktiInfo.MainConnectionString);
                //SqlBulkCopy sqlBulkLocation = new SqlBulkCopy("Data Source=192.168.1.186\\SQLExpress;Initial Catalog=VMukti;User ID=sa;PassWord=mahavir",SqlBulkCopyOptions.FireTriggers);
                sqlBulkLocation.DestinationTableName = "Location";
                sqlBulkLocation.BulkCopyTimeout      = 1000;
                sqlBulkLocation.WriteToServer(dtLocation);
                sqlBulkLocation.Close();


                SqlBulkCopy sqlBulkLead = new SqlBulkCopy(VMuktiAPI.VMuktiInfo.MainConnectionString);
                //SqlBulkCopy sqlBulkLocation = new SqlBulkCopy("Data Source=192.168.1.186\\SQLExpress;Initial Catalog=VMukti;User ID=sa;PassWord=mahavir",SqlBulkCopyOptions.FireTriggers);
                sqlBulkLead.DestinationTableName = "Leads";
                sqlBulkLead.BulkCopyTimeout      = 1000;
                sqlBulkLead.WriteToServer(dtLead);
                sqlBulkLead.Close();


                SqlBulkCopy sqlBulkLeadDetail = new SqlBulkCopy(VMuktiAPI.VMuktiInfo.MainConnectionString);
                //SqlBulkCopy sqlBulkLocation = new SqlBulkCopy("Data Source=192.168.1.186\\SQLExpress;Initial Catalog=VMukti;User ID=sa;PassWord=mahavir",SqlBulkCopyOptions.FireTriggers);
                sqlBulkLeadDetail.DestinationTableName = "LeadDetail";
                sqlBulkLeadDetail.BulkCopyTimeout      = 1000;
                sqlBulkLeadDetail.WriteToServer(dtLeadDetail);
                sqlBulkLeadDetail.Close();


                ResultArray = new int[] { Rowcnt, badNumbers, dtLead.Rows.Count, repeatNumbers, NoAreaCode };

                dtLocation   = null;
                dtLead       = null;
                dtLeadDetail = null;

                return(ResultArray);
            }
            else
            {
                ResultArray = new int[] { 0 };
                return(ResultArray);
            }
        }
Beispiel #4
0
        private void OnIRTCSessionStateChangeEvent(IRTCSessionStateChangeEvent sessionevent)
        {
            try
            {
                RTC_SESSION_STATE sessionstate;
                sessionstate = sessionevent.State;

                switch (sessionstate)
                {
                case RTC_SESSION_STATE.RTCSS_INPROGRESS:
                {
                    if (_IPGCounter == -1)
                    {
                        entstatus(this, "InPorgress");
                        _IPGCounter = 1;
                    }
                    else if (_IPGCounter == 2)
                    {
                        _IPGCounter = -1;
                    }
                    else
                    {
                        _IPGCounter += 1;
                    }
                    break;
                }

                case RTC_SESSION_STATE.RTCSS_INCOMING:
                {
                    oclient.PlayRing(RTC_RING_TYPE.RTCRT_PHONE, true);
                    osession = sessionevent.Session;
                    entstatus(this, "Incoming");
                    break;
                }

                case RTC_SESSION_STATE.RTCSS_ANSWERING:
                {
                    //oclient.SendDTMF
                    entstatus(this, "Answering");
                    break;
                }

                case RTC_SESSION_STATE.RTCSS_CONNECTED:
                {
                    entstatus(this, "Connected");
                    break;
                }

                case RTC_SESSION_STATE.RTCSS_DISCONNECTED:
                {
                    //int i = this.oclient.SessionCapabilities;
                    //string ss = this.oclient.SessionCapabilities.ToString();
                    //int str1 = this.profile.SessionCapabilities.GetHashCode();
                    osession = null;
                    entstatus(this, "Disconnected");
                    break;
                }

                case RTC_SESSION_STATE.RTCSS_HOLD:
                {
                    entstatus(this, "Hold");
                    break;
                }

                case RTC_SESSION_STATE.RTCSS_REFER:
                {
                    break;
                }
                }
                sessionevent = null;
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "OnIRTCSessionStateChangeEvent()", "Audio\\Audio.Business\\RTCAudio.cs");
            }
        }
Beispiel #5
0
        public int EditCategory(int id, string name)
        {
            try
            {
                if (bool.Parse(VMuktiAPI.VMuktiInfo.Port80) && VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType != PeerType.BootStrap)
                {
                    List <clsSqlParametersInfo> lstSP = new List <clsSqlParametersInfo>();

                    clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                    objInfo.Direction = "Input";
                    objInfo.PName     = "@pID";
                    objInfo.PValue    = id;
                    objInfo.PDBType   = "BigInt";
                    objInfo.PSize     = 200;

                    clsSqlParametersInfo objInfo2 = new clsSqlParametersInfo();
                    objInfo2.Direction = "Input";
                    objInfo2.PName     = "@pModuleName";
                    objInfo2.PValue    = name;
                    objInfo2.PDBType   = "NVarChar";
                    objInfo2.PSize     = 200;


                    lstSP.Add(objInfo);
                    lstSP.Add(objInfo2);

                    clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                    CSqlInfo.objParam = lstSP;
                    try
                    {
                        return(int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spEditCategory", CSqlInfo).ToString()));
                    }
                    catch (System.ServiceModel.EndpointNotFoundException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "AddModule(int intModId, string strModName, str..)", "ClsModuleLogic.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        return(int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spEditCategory", CSqlInfo).ToString()));
                    }
                    catch (System.ServiceModel.CommunicationException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "AddModule(int intModId, string strModName, str..)", "ClsModuleLogic.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        return(int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spEditCategory", CSqlInfo).ToString()));
                    }
                }
                else
                {
                    if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                    {
                        List <clsSqlParametersInfo> lstSP = new List <clsSqlParametersInfo>();

                        clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                        objInfo.Direction = "Input";
                        objInfo.PName     = "@pID";
                        objInfo.PValue    = id;
                        objInfo.PDBType   = "BigInt";
                        objInfo.PSize     = 200;

                        clsSqlParametersInfo objInfo2 = new clsSqlParametersInfo();
                        objInfo2.Direction = "Input";
                        objInfo2.PName     = "@pModuleName";
                        objInfo2.PValue    = name;
                        objInfo2.PDBType   = "NVarChar";
                        objInfo2.PSize     = 200;


                        lstSP.Add(objInfo);
                        lstSP.Add(objInfo2);

                        clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                        CSqlInfo.objParam = lstSP;
                        try
                        {
                            return(int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spEditCategory", CSqlInfo).ToString()));
                        }
                        catch (System.ServiceModel.EndpointNotFoundException e)
                        {
                            VMuktiHelper.ExceptionHandler(e, "AddModule(int intModId, string strModName, str..)", "ClsModuleLogic.cs");
                            VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                            return(int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spEditCategory", CSqlInfo).ToString()));
                        }
                        catch (System.ServiceModel.CommunicationException e)
                        {
                            VMuktiHelper.ExceptionHandler(e, "AddModule(int intModId, string strModName, str..)", "ClsModuleLogic.cs");
                            VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                            return(int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spEditCategory", CSqlInfo).ToString()));
                        }
                    }
                    else
                    {
                        return(new ClsCategoryDataService().UpdateCategory(id, name));
                    }
                }
            }
            catch
            {
                return(0);
            }
        }
        public static ClsModuleCollection GetNonAuthenticatedNonCollMod()
        {
            ClsModuleCollection obj = new ClsModuleCollection();

            if (bool.Parse(VMuktiAPI.VMuktiInfo.Port80) && VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType != PeerType.BootStrap)
            {
                try
                {
                    if (VMuktiAPI.VMuktiInfo.VMuktiVersion == "1.0")
                    {
                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module where NeedsAuthentication='false' and IsDeleted='false' and IsCollaborative='false' and ModuleVersion like '1.0.%' order by ModuleName").dsInfo);
                    }
                    else
                    {
                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module where NeedsAuthentication='false' and IsDeleted='false' and IsCollaborative='false' order by ModuleName").dsInfo);
                    }
                }
                catch (System.ServiceModel.EndpointNotFoundException e)
                {
                    VMuktiHelper.ExceptionHandler(e, "GetNonAuthenticatedNonCollMod", "clsModuleCollection.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                    if (VMuktiAPI.VMuktiInfo.VMuktiVersion == "1.0")
                    {
                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module where NeedsAuthentication='false' and IsDeleted='false' and IsCollaborative='false' and ModuleVersion like '1.0.%' order by ModuleName").dsInfo);
                    }
                    else
                    {
                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module where NeedsAuthentication='false' and IsDeleted='false' and IsCollaborative='false' order by ModuleName").dsInfo);
                    }
                }
                catch (System.ServiceModel.CommunicationException e)
                {
                    VMuktiHelper.ExceptionHandler(e, "GetNonAuthenticatedNonCollMod", "clsModuleCollection.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                    if (VMuktiAPI.VMuktiInfo.VMuktiVersion == "1.0")
                    {
                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module where NeedsAuthentication='false' and IsDeleted='false' and IsCollaborative='false' and ModuleVersion like '1.0.%' order by ModuleName").dsInfo);
                    }
                    else
                    {
                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module where NeedsAuthentication='false' and IsDeleted='false' and IsCollaborative='false' order by ModuleName").dsInfo);
                    }
                }
            }
            else
            {
                if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                {
                    try
                    {
                        if (VMuktiAPI.VMuktiInfo.VMuktiVersion == "1.0")
                        {
                            obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module where NeedsAuthentication='false' and IsDeleted='false' and IsCollaborative='false' and ModuleVersion like '1.0.%' order by ModuleName").dsInfo);
                        }
                        else
                        {
                            obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module where NeedsAuthentication='false' and IsDeleted='false' and IsCollaborative='false' order by ModuleName").dsInfo);
                        }
                    }
                    #region Catch
                    catch (System.ServiceModel.EndpointNotFoundException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "GetNonAuthenticatedNonCollMod", "clsModuleCollection.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        if (VMuktiAPI.VMuktiInfo.VMuktiVersion == "1.0")
                        {
                            obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module where NeedsAuthentication='false' and IsDeleted='false' and IsCollaborative='false' and ModuleVersion like '1.0.%' order by ModuleName").dsInfo);
                        }
                        else
                        {
                            obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module where NeedsAuthentication='false' and IsDeleted='false' and IsCollaborative='false' order by ModuleName").dsInfo);
                        }
                    }
                    catch (System.ServiceModel.CommunicationException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "GetNonAuthenticatedNonCollMod", "clsModuleCollection.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        if (VMuktiAPI.VMuktiInfo.VMuktiVersion == "1.0")
                        {
                            obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module where NeedsAuthentication='false' and IsDeleted='false' and IsCollaborative='false' and ModuleVersion like '1.0.%' order by ModuleName").dsInfo);
                        }
                        else
                        {
                            obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module where NeedsAuthentication='false' and IsDeleted='false' and IsCollaborative='false' order by ModuleName").dsInfo);
                        }
                    }
                    #endregion
                }
                else
                {
                    obj.MapObjects(new ClsModuleDataService().GetNonAuthenticatedNonCollMod());
                }
            }
            return(obj);
        }
        public static ClsModuleCollection GetAll()
        {
            ClsModuleCollection obj = new ClsModuleCollection();

            if (bool.Parse(VMuktiAPI.VMuktiInfo.Port80) && VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType != PeerType.BootStrap)
            {
                try
                {
                    if (VMuktiAPI.VMuktiInfo.VMuktiVersion == "1.0")  ///Show Only collaborative modules who contains ModuleVersion=1.0.0.0
                    {
                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module where ModuleVersion like '1.0.%' order by ModuleName").dsInfo);
                    }
                    else ///show all modules present in Vmukti database
                    {
                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module order by ModuleName").dsInfo);
                    }
                }

                #region Catch block
                catch (System.ServiceModel.EndpointNotFoundException e)
                {
                    VMuktiHelper.ExceptionHandler(e, "GetAll()", "clsModuleCollection.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                    if (VMuktiAPI.VMuktiInfo.VMuktiVersion == "1.0")  ///Show Only collaborative modules who contains ModuleVersion=1.0.0.0
                    {
                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module where ModuleVersion like '1.0.%' order by ModuleName").dsInfo);
                    }
                    else ///show all modules present in Vmukti database
                    {
                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module order by ModuleName").dsInfo);
                    }
                }
                catch (System.ServiceModel.CommunicationException e)
                {
                    VMuktiHelper.ExceptionHandler(e, "GetAll()", "clsModuleCollection.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                    if (VMuktiAPI.VMuktiInfo.VMuktiVersion == "1.0")  ///Show Only collaborative modules who contains ModuleVersion=1.0.0.0
                    {
                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module where ModuleVersion like '1.0.%' order by ModuleName").dsInfo);
                    }
                    else ///show all modules present in Vmukti database
                    {
                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module order by ModuleName").dsInfo);
                    }
                }
                #endregion
            }
            else
            {
                if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                {
                    try
                    {
                        if (VMuktiAPI.VMuktiInfo.VMuktiVersion == "1.0")  ///Show Only collaborative modules who contains ModuleVersion=1.0.0.0
                        {
                            obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module where ModuleVersion like '1.0.%' order by ModuleName").dsInfo);
                        }
                        else
                        {
                            obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module order by ModuleName").dsInfo);
                        }
                    }

                    #region Catch Block
                    catch (System.ServiceModel.EndpointNotFoundException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "GetAll()", "clsModuleCollection.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        if (VMuktiAPI.VMuktiInfo.VMuktiVersion == "1.0")  ///Show Only collaborative modules who contains ModuleVersion=1.0.0.0
                        {
                            obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module where ModuleVersion like '1.0.%' order by ModuleName").dsInfo);
                        }
                        else
                        {
                            obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module order by ModuleName").dsInfo);
                        }
                    }
                    catch (System.ServiceModel.CommunicationException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "GetAll()", "clsModuleCollection.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        if (VMuktiAPI.VMuktiInfo.VMuktiVersion == "1.0")  ///Show Only collaborative modules who contains ModuleVersion=1.0.0.0
                        {
                            obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module where ModuleVersion like '1.0.%' order by ModuleName").dsInfo);
                        }
                        else
                        {
                            obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("select ModuleName,id,IsCollaborative,ZipFile,AssemblyFile,ImageFile from Module order by ModuleName").dsInfo);
                        }
                    }
                    #endregion
                }
                else
                {
                    obj.MapObjects(new ClsModuleDataService().GetModules());
                }
            }
            return(obj);
        }
Beispiel #8
0
        public int Add_Tab(int intTabId, int intPageId, int intTabPosition, string strTabTitle, string strTabDesc, int intUserId)
        {
            if (bool.Parse(VMuktiAPI.VMuktiInfo.Port80) && VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType != PeerType.BootStrap)
            {
                List <clsSqlParametersInfo> lstSP = new List <clsSqlParametersInfo>();

                clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                objInfo.Direction = "Input";
                objInfo.PName     = "@pID";
                objInfo.PValue    = intTabId;
                objInfo.PDBType   = "BigInt";
                objInfo.PSize     = 200;

                clsSqlParametersInfo objInfo2 = new clsSqlParametersInfo();
                objInfo2.Direction = "Input";
                objInfo2.PName     = "@pPageID";
                objInfo2.PValue    = intPageId;
                objInfo2.PDBType   = "BigInt";
                objInfo2.PSize     = 200;


                clsSqlParametersInfo objInfo3 = new clsSqlParametersInfo();
                objInfo3.Direction = "Input";
                objInfo3.PName     = "@pTabPosition";
                objInfo3.PValue    = intTabPosition;
                objInfo3.PDBType   = "Int";
                objInfo3.PSize     = 200;

                clsSqlParametersInfo objInfo4 = new clsSqlParametersInfo();
                objInfo4.Direction = "Input";
                objInfo4.PName     = "@pTabTitle";
                objInfo4.PValue    = strTabTitle;
                objInfo4.PDBType   = "NVarChar";
                objInfo4.PSize     = 200;

                clsSqlParametersInfo objInfo5 = new clsSqlParametersInfo();
                objInfo5.Direction = "Input";
                objInfo5.PName     = "@pDescription";
                objInfo5.PValue    = strTabDesc;
                objInfo5.PDBType   = "NVarchar";
                objInfo5.PSize     = 200;

                clsSqlParametersInfo objInfo6 = new clsSqlParametersInfo();
                objInfo6.Direction = "Input";
                objInfo6.PName     = "@pGivenID";
                objInfo6.PValue    = intUserId;
                objInfo6.PDBType   = "BigInt";
                objInfo6.PSize     = 200;

                clsSqlParametersInfo objInfo7 = new clsSqlParametersInfo();
                objInfo7.Direction = "Output";
                objInfo7.PName     = "@pReturnMaxID";
                objInfo7.PValue    = -1;
                objInfo7.PDBType   = "BigInt";
                objInfo7.PSize     = 200;


                lstSP.Add(objInfo);
                lstSP.Add(objInfo2);
                lstSP.Add(objInfo3);
                lstSP.Add(objInfo4);
                lstSP.Add(objInfo5);
                lstSP.Add(objInfo6);
                lstSP.Add(objInfo7);

                clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                CSqlInfo.objParam = lstSP;
                try
                {
                    return(int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spAETabs", CSqlInfo).ToString()));
                }
                catch (System.ServiceModel.EndpointNotFoundException e)
                {
                    VMuktiHelper.ExceptionHandler(e, "Add_Tab(int intTabId...)", "ClsTabLogic.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                    return(int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spAETabs", CSqlInfo).ToString()));
                }
                catch (System.ServiceModel.CommunicationException e)
                {
                    VMuktiHelper.ExceptionHandler(e, "Add_Tab(int intTabId...)", "ClsTabLogic.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                    return(int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spAETabs", CSqlInfo).ToString()));
                }
            }
            else
            {
                if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                {
                    List <clsSqlParametersInfo> lstSP = new List <clsSqlParametersInfo>();

                    clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                    objInfo.Direction = "Input";
                    objInfo.PName     = "@pID";
                    objInfo.PValue    = intTabId;
                    objInfo.PDBType   = "BigInt";
                    objInfo.PSize     = 200;

                    clsSqlParametersInfo objInfo2 = new clsSqlParametersInfo();
                    objInfo2.Direction = "Input";
                    objInfo2.PName     = "@pPageID";
                    objInfo2.PValue    = intPageId;
                    objInfo2.PDBType   = "BigInt";
                    objInfo2.PSize     = 200;


                    clsSqlParametersInfo objInfo3 = new clsSqlParametersInfo();
                    objInfo3.Direction = "Input";
                    objInfo3.PName     = "@pTabPosition";
                    objInfo3.PValue    = intTabPosition;
                    objInfo3.PDBType   = "Int";
                    objInfo3.PSize     = 200;

                    clsSqlParametersInfo objInfo4 = new clsSqlParametersInfo();
                    objInfo4.Direction = "Input";
                    objInfo4.PName     = "@pTabTitle";
                    objInfo4.PValue    = strTabTitle;
                    objInfo4.PDBType   = "NVarChar";
                    objInfo4.PSize     = 200;

                    clsSqlParametersInfo objInfo5 = new clsSqlParametersInfo();
                    objInfo5.Direction = "Input";
                    objInfo5.PName     = "@pDescription";
                    objInfo5.PValue    = strTabDesc;
                    objInfo5.PDBType   = "NVarchar";
                    objInfo5.PSize     = 200;

                    clsSqlParametersInfo objInfo6 = new clsSqlParametersInfo();
                    objInfo6.Direction = "Input";
                    objInfo6.PName     = "@pGivenID";
                    objInfo6.PValue    = intUserId;
                    objInfo6.PDBType   = "BigInt";
                    objInfo6.PSize     = 200;

                    clsSqlParametersInfo objInfo7 = new clsSqlParametersInfo();
                    objInfo7.Direction = "Output";
                    objInfo7.PName     = "@pReturnMaxID";
                    objInfo7.PValue    = -1;
                    objInfo7.PDBType   = "BigInt";
                    objInfo7.PSize     = 200;


                    lstSP.Add(objInfo);
                    lstSP.Add(objInfo2);
                    lstSP.Add(objInfo3);
                    lstSP.Add(objInfo4);
                    lstSP.Add(objInfo5);
                    lstSP.Add(objInfo6);
                    lstSP.Add(objInfo7);

                    clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                    CSqlInfo.objParam = lstSP;
                    try
                    {
                        return(int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spAETabs", CSqlInfo).ToString()));
                    }
                    catch (System.ServiceModel.EndpointNotFoundException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "Add_Tab(int intTabId...)", "ClsTabLogic.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        return(int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spAETabs", CSqlInfo).ToString()));
                    }
                    catch (System.ServiceModel.CommunicationException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "Add_Tab(int intTabId...)", "ClsTabLogic.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        return(int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spAETabs", CSqlInfo).ToString()));
                    }
                }
                else
                {
                    return(new ClsTabDataService().AddTab(intTabId, intPageId, intTabPosition, strTabTitle, strTabDesc, intUserId));
                }
            }
        }
Beispiel #9
0
        public static void Delete(Int64 ID, IDbTransaction txn)
        {
            if (bool.Parse(VMuktiAPI.VMuktiInfo.Port80) && VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType != PeerType.BootStrap)
            {
                List <clsSqlParametersInfo> lstSP = new List <clsSqlParametersInfo>();

                clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                objInfo.Direction = "Input";
                objInfo.PName     = "@pID";
                objInfo.PValue    = ID;
                objInfo.PDBType   = "BigInt";
                objInfo.PSize     = 200;

                lstSP.Add(objInfo);

                clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                CSqlInfo.objParam = lstSP;

                try
                {
                    VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteNonQuery("spDRoles", CSqlInfo);
                }
                catch (System.ServiceModel.EndpointNotFoundException e)
                {
                    VMuktiHelper.ExceptionHandler(e, "Delete(Int64, IDbTransaction)", "ClsRole.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                    VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteNonQuery("spDRoles", CSqlInfo);
                }
                catch (System.ServiceModel.CommunicationException e)
                {
                    VMuktiHelper.ExceptionHandler(e, "Delete(Int64, IDbTransaction)", "ClsRole.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                    VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteNonQuery("spDRoles", CSqlInfo);
                }
            }
            else
            {
                if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                {
                    List <clsSqlParametersInfo> lstSP = new List <clsSqlParametersInfo>();

                    clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                    objInfo.Direction = "Input";
                    objInfo.PName     = "@pID";
                    objInfo.PValue    = ID;
                    objInfo.PDBType   = "BigInt";
                    objInfo.PSize     = 200;

                    lstSP.Add(objInfo);

                    clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                    CSqlInfo.objParam = lstSP;

                    try
                    {
                        VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteNonQuery("spDRoles", CSqlInfo);
                    }
                    catch (System.ServiceModel.EndpointNotFoundException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "Delete(Int64, IDbTransaction)", "ClsRole.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteNonQuery("spDRoles", CSqlInfo);
                    }
                    catch (System.ServiceModel.CommunicationException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "Delete(Int64, IDbTransaction)", "ClsRole.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteNonQuery("spDRoles", CSqlInfo);
                    }
                }
                else
                {
                    new VMukti.DataAccess.ClsRoleDataService(txn).Role_Delete(ID);
                }
            }
        }
Beispiel #10
0
        public static ClsRole GetByRoleID(Int64 ID)
        {
            ClsRole obj = new ClsRole();

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

                clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                objInfo.Direction = "Input";
                objInfo.PName     = "@pID";
                objInfo.PValue    = ID;
                objInfo.PDBType   = "Int";
                objInfo.PSize     = 200;

                lstSP.Add(objInfo);

                clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                CSqlInfo.objParam = lstSP;
                DataSet ds = null;
                try
                {
                    ds = VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGRole", CSqlInfo).dsInfo;
                }
                catch (System.ServiceModel.EndpointNotFoundException e)
                {
                    VMuktiHelper.ExceptionHandler(e, "GetByRoleID(Int64 ID)", "ClsRole.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                    ds = VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGRole", CSqlInfo).dsInfo;
                }
                catch (System.ServiceModel.CommunicationException e)
                {
                    VMuktiHelper.ExceptionHandler(e, "GetByRoleID(Int64 ID)", "ClsRole.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                    ds = VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGRole", CSqlInfo).dsInfo;
                }


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

                    clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                    objInfo.Direction = "Input";
                    objInfo.PName     = "@pID";
                    objInfo.PValue    = ID;
                    objInfo.PDBType   = "Int";
                    objInfo.PSize     = 200;

                    lstSP.Add(objInfo);

                    clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                    CSqlInfo.objParam = lstSP;
                    DataSet ds = null;
                    try
                    {
                        ds = VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGRole", CSqlInfo).dsInfo;
                    }
                    catch (System.ServiceModel.EndpointNotFoundException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "GetByRoleID(Int64 ID)", "ClsRole.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        ds = VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGRole", CSqlInfo).dsInfo;
                    }
                    catch (System.ServiceModel.CommunicationException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "GetByRoleID(Int64 ID)", "ClsRole.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        ds = VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGRole", CSqlInfo).dsInfo;
                    }


                    if (!obj.MapData(ds.Tables[0]))
                    {
                        obj = null;
                    }
                }
                else
                {
                    DataSet ds = new VMukti.DataAccess.ClsRoleDataService().Role_GetByID(ID);
                    if (!obj.MapData(ds.Tables[0]))
                    {
                        obj = null;
                    }
                }
            }
            return(obj);
        }
Beispiel #11
0
        void FncFillPanel(int StartIndex, bool isModule)
        {
            try
            {
                RecordsPerPage = Convert.ToInt32(panelContainer.ActualWidth / 100) - 2;
                if (isModule)
                {
                    #region logic

                    mEndIndex = mStartIndex + RecordsPerPage;

                    #region endindex  > total records
                    if (mEndIndex > mRecordCount)
                    {
                        if (RecordsPerPage >= mRecordCount)
                        {
                            btnPrevious.IsEnabled = false;
                            btnNext.IsEnabled     = false;
                        }

                        else
                        {
                            btnNext.IsEnabled     = false;
                            btnPrevious.IsEnabled = true;
                        }

                        mEndIndex = mRecordCount % RecordsPerPage;

                        panelContainer.Children.Clear();
                        tbStatus.Text = string.Format("{0}" + " to " + "{1}" + " out of " + "{2}", mStartIndex + 1, mEndIndex + mStartIndex, objCMC.Count);

                        for (int j = mStartIndex; j < mEndIndex + mStartIndex; j++)
                        {
                            if (!objCMC[j].AssemblyFile.Equals("MeetingSchedular.Presentation.dll"))
                            {
                                if (objCMC[j].IsCollaborative.ToLower() == "true")
                                {
                                    AddItem(objCMC[j].ModuleTitle, objCMC[j].ModuleId + ",ModuleType,True", GetImage(objCMC[j].ImageFile));
                                }
                                else
                                {
                                    AddItem(objCMC[j].ModuleTitle, objCMC[j].ModuleId + ",ModuleType,False", GetImage(objCMC[j].ImageFile));
                                }
                            }
                        }
                    }
                    #endregion

                    #region endindex is same as record count

                    else if (mEndIndex == mRecordCount)
                    {
                        btnPrevious.IsEnabled = true;
                        btnNext.IsEnabled     = false;
                        panelContainer.Children.Clear();
                        tbStatus.Text = string.Format("{0}" + " to " + "{1}" + " out of " + "{2}", mStartIndex + 1, mEndIndex, objCMC.Count);

                        for (int j = mStartIndex; j < mEndIndex; j++)
                        {
                            if (!objCMC[j].AssemblyFile.Equals("MeetingSchedular.Presentation.dll"))
                            {
                                if (objCMC[j].IsCollaborative.ToLower() == "true")
                                {
                                    AddItem(objCMC[j].ModuleTitle, objCMC[j].ModuleId + ",ModuleType,True", GetImage(objCMC[j].ImageFile));
                                }
                                else
                                {
                                    AddItem(objCMC[j].ModuleTitle, objCMC[j].ModuleId + ",ModuleType,False", GetImage(objCMC[j].ImageFile));
                                }
                            }
                        }
                    }
                    #endregion

                    #region endindex is same as record count

                    else
                    {
                        if (RecordsPerPage >= mRecordCount)
                        {
                            btnPrevious.IsEnabled = false;
                            btnNext.IsEnabled     = false;
                        }

                        else if (mStartIndex.Equals(0))
                        {
                            btnPrevious.IsEnabled = false;
                            btnNext.IsEnabled     = true;
                        }

                        else
                        {
                            btnPrevious.IsEnabled = true;
                            btnNext.IsEnabled     = true;
                        }
                        panelContainer.Children.Clear();
                        tbStatus.Text = string.Format("{0}" + " to " + "{1}" + " out of " + "{2}", mStartIndex + 1, mEndIndex, objCMC.Count);

                        for (int j = mStartIndex; j < mEndIndex; j++)
                        {
                            if (!objCMC[j].AssemblyFile.Equals("MeetingSchedular.Presentation.dll"))
                            {
                                if (objCMC[j].IsCollaborative.ToLower() == "true")
                                {
                                    AddItem(objCMC[j].ModuleTitle, objCMC[j].ModuleId + ",ModuleType,True", GetImage(objCMC[j].ImageFile));
                                }
                                else
                                {
                                    AddItem(objCMC[j].ModuleTitle, objCMC[j].ModuleId + ",ModuleType,False", GetImage(objCMC[j].ImageFile));
                                }
                            }
                        }
                    }
                    #endregion

                    #endregion
                }

                else
                {
                    #region logic

                    pEndIndex = pStartIndex + RecordsPerPage;


                    if (pEndIndex > pRecordCount)
                    {
                        if (RecordsPerPage >= pRecordCount)
                        {
                            btnPrevious.IsEnabled = false;
                            btnNext.IsEnabled     = false;
                        }

                        else
                        {
                            btnNext.IsEnabled     = false;
                            btnPrevious.IsEnabled = true;
                        }

                        pEndIndex = pRecordCount % RecordsPerPage;

                        panelContainer.Children.Clear();
                        tbStatus.Text = string.Format("{0}" + " to " + "{1}" + " out of " + "{2}", pStartIndex + 1, pEndIndex + pStartIndex, objCPC.Count);

                        for (int j = pStartIndex; j < pEndIndex + pStartIndex; j++)
                        {
                            AddItem(objCPC[j].PageTitle, true, ImageType.Page, objCPC[j].PageId.ToString());
                        }
                    }
                    else if (pEndIndex == pRecordCount)
                    {
                        btnPrevious.IsEnabled = true;
                        btnNext.IsEnabled     = false;

                        panelContainer.Children.Clear();
                        tbStatus.Text = string.Format("{0}" + " to " + "{1}" + " out of " + "{2}", pStartIndex + 1, pEndIndex, objCPC.Count);

                        for (int j = pStartIndex; j < pEndIndex; j++)
                        {
                            AddItem(objCPC[j].PageTitle, true, ImageType.Page, objCPC[j].PageId.ToString());
                        }
                    }

                    else
                    {
                        if (RecordsPerPage >= pRecordCount)
                        {
                            btnPrevious.IsEnabled = false;
                            btnNext.IsEnabled     = false;
                        }

                        else if (pStartIndex.Equals(0))
                        {
                            btnPrevious.IsEnabled = false;
                            btnNext.IsEnabled     = true;
                        }

                        else
                        {
                            btnPrevious.IsEnabled = true;
                            btnNext.IsEnabled     = true;
                        }
                        panelContainer.Children.Clear();
                        tbStatus.Text = string.Format("{0}" + " to " + "{1}" + " out of " + "{2}", pStartIndex + 1, pEndIndex, objCPC.Count);

                        for (int j = pStartIndex; j < pEndIndex; j++)
                        {
                            AddItem(objCPC[j].PageTitle, true, ImageType.Page, objCPC[j].PageId.ToString());
                        }
                    }
                    #endregion
                }
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "FncFillPanel()", "Controls\\ModuleExplorer\\CtlModule.xaml.cs");
            }
        }
Beispiel #12
0
        void btnModule_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                blModuleClick = true;;
                isModule      = true;

                int precount = 0;
                if (objCMC != null)
                {
                    precount = objCMC.Count;
                    ClsModuleCollection objTest = new ClsModuleCollection();
                    objTest = ClsModuleCollection.GetCModCountCheck(VMuktiAPI.VMuktiInfo.CurrentPeer.RoleID, objCMC.Count + 1);
                    if (objTest.Count > 0)
                    {
                        objCMC = objTest;
                    }
                }
                else
                {
                    objCMC = ClsModuleCollection.GetCMod(VMuktiAPI.VMuktiInfo.CurrentPeer.RoleID);
                    for (int i = 0; i < objCMC.Count; i++)
                    {
                        if (objCMC[i].AssemblyFile.Equals("MeetingSchedular.Presentation.dll"))
                        {
                            objCMC.RemoveAt(i);
                            break;
                        }
                    }
                }
                //if size of panel container is changed or new module is added then call this function
                if (objCMC.Count != precount || blSizeChanged || blPageClick)
                {
                    blPageClick = false;
                    panelContainer.Children.Clear();
                    blSizeChanged = false;
                    mRecordCount  = objCMC.Count;
                    if (mRecordCount != 0)
                    {
                        if (objCMC.Count > RecordsPerPage)
                        {
                            btnPrevious.IsEnabled = false;
                            btnNext.IsEnabled     = true;
                            tbStatus.Text         = string.Format("1 to " + "{0}" + " out of " + "{1}", RecordsPerPage, objCMC.Count);


                            for (int j = 0; j < RecordsPerPage; j++)
                            {
                                if (objCMC[j].IsCollaborative.ToLower() == "true")
                                {
                                    AddItem(objCMC[j].ModuleTitle, objCMC[j].ModuleId + ",ModuleType,True", GetImage(objCMC[j].ImageFile));
                                }
                                else
                                {
                                    AddItem(objCMC[j].ModuleTitle, objCMC[j].ModuleId + ",ModuleType,False", GetImage(objCMC[j].ImageFile));
                                }
                            }
                        }
                        else
                        {
                            btnPrevious.IsEnabled = false;
                            btnNext.IsEnabled     = false;
                            tbStatus.Text         = string.Format("1 to " + "{0}" + " out of " + "{1}", objCMC.Count, objCMC.Count);
                            for (int j = 0; j < objCMC.Count; j++)
                            {
                                if (objCMC[j].IsCollaborative.ToLower() == "true")
                                {
                                    AddItem(objCMC[j].ModuleTitle, objCMC[j].ModuleId + ",ModuleType,True", GetImage(objCMC[j].ImageFile));
                                }
                                else
                                {
                                    AddItem(objCMC[j].ModuleTitle, objCMC[j].ModuleId + ",ModuleType,False", GetImage(objCMC[j].ImageFile));
                                }
                            }
                        }
                    }
                    else
                    {
                        btnPrevious.IsEnabled = false;
                        btnNext.IsEnabled     = false;
                        tbStatus.Text         = string.Format("No records are Available");
                    }
                }
                brdPaging.Visibility = Visibility.Visible;
            }

            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "btnModule_Click()", "Controls\\ModuleExplorer\\CtlModule.xaml.cs");
            }
        }
Beispiel #13
0
        //public void btnClose_Click(object sender, RoutedEventArgs e)
        //{
        //    try
        //    {
        //        entClosemodule();
        //    }
        //    catch (Exception ex)
        //    {
        //    }
        //}

        public void AddItem(string strCaption, bool ShowImage, ImageType objImageType, string strTag)
        {
            try
            {
                objExpanderItem = new CtlMExpanderItem();
                objExpanderItem.HorizontalAlignment = HorizontalAlignment.Stretch;
                objExpanderItem.VerticalAlignment   = VerticalAlignment.Stretch;
                objExpanderItem.Margin = new Thickness(10, 10, 10, 10);

                if (objImageType == ImageType.MaleBuddy || objImageType == ImageType.FemaleBuddy)
                {
                    objExpanderItem.AllowDrop = true;
                }

                objExpanderItem.Tag = strTag;
                objExpanderItem.PreviewMouseDown += new System.Windows.Input.MouseButtonEventHandler(objExpanderItem_PreviewMouseDown);

                if (ShowImage)
                {
                    if (objImageType == ImageType.Page)
                    {
                        objExpanderItem.Image = @"\Skins\Images\Page.png";
                    }
                    else if (objImageType == ImageType.Module)
                    {
                        // objExpanderItem.Image = @"\Skins\Images\Modules.png";
                        objExpanderItem.Image = @"\Skins\Images1\Skins.png";
                    }
                    else if (objImageType == ImageType.MaleBuddy)
                    {
                        objExpanderItem.Image = @"\Skins\Images\Buddy.Png";
                    }
                    else if (objImageType == ImageType.FemaleBuddy)
                    {
                        objExpanderItem.Image = @"\Skins\Images\FBuddy.Png";
                    }
                }
                else
                {
                    objExpanderItem.Image = "";
                }

                objExpanderItem.Caption = strCaption;

                if (strTag == "offline")
                {
                    objExpanderItem.Image   = @"\Skins\Images\FBuddy.Png";
                    objExpanderItem.ToolTip = strCaption + " is offline";

                    objExpanderItem.PreviewMouseDown -= new System.Windows.Input.MouseButtonEventHandler(objExpanderItem_PreviewMouseDown);
                }
                else if (strTag == "online")
                {
                    objExpanderItem.Image   = @"\Skins\Images\Buddy.Png";
                    objExpanderItem.ToolTip = strCaption + " is online";
                }
                panelContainer.Children.Add(objExpanderItem);
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "AddItem()", "Controls\\ModuleExplorer\\CtlModule.xaml.cs");
            }
        }
Beispiel #14
0
        private void OnIRTCSessionStateChangeEvent(IRTCSessionStateChangeEvent sessionevent)
        {
            try
            {
                RTC_SESSION_STATE sessionstate;
                sessionstate = sessionevent.State;

                switch (sessionstate)
                {
                case RTC_SESSION_STATE.RTCSS_INPROGRESS:
                {
                    if (_IPGCounter == -1)
                    {
                        entstatus(this, "InPorgress", this.strNumber, this.strHangUpModule);
                        _IPGCounter = 1;
                    }
                    else if (_IPGCounter == 2)
                    {
                        _IPGCounter = -1;
                    }
                    else
                    {
                        _IPGCounter += 1;
                    }
                    break;
                }

                case RTC_SESSION_STATE.RTCSS_INCOMING:
                {
                    oclient.PlayRing(RTC_RING_TYPE.RTCRT_PHONE, true);
                    osession = sessionevent.Session;
                    entstatus(this, "Incoming", this.strNumber, this.strHangUpModule);
                    break;
                }

                case RTC_SESSION_STATE.RTCSS_ANSWERING:
                {
                    entstatus(this, "Answering", this.strNumber, this.strHangUpModule);
                    break;
                }

                case RTC_SESSION_STATE.RTCSS_CONNECTED:
                {
                    entstatus(this, "Connected", this.strNumber, this.strHangUpModule);
                    break;
                }

                case RTC_SESSION_STATE.RTCSS_DISCONNECTED:
                {
                    osession = null;
                    entstatus(this, "Disconnected", this.strNumber, this.strHangUpModule);
                    break;
                }

                case RTC_SESSION_STATE.RTCSS_HOLD:
                {
                    entstatus(this, "Hold", this.strNumber, this.strHangUpModule);
                    break;
                }

                case RTC_SESSION_STATE.RTCSS_REFER:
                {
                    break;
                }
                }
                sessionevent = null;
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "OnIRTCSessionStateChangeEvent()", "RTCAudio.cs");
            }
        }
Beispiel #15
0
        int DownloadAndExtractZipFile()
        {
            str = CRMName;
            str = str + "_CRM";

            //Retrives the Assembly of the Zip file.
            Assembly ass = Assembly.GetEntryAssembly();

            #region Downloading ZipFile

            //Set the Variable.
            filename = str + ".zip";

            //string strModPath = "";


            #region Download Zip File using WCF FileTranserService

            //Download file using WCF FileTransferService


            try
            {
                //Create object of the HTTP Client.
                BasicHttpClient bhcFts = new BasicHttpClient();

                //Open Client.
                clientHttpFileTransfer = (IHTTPFileTransferService)bhcFts.OpenClient <IHTTPFileTransferService>("http://" + VMuktiInfo.BootStrapIPs[0] + ":80/VMukti/HttpFileTransferService");

                //Join the network.
                clientHttpFileTransfer.svcHTTPFileTransferServiceJoin();

                //Create request to download File from Bootstrap.
                DownloadRequest request = new DownloadRequest();

                //Providing the information of the file that needs to download.
                RemoteFileInfo rfi = new RemoteFileInfo();
                request.FileName = filename;
                request.FolderWhereFileIsStored = "CRMs";

                //Calling the WCF Function for downloading the File.
                rfi = clientHttpFileTransfer.svcHTTPFileTransferServiceDownloadFile(request);


                //Checking for Directory Existence.
                //if (!Directory.Exists(ass.Location.Replace("VMukti.Presentation.exe", @"CRMs")))
                if (!Directory.Exists(ass.Location.Replace("VMukti.Presentation.exe", @"CRMs")))
                {
                    Directory.CreateDirectory(ass.Location.Replace("VMukti.Presentation.exe", @"CRMs"));
                }

                destination = ass.Location.Replace("VMukti.Presentation.exe", @"CRMs");

                //Checking for File Existance.
                if (File.Exists((destination + "\\" + filename)))
                {
                    File.Delete((destination + "\\" + filename));
                }

                filePath = destination + "\\" + filename;

                System.IO.Stream inputStream = rfi.FileByteStream;


                using (System.IO.FileStream writeStream = new System.IO.FileStream(filePath, System.IO.FileMode.CreateNew, System.IO.FileAccess.Write))
                {
                    int    chunkSize = 2048;
                    byte[] buffer    = new byte[chunkSize];

                    do
                    {
                        // read bytes from input stream
                        int bytesRead = inputStream.Read(buffer, 0, chunkSize);
                        if (bytesRead == 0)
                        {
                            break;
                        }

                        // write bytes to output stream
                        writeStream.Write(buffer, 0, bytesRead);
                    } while (true);

                    writeStream.Close();
                }
            }
            catch (Exception ex)
            {
                //MessageBox.Show("Download Zip: " + ex.Message);
                VMuktiHelper.ExceptionHandler(ex, "DownloadAndExtractZipFile()", "CtlCRMContainer.xaml.cs");
                if (ex.InnerException != null)
                {
                    //MessageBox.Show("Download Zip Inner Exception: " + ex.InnerException.Message);
                    VMuktiHelper.ExceptionHandler(ex, "DownloadAndExtractZipFile()", "CtlCRMContainer.xaml.cs");
                }
            }

            #endregion

            #region Downloading using Web Client --------Commented
            //try
            //{
            //    Uri u = new Uri("http://" + VMuktiAPI.VMuktiInfo.BootStrapIPs[0] + "/VMukti/CRMs/" + filename);
            //    if (!Directory.Exists(ass.Location.Replace("VMukti.Presentation.exe", @"CRMs")))
            //    {
            //        Directory.CreateDirectory(ass.Location.Replace("VMukti.Presentation.exe", @"CRMs"));
            //    }
            //    destination = ass.Location.Replace("VMukti.Presentation.exe", @"CRMs");
            //    if (!File.Exists(destination + "\\" + filename))
            //    {
            //        WebClient wc = new WebClient();
            //        try
            //        {
            //            wc.DownloadFile(u, destination + "\\" + filename);
            //        }
            //        catch (Exception exp)
            //        {
            //            MessageBox.Show(exp.Message);
            //        }
            //    }
            //}
            //catch (Exception exp)
            //{
            //    MessageBox.Show("Down Load Error - " + exp.Message);
            //}
            #endregion

            #endregion

            #region Extracting

            //Code for Extracting the .zip file.
            try
            {
                //Checking for the Existance of the Directory.

                if (!Directory.Exists(ass.Location.Replace("VMukti.Presentation.exe", @"CRMModules")))
                {
                    Directory.CreateDirectory(ass.Location.Replace("VMukti.Presentation.exe", @"CRMModules"));
                }
                str = CRMName;
                str = str + "_CRM";
                Assembly ass2 = Assembly.GetEntryAssembly();
                strModPath = ass2.Location.Replace("VMukti.Presentation.exe", @"CRMModules");

                VMukti.ZipUnzip.Zip.FastZip fz = new VMukti.ZipUnzip.Zip.FastZip();
                //ICSharpCode.SharpZipLib.Zip.FastZip fz = new ICSharpCode.SharpZipLib.Zip.FastZip();

                //FastZip fz = new FastZip();
                //if (!Directory.Exists(strModPath + "\\" + filename.Split('.')[0]))
                //{
                try
                {
                    //Extracting the zip file.
                    fz.ExtractZip(destination + "\\" + filename, strModPath + "\\" + str, null);
                }
                catch (Exception exp)
                {
                    //MessageBox.Show(exp.Message + " First Desgine Required CRM Using CRMDesginer");
                    VMuktiHelper.ExceptionHandler(exp, "DownloadAndExtractZipFile()", "CtlCRMContainer.xaml.cs");
                }
                // }
            }
            catch (Exception exp)
            {
                VMuktiHelper.ExceptionHandler(exp, "DownloadAndExtractZipFile(Outer)", "CtlCRMContainer.xaml.cs");
                return(-1);
            }

            #endregion
            return(0);
        }
Beispiel #16
0
        public int Get_TabMaxId()
        {
            if (bool.Parse(VMuktiAPI.VMuktiInfo.Port80) && VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType != PeerType.BootStrap)
            {
                List <clsSqlParametersInfo> lstSP = new List <clsSqlParametersInfo>();

                clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                objInfo.Direction = "Output";
                objInfo.PName     = "@pReturnMaxID";
                objInfo.PValue    = -1;
                objInfo.PDBType   = "BigInt";
                objInfo.PSize     = 200;

                clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                CSqlInfo.objParam = lstSP;

                try
                {
                    return(int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spGMaxTabId", CSqlInfo).ToString()));
                }
                catch (System.ServiceModel.EndpointNotFoundException e)
                {
                    VMuktiHelper.ExceptionHandler(e, "Get_TabMaxId()", "ClsTabLogic.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                    return(int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spGMaxTabId", CSqlInfo).ToString()));
                }
                catch (System.ServiceModel.CommunicationException e)
                {
                    VMuktiHelper.ExceptionHandler(e, "Get_TabMaxId()", "ClsTabLogic.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                    return(int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spGMaxTabId", CSqlInfo).ToString()));
                }
            }
            else
            {
                if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                {
                    List <clsSqlParametersInfo> lstSP = new List <clsSqlParametersInfo>();

                    clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                    objInfo.Direction = "Output";
                    objInfo.PName     = "@pReturnMaxID";
                    objInfo.PValue    = -1;
                    objInfo.PDBType   = "BigInt";
                    objInfo.PSize     = 200;

                    clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                    CSqlInfo.objParam = lstSP;

                    try
                    {
                        return(int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spGMaxTabId", CSqlInfo).ToString()));
                    }
                    catch (System.ServiceModel.EndpointNotFoundException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "Get_TabMaxId()", "ClsTabLogic.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        return(int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spGMaxTabId", CSqlInfo).ToString()));
                    }
                    catch (System.ServiceModel.CommunicationException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "Get_TabMaxId()", "ClsTabLogic.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        return(int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spGMaxTabId", CSqlInfo).ToString()));
                    }
                }
                else
                {
                    return(new ClsTabDataService().GetMaxTabId());
                }
            }
        }
Beispiel #17
0
        public DataSet Get_TabPage(int intPageId)
        {
            if (bool.Parse(VMuktiAPI.VMuktiInfo.Port80) && VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType != PeerType.BootStrap)
            {
                List <clsSqlParametersInfo> lstSP = new List <clsSqlParametersInfo>();

                clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                objInfo.Direction = "Input";
                objInfo.PName     = "@pID";
                objInfo.PValue    = intPageId;
                objInfo.PDBType   = "Int";
                objInfo.PSize     = 200;

                lstSP.Add(objInfo);

                clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                CSqlInfo.objParam = lstSP;


                try
                {
                    return(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGTabPage", CSqlInfo).dsInfo);
                }
                catch (System.ServiceModel.EndpointNotFoundException e)
                {
                    VMuktiHelper.ExceptionHandler(e, "Get_TabPage(int intPageId)", "ClsTabLogic.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                    return(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGTabPage", CSqlInfo).dsInfo);
                }
                catch (System.ServiceModel.CommunicationException e)
                {
                    VMuktiHelper.ExceptionHandler(e, "Get_TabPage(int intPageId)", "ClsTabLogic.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                    return(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGTabPage", CSqlInfo).dsInfo);
                }
            }
            else
            {
                if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                {
                    List <clsSqlParametersInfo> lstSP = new List <clsSqlParametersInfo>();

                    clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                    objInfo.Direction = "Input";
                    objInfo.PName     = "@pID";
                    objInfo.PValue    = intPageId;
                    objInfo.PDBType   = "Int";
                    objInfo.PSize     = 200;

                    lstSP.Add(objInfo);

                    clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                    CSqlInfo.objParam = lstSP;


                    try
                    {
                        return(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGTabPage", CSqlInfo).dsInfo);
                    }
                    catch (System.ServiceModel.EndpointNotFoundException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "Get_TabPage(int intPageId)", "ClsTabLogic.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        return(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGTabPage", CSqlInfo).dsInfo);
                    }
                    catch (System.ServiceModel.CommunicationException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "Get_TabPage(int intPageId)", "ClsTabLogic.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        return(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGTabPage", CSqlInfo).dsInfo);
                    }
                }
                else
                {
                    return(new ClsTabDataService().GetTabPage(intPageId));
                }
            }
        }
Beispiel #18
0
        public Int64 Save(IDbTransaction txn)
        {
            if (bool.Parse(VMuktiAPI.VMuktiInfo.Port80) && VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType != PeerType.BootStrap)
            {
                List <clsSqlParametersInfo> lstSP = new List <clsSqlParametersInfo>();

                clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                objInfo.Direction = "Input";
                objInfo.PName     = "@pID";
                objInfo.PValue    = _ID;
                objInfo.PDBType   = "BigInt";
                objInfo.PSize     = 200;

                clsSqlParametersInfo objInfo2 = new clsSqlParametersInfo();
                objInfo2.Direction = "Input";
                objInfo2.PName     = "@pRoleName";
                objInfo2.PValue    = _RoleName;
                objInfo2.PDBType   = "NVarChar";
                objInfo2.PSize     = 50;


                clsSqlParametersInfo objInfo3 = new clsSqlParametersInfo();
                objInfo3.Direction = "Input";
                objInfo3.PName     = "@pDescription";
                objInfo3.PValue    = _Description;
                objInfo3.PDBType   = "NVarChar";
                objInfo3.PSize     = 100;

                clsSqlParametersInfo objInfo4 = new clsSqlParametersInfo();
                objInfo4.Direction = "Input";
                objInfo4.PName     = "@pIsAdmin";
                objInfo4.PValue    = _IsAdmin;
                objInfo4.PDBType   = "Bit";
                objInfo4.PSize     = 200;

                clsSqlParametersInfo objInfo5 = new clsSqlParametersInfo();
                objInfo5.Direction = "Input";
                objInfo5.PName     = "@pUserID";
                objInfo5.PValue    = _CreatedBy;
                objInfo5.PDBType   = "BigInt";
                objInfo5.PSize     = 200;

                clsSqlParametersInfo objInfo6 = new clsSqlParametersInfo();
                objInfo6.Direction = "InputOutput";
                objInfo6.PName     = "@pReturnMaxID";
                objInfo6.PValue    = -1;
                objInfo6.PDBType   = "BigInt";
                objInfo6.PSize     = 200;


                lstSP.Add(objInfo);
                lstSP.Add(objInfo2);
                lstSP.Add(objInfo3);
                lstSP.Add(objInfo4);
                lstSP.Add(objInfo5);
                lstSP.Add(objInfo6);


                clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                CSqlInfo.objParam = lstSP;

                try
                {
                    return((Int64)int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spAERoles", CSqlInfo).ToString()));
                }
                catch (System.ServiceModel.EndpointNotFoundException e)
                {
                    VMuktiHelper.ExceptionHandler(e, "Save(IDbTransaction txn)", "ClsRole.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                    return((Int64)int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spAERoles", CSqlInfo).ToString()));
                }
                catch (System.ServiceModel.CommunicationException e)
                {
                    VMuktiHelper.ExceptionHandler(e, "Save(IDbTransaction txn)", "ClsRole.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                    return((Int64)int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spAERoles", CSqlInfo).ToString()));
                }
            }
            else
            {
                if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                {
                    List <clsSqlParametersInfo> lstSP = new List <clsSqlParametersInfo>();

                    clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                    objInfo.Direction = "Input";
                    objInfo.PName     = "@pID";
                    objInfo.PValue    = _ID;
                    objInfo.PDBType   = "BigInt";
                    objInfo.PSize     = 200;

                    clsSqlParametersInfo objInfo2 = new clsSqlParametersInfo();
                    objInfo2.Direction = "Input";
                    objInfo2.PName     = "@pRoleName";
                    objInfo2.PValue    = _RoleName;
                    objInfo2.PDBType   = "NVarChar";
                    objInfo2.PSize     = 50;


                    clsSqlParametersInfo objInfo3 = new clsSqlParametersInfo();
                    objInfo3.Direction = "Input";
                    objInfo3.PName     = "@pDescription";
                    objInfo3.PValue    = _Description;
                    objInfo3.PDBType   = "NVarChar";
                    objInfo3.PSize     = 100;

                    clsSqlParametersInfo objInfo4 = new clsSqlParametersInfo();
                    objInfo4.Direction = "Input";
                    objInfo4.PName     = "@pIsAdmin";
                    objInfo4.PValue    = _IsAdmin;
                    objInfo4.PDBType   = "Bit";
                    objInfo4.PSize     = 200;

                    clsSqlParametersInfo objInfo5 = new clsSqlParametersInfo();
                    objInfo5.Direction = "Input";
                    objInfo5.PName     = "@pUserID";
                    objInfo5.PValue    = _CreatedBy;
                    objInfo5.PDBType   = "BigInt";
                    objInfo5.PSize     = 200;

                    clsSqlParametersInfo objInfo6 = new clsSqlParametersInfo();
                    objInfo6.Direction = "InputOutput";
                    objInfo6.PName     = "@pReturnMaxID";
                    objInfo6.PValue    = -1;
                    objInfo6.PDBType   = "BigInt";
                    objInfo6.PSize     = 200;


                    lstSP.Add(objInfo);
                    lstSP.Add(objInfo2);
                    lstSP.Add(objInfo3);
                    lstSP.Add(objInfo4);
                    lstSP.Add(objInfo5);
                    lstSP.Add(objInfo6);


                    clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                    CSqlInfo.objParam = lstSP;

                    try
                    {
                        return((Int64)int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spAERoles", CSqlInfo).ToString()));
                    }
                    catch (System.ServiceModel.EndpointNotFoundException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "Save(IDbTransaction txn)", "ClsRole.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        return((Int64)int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spAERoles", CSqlInfo).ToString()));
                    }
                    catch (System.ServiceModel.CommunicationException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "Save(IDbTransaction txn)", "ClsRole.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        return((Int64)int.Parse(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spAERoles", CSqlInfo).ToString()));
                    }
                }
                else
                {
                    return(new VMukti.DataAccess.ClsRoleDataService(txn).Role_Save(ref _ID, _RoleName, _Description, _IsAdmin, _CreatedBy));
                }
            }
        }
        public static ClsPermissionCollection Get_PermissionRefModule(int ModuleId, int RoleId)
        {
            ClsPermissionCollection obj = new ClsPermissionCollection();

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

                clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                objInfo.Direction = "Input";
                objInfo.PName     = "@pModuleId";
                objInfo.PValue    = ModuleId;
                objInfo.PDBType   = "BigInt";
                objInfo.PSize     = 200;

                clsSqlParametersInfo objInfo2 = new clsSqlParametersInfo();
                objInfo2.Direction = "Input";
                objInfo2.PName     = "@pRoleId";
                objInfo2.PValue    = RoleId;
                objInfo2.PDBType   = "BigInt";
                objInfo2.PSize     = 200;

                lstSP.Add(objInfo);
                lstSP.Add(objInfo2);

                clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                CSqlInfo.objParam = lstSP;
                try
                {
                    obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGPermissionRefModule", CSqlInfo).dsInfo);
                }
                catch (System.ServiceModel.EndpointNotFoundException e)
                {
                    VMuktiHelper.ExceptionHandler(e, "Get_PermissionRefModule(int ModuleId, int RoleId)", "ClsPermissionCollection.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                    obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGPermissionRefModule", CSqlInfo).dsInfo);
                }
                catch (System.ServiceModel.CommunicationException e)
                {
                    VMuktiHelper.ExceptionHandler(e, "Get_PermissionRefModule(int ModuleId, int RoleId)", "ClsPermissionCollection.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                    obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGPermissionRefModule", CSqlInfo).dsInfo);
                }
            }
            else
            {
                if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                {
                    List <clsSqlParametersInfo> lstSP = new List <clsSqlParametersInfo>();

                    clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                    objInfo.Direction = "Input";
                    objInfo.PName     = "@pModuleId";
                    objInfo.PValue    = ModuleId;
                    objInfo.PDBType   = "BigInt";
                    objInfo.PSize     = 200;

                    clsSqlParametersInfo objInfo2 = new clsSqlParametersInfo();
                    objInfo2.Direction = "Input";
                    objInfo2.PName     = "@pRoleId";
                    objInfo2.PValue    = RoleId;
                    objInfo2.PDBType   = "BigInt";
                    objInfo2.PSize     = 200;

                    lstSP.Add(objInfo);
                    lstSP.Add(objInfo2);

                    clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                    CSqlInfo.objParam = lstSP;
                    try
                    {
                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGPermissionRefModule", CSqlInfo).dsInfo);
                    }
                    catch (System.ServiceModel.EndpointNotFoundException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "Get_PermissionRefModule(int ModuleId, int RoleId)", "ClsPermissionCollection.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGPermissionRefModule", CSqlInfo).dsInfo);
                    }
                    catch (System.ServiceModel.CommunicationException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "Get_PermissionRefModule(int ModuleId, int RoleId)", "ClsPermissionCollection.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGPermissionRefModule", CSqlInfo).dsInfo);
                    }
                }
                else
                {
                    obj.MapObjects(new ClsPermissionDataService().GetPermissionRefModule(ModuleId, RoleId));
                }
            }
            return(obj);
        }
Beispiel #20
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);
            }
        }
        public static ClsModuleCollection GetCModCountCheck(int intRoleId, int intMCount)
        {
            ClsModuleCollection obj = new ClsModuleCollection();

            if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
            {
                List <clsSqlParametersInfo> lstSP = new List <clsSqlParametersInfo>();

                clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                objInfo.Direction = "Input";
                objInfo.PName     = "@pRoleId";
                objInfo.PValue    = intRoleId;
                objInfo.PDBType   = "BigInt";
                objInfo.PSize     = 200;
                lstSP.Add(objInfo);

                clsSqlParametersInfo objInfoCount = new clsSqlParametersInfo();
                objInfoCount.Direction = "Input";
                objInfoCount.PName     = "@pCount";
                objInfoCount.PValue    = intMCount;
                objInfoCount.PDBType   = "BigInt";
                objInfoCount.PSize     = 200;
                lstSP.Add(objInfoCount);

                clsSqlParametersInfo objVersionInfo = new clsSqlParametersInfo();
                objVersionInfo.Direction = "Input";
                objVersionInfo.PName     = "@pVersion";
                if (VMuktiAPI.VMuktiInfo.VMuktiVersion == "1.0")
                {
                    objVersionInfo.PValue = "1.0.%";
                }
                else
                {
                    objVersionInfo.PValue = " ";
                }
                objVersionInfo.PDBType = "varchar";
                objVersionInfo.PSize   = 10;
                lstSP.Add(objVersionInfo);

                clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                CSqlInfo.objParam = lstSP;

                try
                {
                    obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGCModulesCount", CSqlInfo).dsInfo);
                }
                catch (System.ServiceModel.EndpointNotFoundException e)
                {
                    VMuktiHelper.ExceptionHandler(e, "GetCModCountCheck(int intRoleId,int intMCount)", "clsModuleCollection.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                    obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGCModulesCount", CSqlInfo).dsInfo);
                }
                catch (System.ServiceModel.CommunicationException e)
                {
                    VMuktiHelper.ExceptionHandler(e, "GetCModCountCheck(int intRoleId,int intMCount)", "clsModuleCollection.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                    obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGCModulesCount", CSqlInfo).dsInfo);
                }
            }
            else
            {
                obj.MapObjects(new ClsModuleDataService().GetCollaborativeCheckingModuleCount(intRoleId, intMCount));
            }
            return(obj);
        }
        public PredictiveDialer(ModulePermissions[] MyPermissions)// done
        {
            InitializeComponent();

            try
            {
                Microsoft.Win32.RegistryKey rk  = Microsoft.Win32.Registry.LocalMachine;
                Microsoft.Win32.RegistryKey sk1 = rk.OpenSubKey("SOFTWARE\\Orkaudio");
                if (sk1 != null)
                {
                    StrOrkaInstallDirectory = (string)sk1.GetValue("Install_Dir");
                }
                else
                {
                    StrOrkaInstallDirectory = "";
                    VMuktiAPI.ClsException.WriteToLogFile("Oreka is not Installed");
                }
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "MyDialer()", "MyDialer.xaml.cs");
            }

            try
            {
                objChannelManager = new ClsChannelManager();

                btnManualDial.Click     += new RoutedEventHandler(btnManualDial_Click);
                btnPredictiveDial.Click += new RoutedEventHandler(btnPredictiveDial_Click);
                //this.Unloaded += new RoutedEventHandler(PredictiveDialer_Unloaded);
                Application.Current.MainWindow.Closing += new System.ComponentModel.CancelEventHandler(MainWindow_Closing);
                Application.Current.Exit += new ExitEventHandler(Current_Exit);

                VMuktiHelper.RegisterEvent("SetDispositionForPredictive").VMuktiEvent   += new VMuktiEvents.VMuktiEventHandler(SetDispositionForPredictive_VMuktiEvent);
                VMuktiHelper.RegisterEvent("SetChannelStatusForPredictive").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(SetChannelStatusForPredictive_VMuktiEvent);
                VMuktiHelper.RegisterEvent("AllModulesLoadedForPredictive").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(AllCtlLoaded_VMuktiEvent);
                VMuktiHelper.RegisterEvent("SetPredictiveDialerEnable").VMuktiEvent     += new VMuktiEvents.VMuktiEventHandler(SetPredictivePhoneDEnable_VMuktiEvent);
                VMuktiHelper.RegisterEvent("SetAgentNumber").VMuktiEvent += new VMuktiEvents.VMuktiEventHandler(SetAgentNumber_VMuktiEvent);

                try
                {
                    if (VMuktiAPI.VMuktiInfo.strExternalPBX == "true")
                    {
                        if (!objChannelManager.RegisterSIPUser())
                        {
                            SIPUserAvailable = false;
                        }
                        else
                        {
                            SIPUserAvailable = true;
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }


                ((svcCallInfo)objCallInfo).EntsvcJoin                  += new svcCallInfo.DelsvcJoin(PredictiveDialer_EntsvcJoin);
                ((svcCallInfo)objCallInfo).EntAddExtraCall             += new svcCallInfo.DelsvcAddExtraCall(PredictiveDialer_EntAddExtraCall);
                ((svcCallInfo)objCallInfo).EntRequestExtraCall         += new svcCallInfo.DelsvcRequestExtraCall(PredictiveDialer_EntRequestExtraCall);
                ((svcCallInfo)objCallInfo).EntSendExtraCall            += new svcCallInfo.DelsvcSendExtraCall(PredictiveDialer_EntSendExtraCall);
                ((svcCallInfo)objCallInfo).EntRemoveExtraCall          += new svcCallInfo.DelsvcRemoveExtraCall(PredictiveDialer_EntRemoveExtraCall);
                ((svcCallInfo)objCallInfo).EntRequestFunctionToExecute += new svcCallInfo.DelsvcRequestFunctionToExecute(PredictiveDialer_EntRequestFunctionToExecute);
                ((svcCallInfo)objCallInfo).EntReplyFunctionExecuted    += new svcCallInfo.DelsvcReplyFunctionExecuted(PredictiveDialer_EntReplyFunctionExecuted);
                ((svcCallInfo)objCallInfo).EntHangUpCall               += new svcCallInfo.DelsvcHangUpCall(PredictiveDialer_EntHangUpCall);
                ((svcCallInfo)objCallInfo).EntUnJoin += new svcCallInfo.DelsvcUnJoin(PredictiveDialer_EntUnJoin);

                if (CallInfoChannel != null && CallInfoChannel.State == CommunicationState.Opened)
                {
                    CallInfoChannel.Close();
                    CallInfoChannel = null;
                }
                CallInfoClient  = new VMuktiService.NetPeerClient();
                CallInfoChannel = (INetP2PBootStrapPredictiveServiceChannel)CallInfoClient.OpenClient <INetP2PBootStrapPredictiveServiceChannel>("net.tcp://" + VMuktiAPI.VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapPredictive", "P2PBootStrapPredictiveMesh", ref objCallInfo);
                CallInfoChannel.svcJoin(objChannelManager.AgentNumber.ToString(), objChannelManager.CurrentCampaingID.ToString());

                #region Starting Thread for DashBoard and uploading recorded files.

                thHostDashBoard = new Thread(new ParameterizedThreadStart(HostDashBoard));
                List <object> lstParams = new List <object>();
                lstParams.Add("net.tcp://" + VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapDashBoard");
                lstParams.Add("P2PDashBoardMesh");
                thHostDashBoard.Start(lstParams);

                //File Recoreding
                tHostRecordedFiles = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(HostRecordedFiles));
                List <object> lstParams1 = new List <object>();
                lstParams1.Add("net.tcp://" + VMuktiInfo.BootStrapIPs[0] + ":6000/NetP2PBootStrapRecordedFiles");
                lstParams1.Add("P2PRecordedFiles");
                tHostRecordedFiles.Start(lstParams1);

                #endregion
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "PredictiveDialer(Outer)", "PredictiveDialer.xaml.cs");
            }
        }
Beispiel #23
0
        public void DeleteCategory(int id)
        {
            try
            {
                if (bool.Parse(VMuktiAPI.VMuktiInfo.Port80) && VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType != PeerType.BootStrap)
                {
                    List <clsSqlParametersInfo> lstSP = new List <clsSqlParametersInfo>();

                    clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                    objInfo.Direction = "Input";
                    objInfo.PName     = "@pID";
                    objInfo.PValue    = id;
                    objInfo.PDBType   = "BigInt";
                    objInfo.PSize     = 200;

                    lstSP.Add(objInfo);

                    clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                    CSqlInfo.objParam = lstSP;
                    try
                    {
                        VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spDeleteCategory", CSqlInfo).ToString();
                    }
                    catch (System.ServiceModel.EndpointNotFoundException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "DeleteCategory(int Id)", "ClsModuleLogic.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spDeleteCategory", CSqlInfo);
                    }
                    catch (System.ServiceModel.CommunicationException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "DeleteCategory(int Id)", "ClsModuleLogic.cs"); VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spDeleteCategory", CSqlInfo).ToString();
                    }
                }
                else
                {
                    if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                    {
                        List <clsSqlParametersInfo> lstSP = new List <clsSqlParametersInfo>();

                        clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                        objInfo.Direction = "Input";
                        objInfo.PName     = "@pID";
                        objInfo.PValue    = id;
                        objInfo.PDBType   = "BigInt";
                        objInfo.PSize     = 200;

                        lstSP.Add(objInfo);

                        clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                        CSqlInfo.objParam = lstSP;
                        try
                        {
                            VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spDeleteCategory", CSqlInfo).ToString();
                        }
                        catch (System.ServiceModel.EndpointNotFoundException e)
                        {
                            VMuktiHelper.ExceptionHandler(e, "DeleteCategory(int Id)", "ClsModuleLogic.cs");
                            VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                            VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spDeleteCategory", CSqlInfo);
                        }
                        catch (System.ServiceModel.CommunicationException e)
                        {
                            VMuktiHelper.ExceptionHandler(e, "DeleteCategory(int Id)", "ClsModuleLogic.cs"); VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                            VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteReturnNonQuery("spDeleteCategory", CSqlInfo).ToString();
                        }
                    }
                    else
                    {
                        ClsCategoryDataService objClsCategoryDataService = new ClsCategoryDataService();
                        objClsCategoryDataService.Delete_Category(id);
                    }
                }
            }
            catch (Exception e)
            {
                VMuktiHelper.ExceptionHandler(e, "DeleteCategory(int Id)", "ClsModuleLogic.cs");
            }
        }
Beispiel #24
0
        public void AddItem(string strCaption, bool ShowImage, ImageType objImageType, string strTag)
        {
            try
            {
                objExpanderItem = new CtlExpanderItem();


                objExpanderItem.HorizontalAlignment = HorizontalAlignment.Stretch;
                objExpanderItem.VerticalAlignment   = VerticalAlignment.Stretch;

                if (objImageType == ImageType.MaleBuddy || objImageType == ImageType.FemaleBuddy)
                {
                    objExpanderItem.AllowDrop = true;
                }

                objExpanderItem.Tag = strTag;


                if (ShowImage)
                {
                    if (objImageType == ImageType.Page)
                    {
                        objExpanderItem.Image = @"\Skins\Images\Page.png";
                    }
                    else if (objImageType == ImageType.Module)
                    {
                        objExpanderItem.Image = @"\Skins\Images1\Skins.png";
                    }
                    else if (objImageType == ImageType.MaleBuddy)
                    {
                        objExpanderItem.Image = @"\Skins\Images\Buddy.Png";
                    }
                    else if (objImageType == ImageType.FemaleBuddy)
                    {
                        objExpanderItem.Image = @"\Skins\Images\FBuddy.Png";
                    }
                }
                else
                {
                    objExpanderItem.Image = "";
                }

                objExpanderItem.Caption = strCaption;

                if (strTag == "offline")
                {
                    objExpanderItem.Image   = @"\Skins\Images\FBuddy.Png";
                    objExpanderItem.ToolTip = strCaption + " is offline";

                    objExpanderItem.PreviewMouseDown -= new System.Windows.Input.MouseButtonEventHandler(objExpanderItem_PreviewMouseDown);
                }
                else if (strTag == "online")
                {
                    objExpanderItem.Image             = @"\Skins\Images\Buddy.Png";
                    objExpanderItem.ToolTip           = strCaption + " is online";
                    objExpanderItem.PreviewMouseDown += new System.Windows.Input.MouseButtonEventHandler(objExpanderItem_PreviewMouseDown);
                }

                objExpanderItem.EntLoadSelectedWid += new CtlExpanderItem.DelLoadSelectedWid(objExpanderItem_EntLoadSelectedWid);

                TreeViewItem objTrviExpanderItem = new TreeViewItem();
                objTrviExpanderItem.HorizontalAlignment         = HorizontalAlignment.Stretch;
                objTrviExpanderItem.VerticalAlignment           = VerticalAlignment.Stretch;
                objTrviExpanderItem.PreviewMouseLeftButtonDown += new MouseButtonEventHandler(objTrviExpanderItem_PreviewMouseLeftButtonDown);
                objTrviExpanderItem.Header = objExpanderItem;


                trvExpanderContent.Items.Add(objTrviExpanderItem);
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "AddItem()", "Controls\\BuddyExplorer\\CtlExpanderContent.xaml.cs");
            }
        }
Beispiel #25
0
        public void fncSendDTMF(string number)
        {
            try
            {
                switch (number)
                {
                case "0":
                    oclient.SendDTMF(RTC_DTMF.RTC_DTMF_0);
                    break;

                case "1":
                    oclient.SendDTMF(RTC_DTMF.RTC_DTMF_1);
                    break;

                case "2":
                    oclient.SendDTMF(RTC_DTMF.RTC_DTMF_2);
                    break;

                case "3":
                    oclient.SendDTMF(RTC_DTMF.RTC_DTMF_3);
                    break;

                case "4":
                    oclient.SendDTMF(RTC_DTMF.RTC_DTMF_4);
                    break;

                case "5":
                    oclient.SendDTMF(RTC_DTMF.RTC_DTMF_5);
                    break;

                case "6":
                    oclient.SendDTMF(RTC_DTMF.RTC_DTMF_6);
                    break;

                case "7":
                    oclient.SendDTMF(RTC_DTMF.RTC_DTMF_7);
                    break;

                case "8":
                    oclient.SendDTMF(RTC_DTMF.RTC_DTMF_8);
                    break;

                case "9":
                    oclient.SendDTMF(RTC_DTMF.RTC_DTMF_9);
                    break;

                case "#":
                    oclient.SendDTMF(RTC_DTMF.RTC_DTMF_POUND);
                    break;

                case "*":
                    oclient.SendDTMF(RTC_DTMF.RTC_DTMF_STAR);
                    break;
                }
            }

            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "fncSendDTMF()", "Audio\\Audio.Business\\RTCAudio.cs");
            }
        }
Beispiel #26
0
        void objTrviExpanderItem_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            try
            {
                CtlExpanderItem ucExpItemTemp = e.Source as CtlExpanderItem;
                Separator       spTemp        = ((CtlExpanderItem)(e.Source)).spWidgets as Separator;
                UniformGrid     ufgTemp       = ((CtlExpanderItem)(e.Source)).ufgWidgets as UniformGrid;

                if (Keyboard.Modifiers == ModifierKeys.Control)
                {
                    if (selectedExItems.ContainsValue(ucExpItemTemp.Caption))
                    {
                        ucExpItemTemp.Background = Brushes.Transparent;
                        selectedExItems.Remove(ucExpItemTemp);
                    }
                    else
                    {
                        ucExpItemTemp.Background = Brushes.DarkBlue;
                        selectedExItems.Add(ucExpItemTemp, ucExpItemTemp.Caption);


                        if (EntWidgetToolBar != null)
                        {
                            EntWidgetToolBar("Show");
                        }
                    }
                    foreach (CtlExpanderItem objExpItem in selectedExItems.Keys)
                    {
                        objExpItem.spWidgets.Visibility  = Visibility.Collapsed;
                        objExpItem.ufgWidgets.Visibility = Visibility.Collapsed;
                        ((Grid)objExpItem.ufgWidgets.Parent).MinHeight = 0.0;
                    }
                }

                else
                {
                    if (EntWidgetToolBar != null)
                    {
                        EntWidgetToolBar("Hide");
                    }
                    if (selectedExItems.Count == 0)
                    {
                        ucExpItemTemp.Background         = Brushes.DarkBlue;
                        spTemp.Visibility                = Visibility.Visible;
                        ufgTemp.Visibility               = Visibility.Visible;
                        ((Grid)ufgTemp.Parent).MinHeight = 80.0;
                        selectedExItems.Add(ucExpItemTemp, ucExpItemTemp.Caption);
                        if (ucExpItemTemp.Tag.ToString() == "offline")
                        {
                            for (int i = 0; i < ufgTemp.Children.Count - 2; i++)
                            {
                                ufgTemp.Children[i].IsEnabled = false;
                                ufgTemp.Children[i].Opacity   = 0.5;
                            }
                        }
                        else
                        {
                            for (int i = 0; i < ufgTemp.Children.Count - 2; i++)
                            {
                                ufgTemp.Children[i].IsEnabled = true;
                                ufgTemp.Children[i].Opacity   = 1;
                            }
                        }
                    }
                    else
                    {
                        if (selectedExItems.Count == 1)
                        {
                            if (selectedExItems.ContainsKey(ucExpItemTemp))
                            {
                                ucExpItemTemp.Background         = Brushes.Transparent;
                                spTemp.Visibility                = Visibility.Collapsed;
                                ufgTemp.Visibility               = Visibility.Collapsed;
                                ((Grid)ufgTemp.Parent).MinHeight = 0.0;
                                selectedExItems.Clear();
                            }
                            else
                            {
                                foreach (CtlExpanderItem objExpItem in selectedExItems.Keys)
                                {
                                    objExpItem.Background            = Brushes.Transparent;
                                    objExpItem.spWidgets.Visibility  = Visibility.Collapsed;
                                    objExpItem.ufgWidgets.Visibility = Visibility.Collapsed;
                                    ((Grid)objExpItem.ufgWidgets.Parent).MinHeight = 0.0;
                                }
                                selectedExItems.Clear();

                                ucExpItemTemp.Background         = Brushes.DarkBlue;
                                spTemp.Visibility                = Visibility.Visible;
                                ufgTemp.Visibility               = Visibility.Visible;
                                ((Grid)ufgTemp.Parent).MinHeight = 80.0;
                                selectedExItems.Add(ucExpItemTemp, ucExpItemTemp.Caption);

                                if (ucExpItemTemp.Tag.ToString() == "offline")
                                {
                                    for (int i = 0; i < ufgTemp.Children.Count - 2; i++)
                                    {
                                        ufgTemp.Children[i].IsEnabled = false;
                                        ufgTemp.Children[i].Opacity   = 0.5;
                                    }
                                }
                                else
                                {
                                    for (int i = 0; i < ufgTemp.Children.Count - 2; i++)
                                    {
                                        ufgTemp.Children[i].IsEnabled = true;
                                        ufgTemp.Children[i].Opacity   = 1;
                                    }
                                }
                            }
                        }

                        else if (selectedExItems.Count > 1)
                        {
                            foreach (CtlExpanderItem objExpItem in selectedExItems.Keys)
                            {
                                objExpItem.Background            = Brushes.Transparent;
                                objExpItem.spWidgets.Visibility  = Visibility.Collapsed;
                                objExpItem.ufgWidgets.Visibility = Visibility.Collapsed;
                                ((Grid)objExpItem.ufgWidgets.Parent).MinHeight = 0.0;
                            }
                            selectedExItems.Clear();

                            ucExpItemTemp.Background         = Brushes.DarkBlue;
                            spTemp.Visibility                = Visibility.Visible;
                            ufgTemp.Visibility               = Visibility.Visible;
                            ((Grid)ufgTemp.Parent).MinHeight = 80.0;
                            selectedExItems.Add(ucExpItemTemp, ucExpItemTemp.Caption);

                            if (ucExpItemTemp.Tag.ToString() == "offline")
                            {
                                for (int i = 0; i < ufgTemp.Children.Count - 2; i++)
                                {
                                    ufgTemp.Children[i].IsEnabled = false;
                                    ufgTemp.Children[i].Opacity   = 0.5;
                                }
                            }
                            else
                            {
                                for (int i = 0; i < ufgTemp.Children.Count - 2; i++)
                                {
                                    ufgTemp.Children[i].IsEnabled = true;
                                    ufgTemp.Children[i].Opacity   = 1;
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "objTrviExpanderItem_PreviewMouseLeftButtonDown()", "Controls\\BuddyExplorer\\CtlExpanderContent.xaml.cs");
            }
        }
Beispiel #27
0
        //To save new Record
        private void btnGroupSave_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            try
            {
                //Validations for group
                #region GroupName Validation
                if (txtName.Text.Trim() == "")
                {
                    MessageBox.Show("Group Name Can't be left Blank ", "-> Please Enter a Name", MessageBoxButton.OK, MessageBoxImage.Information);
                    txtName.Focus();
                    txtName.Text = txtName.Text.Trim();
                    return;
                }

                #endregion


                string strUsers = "";

                for (int i = 0; i < lstSelectedAgents.Items.Count; i++)
                {
                    if (i == 0)
                    {
                        strUsers = ((ListBoxItem)lstSelectedAgents.Items[i]).Tag.ToString();
                    }
                    else
                    {
                        strUsers = strUsers + "," + ((ListBoxItem)lstSelectedAgents.Items[i]).Tag.ToString();
                    }
                }

                int      GetId = 0;
                ClsGroup c     = new ClsGroup();

                if (varState == 0)
                {
                    c.ID = -1;
                }
                else
                {
                    c.ID = varID;
                }

                c.GroupName   = txtName.Text.Trim();
                c.Description = txtDescription.Text.Trim();
                c.IsActive    = (bool)chkIsActive.IsChecked;
                c.CreatedBy   = VMuktiAPI.VMuktiInfo.CurrentPeer.ID;
                //Function to save new record
                int gID = c.Save();

                if (gID == 0)
                {
                    MessageBox.Show("User Group With Same Name is Not Allowed", "-> User Group", MessageBoxButton.OK, MessageBoxImage.Information);
                }

                else
                {
                    if (varState != 0)
                    {
                        ClsUser u1 = new ClsUser();
                        u1.ID = gID;
                        u1.Delete();
                    }

                    for (int i = 0; i < lstSelectedAgents.Items.Count; i++)
                    {
                        ClsUser u = new ClsUser();
                        u.ID = int.Parse(((ListBoxItem)lstSelectedAgents.Items[i]).Tag.ToString());
                        //u.AgentName = ((ListBoxItem)lstSelectedAgents.Items[i]).Content.ToString();
                        u.GroupId = gID;
                        //Function to Save record in usergroup
                        u.Save();
                    }

                    System.Windows.MessageBox.Show("Record Saved Successfully!!");
                    FncClearAll();
                    //set data in grid
                    funSetGrid();
                    //set data in listboxes
                    funSetComboboxes();
                }
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "btnGroupSave_Click", "ctlUserGroup.xaml.cs");
            }
        }
Beispiel #28
0
        void menuItem1_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (selectedExItems != null)
                {
                    MessageBoxResult msgResult = MessageBox.Show("Are you sure to remove selected buddies from your buddylist", "Remove Buddy", MessageBoxButton.YesNo, MessageBoxImage.Question);
                    if (msgResult == MessageBoxResult.Yes)
                    {
                        List <string> lstBuddiesName = new List <string>();
                        foreach (KeyValuePair <CtlExpanderItem, string> kvp in selectedExItems)
                        {
                            lstBuddiesName.Add(kvp.Value);
                            for (int i = 0; i < trvExpanderContent.Items.Count; i++)
                            {
                                if (kvp.Value == ((CtlExpanderItem)((TreeViewItem)trvExpanderContent.Items[i]).Header).Caption.ToString())
                                {
                                    trvExpanderContent.Items.RemoveAt(i);
                                }
                            }
                            // trvExpanderContent.Items.Remove(kvp.Key);
                        }
                        try
                        {
                            App.chHttpBootStrapService.svcHttpRemoveBuddy(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName, lstBuddiesName);
                        }
                        catch (System.ServiceModel.EndpointNotFoundException ex)
                        {
                            VMuktiHelper.ExceptionHandler(ex, "menuItem1_Click()--1", "Controls\\BuddyExplorer\\CtlExpanderContent.xaml.cs");
                            VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                            App.chHttpBootStrapService.svcHttpRemoveBuddy(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName, lstBuddiesName);
                        }
                        catch (System.ServiceModel.CommunicationException ex)
                        {
                            VMuktiHelper.ExceptionHandler(ex, "menuItem1_Click()--2", "Controls\\BuddyExplorer\\CtlExpanderContent.xaml.cs");
                            VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                            App.chHttpBootStrapService.svcHttpRemoveBuddy(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName, lstBuddiesName);
                        }

                        try
                        {
                            App.chHttpSuperNodeService.RemoveBuddies(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName, lstBuddiesName);
                        }
                        catch (System.ServiceModel.EndpointNotFoundException ex)
                        {
                            VMuktiHelper.ExceptionHandler(ex, "menuItem1_Click()--3", "Controls\\BuddyExplorer\\CtlExpanderContent.xaml.cs");
                            VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                            App.chHttpSuperNodeService.RemoveBuddies(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName, lstBuddiesName);
                        }
                        catch (System.ServiceModel.CommunicationException ex)
                        {
                            VMuktiHelper.ExceptionHandler(ex, "menuItem1_Click()--4", "Controls\\BuddyExplorer\\CtlExpanderContent.xaml.cs");
                            VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                            App.chHttpSuperNodeService.RemoveBuddies(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName, lstBuddiesName);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "menuItem1_Click()--5", "Controls\\BuddyExplorer\\CtlExpanderContent.xaml.cs");
            }
        }
Beispiel #29
0
        public static ClsBuddyReqCollection GetByUserID(int UserID)
        {
            ClsBuddyReqCollection obj = new ClsBuddyReqCollection();

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

                clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                objInfo.Direction = "Input";
                objInfo.PName     = "@pID";
                objInfo.PValue    = -1;
                objInfo.PDBType   = "BigInt";
                objInfo.PSize     = 200;

                clsSqlParametersInfo objInfo2 = new clsSqlParametersInfo();
                objInfo2.Direction = "Input";
                objInfo2.PName     = "@pUserID";
                objInfo2.PValue    = UserID;
                objInfo2.PDBType   = "BigInt";
                objInfo2.PSize     = 200;

                lstSP.Add(objInfo);
                lstSP.Add(objInfo2);

                clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                CSqlInfo.objParam = lstSP;


                try
                {
                    obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGBuddyRequest", CSqlInfo).dsInfo);
                }
                catch (System.ServiceModel.EndpointNotFoundException e)
                {
                    VMuktiHelper.ExceptionHandler(e, "GetByUserID(int UserID)", "ClsBuddyReqCollection.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                    obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGBuddyRequest", CSqlInfo).dsInfo);
                }
                catch (System.ServiceModel.CommunicationException e)
                {
                    VMuktiHelper.ExceptionHandler(e, "GetByUserID(int UserID)", "ClsBuddyReqCollection.cs");
                    VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                    obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGBuddyRequest", CSqlInfo).dsInfo);
                }
            }
            else
            {
                if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == VMuktiAPI.PeerType.NodeWithHttp)
                {
                    List <clsSqlParametersInfo> lstSP = new List <clsSqlParametersInfo>();

                    clsSqlParametersInfo objInfo = new clsSqlParametersInfo();
                    objInfo.Direction = "Input";
                    objInfo.PName     = "@pID";
                    objInfo.PValue    = -1;
                    objInfo.PDBType   = "BigInt";
                    objInfo.PSize     = 200;

                    clsSqlParametersInfo objInfo2 = new clsSqlParametersInfo();
                    objInfo2.Direction = "Input";
                    objInfo2.PName     = "@pUserID";
                    objInfo2.PValue    = UserID;
                    objInfo2.PDBType   = "BigInt";
                    objInfo2.PSize     = 200;

                    lstSP.Add(objInfo);
                    lstSP.Add(objInfo2);

                    clsSqlParameterContract CSqlInfo = new clsSqlParameterContract();
                    CSqlInfo.objParam = lstSP;


                    try
                    {
                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGBuddyRequest", CSqlInfo).dsInfo);
                    }
                    catch (System.ServiceModel.EndpointNotFoundException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "GetByUserID(int UserID)", "ClsBuddyReqCollection.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGBuddyRequest", CSqlInfo).dsInfo);
                    }
                    catch (System.ServiceModel.CommunicationException e)
                    {
                        VMuktiHelper.ExceptionHandler(e, "GetByUserID(int UserID)", "ClsBuddyReqCollection.cs");
                        VMuktiAPI.VMuktiHelper.CallEvent("GetSuperNodeIP", null, null);
                        obj.MapObjects(VMukti.Business.clsDataBaseChannel.chHttpDataBaseService.svcExecuteDataSet("spGBuddyRequest", CSqlInfo).dsInfo);
                    }
                }
                else
                {
                    obj.MapObjects(new VMukti.DataAccess.ClsBuddyReqDataService().BuddyReq_GetByUserID(UserID));
                }
            }
            return(obj);
        }
Beispiel #30
0
        ////////////////////////////////////////////////////////////////////////
        // CreateParameter Methods
        ////////////////////////////////////////////////////////////////////////
        protected static SqlParameter CreateParameter(string paramName,
                                                      SqlDbType paramType, object paramValue)
        {
            try
            {
                SqlParameter param = new SqlParameter(paramName, paramType);

                if (paramValue != DBNull.Value)
                {
                    switch (paramType)
                    {
                    case SqlDbType.VarChar:
                    case SqlDbType.NVarChar:
                    case SqlDbType.Char:
                    case SqlDbType.NChar:
                    case SqlDbType.Text:
                        paramValue = CheckParamValue((string)paramValue);
                        break;

                    case SqlDbType.DateTime:
                        paramValue = CheckParamValue((DateTime)paramValue);
                        break;

                    case SqlDbType.Int:
                        paramValue = CheckParamValue((int)paramValue);
                        break;

                    case SqlDbType.UniqueIdentifier:
                        paramValue = CheckParamValue(GetGuid(paramValue));
                        break;

                    case SqlDbType.Bit:
                        if (paramValue is bool)
                        {
                            paramValue = (int)((bool)paramValue ? 1 : 0);
                        }
                        if ((int)paramValue < 0 || (int)paramValue > 1)
                        {
                            paramValue = Common.ClsConstants.NullInt;
                        }
                        paramValue = CheckParamValue((int)paramValue);
                        break;

                    case SqlDbType.Float:
                        paramValue = CheckParamValue(Convert.ToSingle(paramValue));
                        break;

                    case SqlDbType.Decimal:
                        paramValue = CheckParamValue((decimal)paramValue);
                        break;
                    }
                }
                param.Value = paramValue;
                return(param);
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "CreateParameter(string,...", "clsRecordingDataServiceBase");
                return(null);
            }
        }