コード例 #1
0
 public void SaveTransaction(TaskCard taskCard, int id)
 {
     sip        = new FinancialPlanner.Common.JSONSerialization().DeserializeFromString <SIP>(taskCard.TaskTransactionType.ToString());
     sip.TaskId = id;
     DataBase.DBService.ExecuteCommandString(string.Format(INSERT_SIP,
                                                           sip.TaskId,
                                                           sip.CID,
                                                           sip.MemberName,
                                                           sip.SecondHolder,
                                                           sip.ThirdHolder,
                                                           sip.Nominee,
                                                           sip.Guardian,
                                                           sip.AMC,
                                                           sip.FolioNo,
                                                           sip.SchemeId,
                                                           sip.Option,
                                                           sip.Amount,
                                                           sip.AccounType,
                                                           sip.SIPDayOn,
                                                           sip.TransactionDate.ToString("yyyy-MM-dd hh:mm:ss"),
                                                           sip.SIPStartDate.ToString("yyyy-MM-dd hh:mm:ss"),
                                                           sip.SIPEndDate.ToString("yyyy-MM-dd hh:mm:ss"),
                                                           sip.ModeOfExecution,
                                                           sip.Remark), true);
 }
コード例 #2
0
        private SIP converToSIP(DataRow dr)
        {
            SIP sip = new SIP();

            sip.Id              = dr.Field <int>("ID");
            sip.TaskId          = dr.Field <int>("TaskId");
            sip.CID             = dr.Field <int>("CID");
            sip.MemberName      = dr.Field <string>("MemberName");
            sip.SecondHolder    = dr.Field <string>("SecondHolder");
            sip.ThirdHolder     = dr.Field <string>("ThirdHolder");
            sip.Nominee         = dr.Field <string>("Nominee");
            sip.Guardian        = dr.Field <string>("Guardian");
            sip.AMC             = dr.Field <int>("AMC");
            sip.FolioNo         = dr.Field <string>("FolioNumber");
            sip.SchemeId        = dr.Field <int>("SchemeId");
            sip.Option          = dr.Field <string>("Option");
            sip.Amount          = dr.Field <long>("Amount");
            sip.AccounType      = dr.Field <string>("AccountType");
            sip.SIPDayOn        = dr.Field <int>("SIPDate");
            sip.TransactionDate = dr.Field <DateTime>("TransactionDate");
            sip.SIPStartDate    = dr.Field <DateTime>("SIPStartDate");
            sip.SIPEndDate      = dr.Field <DateTime>("SIPEndDate");
            sip.ModeOfExecution = dr.Field <string>("ModeOfExecution");
            sip.Remark          = dr.Field <string>("Remark");
            return(sip);
        }
コード例 #3
0
        public SipAccount(ISip sip)
        {
            _sip = (SIP)sip;
            _valueChangedCallback = RaiseEventCallback <ISipAccount>;

            _sip.SipekResources.Registrar.AccountStateChanged += OnAccountStateChanged;
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: mtenpow/tenpow.com
 static void StartTests()
 {
     SIP testsSIP = new SIP(new ThreadStart(delegate()
     {
         Logging.Log("Starting System.Net.Tests");
         RunTests();
     }), ThreadPriority.Normal, "System.Net.Tests");
     testsSIP.Exited += delegate(object sender, EventArgs e)
     {
         Logging.Log("System.Net.Tests exited");
     };
     testsSIP.Start();
 }
コード例 #5
0
ファイル: Program.cs プロジェクト: mtenpow/tenpow.com
 static void StartProcessViewer()
 {
     SIP processViewerSIP = new SIP(new ThreadStart(delegate()
     {
         Logging.Log("Starting Process Viewer");
         new ProcessViewer().Start();
     }), ThreadPriority.Normal, "Process Viewer");
     processViewerSIP.Exited += delegate(object sender, EventArgs e)
     {
         Logging.Log("Process Viewer exited");
     };
     processViewerSIP.Start();
 }
コード例 #6
0
ファイル: TestRunner.cs プロジェクト: sidecut/xaeios
 private static void RunTestSuite()
 {
     SIP testSuiteSIP = new SIP(delegate()
     {
         Logging.Info("Starting XaeiOS.TestSuite");
         RunTests();
     }, ThreadPriority.Normal, "XaeiOS.TestSuite");
     testSuiteSIP.Exited += delegate(object sender, EventArgs e)
     {
         Logging.Info("XaeiOS.TestSuite process exited");
     };
     testSuiteSIP.Start();
 }
コード例 #7
0
ファイル: TestRunner.cs プロジェクト: sidecut/xaeios
 private static void RunProcessViewer()
 {
     SIP processViewerSIP = new SIP(delegate()
     {
         Logging.Info("Starting Process Viewer");
         ProcessViewer.ProcessViewer processViewer = new ProcessViewer.ProcessViewer();
         processViewer.UpdateInterval = 2000;
         processViewer.Start();
     }, ThreadPriority.Normal, "Process Viewer");
     processViewerSIP.Exited += delegate(object sender, EventArgs e)
     {
         Logging.Info("Process Viewer exited");
     };
     processViewerSIP.Start();
 }
コード例 #8
0
        private static bool UpdateSipConfigFiles()
        {
            ConfigParams cfgs = new ConfigParams();

            cfgs.LoadFromTableByComponent(ConfigParams.e_Components.SIP.ToString());

            if (0 == cfgs.Count)
            {
                Console.Error.WriteLine("ERROR: Unable to generate SIP configuration files - couldn't load SIP settings from database.");
                return(false);
            }

            ConfigParams cfgs2 = new ConfigParams();

            cfgs2.LoadFromTableByComponent(ConfigParams.e_Components.SIP2.ToString());

            if (0 == cfgs2.Count)
            {
                Console.Error.WriteLine("ERROR: Unable to generate SIP configuration files - couldn't load SIP2 settings from database.");
                return(false);
            }
            else
            {
                cfgs.Add(GetPbxValue(cfgs2));
            }

            ConfigParams cfgs3 = new ConfigParams();

            cfgs3.LoadFromTableByComponent(ConfigParams.e_Components.SIP3.ToString());

            if (0 == cfgs3.Count)
            {
                Console.Error.WriteLine("ERROR: Unable to generate SIP configuration files - couldn't load SIP3 settings from database.");
                return(false);
            }
            else
            {
                foreach (ConfigParams.ConfigParam cfg in cfgs3)
                {
                    cfgs.Add(cfg);
                }
            }

            SIP sip = new SIP();

            return(sip.Persist(cfgs, g_sConfigPath));
        }         // UpdateSipConfigFiles
コード例 #9
0
ファイル: Program.cs プロジェクト: mtenpow/tenpow.com
        private static void Main(string[] args)
        {
            SIP slideshowProcess = new SIP(delegate()
            {
                Photo[] photos = new Photo[]{
                    new Photo("Photos/michaelten-pow.jpg", "My two sisters, Kaya and Alicia, and me"),
                    new Photo("Photos/lounging_at_pool.jpg", "Lounging by the pool at the Planet Hollywood Hotel, Las Vegas"),
                    new Photo("Photos/coaster.jpg", "Autumn and me on the roller coaster at New York, New York, Las Vegas"),
                    new Photo("Photos/just_michael.jpg", "Just me"),
                    new Photo("Photos/paris_vegas.jpg", "Autumn and me at Paris, Las Vegas"),
                    new Photo("Photos/checking_in.jpg", "Checking into the Planet Hollywood Hotel, Las Vegas"),
                    new Photo("Photos/autumn_and_michael.jpg", "Autumn and me"),
                    new Photo("Photos/wii_at_earls.jpg", "Playing Wii Sports Golf at Earl's house"),
                    new Photo("Photos/packed_jeep.jpg", "My Jeep packed full of my cousin Michelle's belongings.  I was helping her move.")
                };

                _slideshow = new PhotoSlideshow(photos, 10 * 1000);
                SignalDaemon.Start();
                ExportDelegate("ShowNextPhoto", ExportedShowNextPhoto);
                ExportDelegate("ShowPreviousPhoto", ExportedShowPreviousPhoto);
                _slideshow.ShowPhoto(0);
                _slideshow.StartSlideshow();
            }, ThreadPriority.Normal, "Tenpow.Photos");

            // install a custom signal handler to call the appropriate method based upon the SlideshowSignal that we receive
            slideshowProcess.CustomSignal += delegate(int data)
            {
                SlideshowSignal signal = (SlideshowSignal)data;
                if (signal == SlideshowSignal.ShowNextPhoto)
                {
                    _slideshow.ShowNextPhoto();
                }
                else if (signal == SlideshowSignal.ShowPreviousPhoto)
                {
                    _slideshow.ShowPreviousPhoto();
                }
                else
                {
                    Console.WriteLine("Received unknown signal " + data);
                }
            };
            slideshowProcess.Start();
            _slideshowPid = slideshowProcess.ID;
        }
コード例 #10
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                MySqlConnection con = null;
                try
                {
                    string conStr = "SERVER=" + SIP.Text + ";" + "DATABASE=" +
                                    DBN.Text + ";" + "UID=" + UN.Text + ";" + "PASSWORD="******";";
                    con = new MySqlConnection(conStr);
                    con.Open(); //open the connection
                    MessageBox.Show("Connected Success!");
                    CMD_OK.Enabled    = true;
                    groupBox2.Enabled = false;
                    CMD_OK.Focus();

                    //Show station
                    lounge_site.DataSource = siteDao.SelectAdhoc(conStr);
                }
                catch (MySqlException err) //We will capture and display any MySql errors that will occur
                {
                    MessageBox.Show("Error: " + err.ToString());
                }
                finally
                {
                    if (con != null)
                    {
                        con.Close(); //safely close the connection
                    }
                } //remember to safely close the connection after accessing the database
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                MessageBox.Show("Conect Fail!");
                SIP.Focus();
            }
        }
コード例 #11
0
        public object GetTransaction(int id)
        {
            try
            {
                Logger.LogInfo("Get: SIP transaction process start");
                sip = new SIP();

                DataTable dtAppConfig = DataBase.DBService.ExecuteCommand(string.Format(SELECT_BY_ID, id));
                foreach (DataRow dr in dtAppConfig.Rows)
                {
                    sip = converToSIP(dr);
                }
                Logger.LogInfo("Get: SIP transaction process completed.");
                return(sip);
            }
            catch (Exception ex)
            {
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                MethodBase currentMethodName = sf.GetMethod();
                LogDebug(currentMethodName.Name, ex);
                return(null);
            }
        }
コード例 #12
0
 private void button2_Click(object sender, EventArgs e)
 {
     Cursor = Cursors.WaitCursor;
     if (ManageLOG.Formula(textBox1.Text + textBox2.Text + textBox3.Text + textBox4.Text))
     {
         pictureBox2.Image = Properties.Resources.CT;
         groupBox2.Enabled = true;
         textBox1.Enabled  = false;
         textBox2.Enabled  = false;
         textBox3.Enabled  = false;
         textBox4.Enabled  = false;
         SIP.Focus();
     }
     else
     {
         pictureBox2.Image = Properties.Resources.CF;
         groupBox2.Enabled = false;
         textBox1.Enabled  = true;
         textBox2.Enabled  = true;
         textBox3.Enabled  = true;
         textBox4.Enabled  = true;
     }
     Cursor = Cursors.Default;
 }
コード例 #13
0
ファイル: BootManager.cs プロジェクト: sidecut/xaeios
 private static void CreateInitProcess()
 {
     SIP initProcess = new SIP(new ThreadStart(InvokeStaticConstructorsAndCallInitFunction), ThreadPriority.Normal, "XaeiOS.Init");
     initProcess.Exited += delegate(object sender, EventArgs e)
     {
         // TODO: What to do when init process exits? probably nothing. Maybe there should be a shutdown process that takes care of cleaning everything up
         Logging.Info("Process " + initProcess + " exited");
     };
     initProcess.Start(true);
     _booted = true;
 }
コード例 #14
0
        }         // StartWorkerThread

        protected static bool CheckIPAutoSave(ILegacyLogger i_Logger)
        {
            // FIX - As with the constants in GetPbxValue(), these constants should be pulled out.
            const string csProxyServer  = "SpeechBridge SIP Proxy";
            const string csAudiomgrAddr = "AudioMgr IP address";

            bool   bRet = true, bRes = true;
            string sCheck = "", sPath = "", sCurrAddr = "";

            System.Net.IPHostEntry tmpIpHost = null;
            System.Net.IPAddress[] tmpIpAddrs = null;
            string[] asAddrs = null;
            int      ii = 0, iNumAddrs = 0;

            ConfigParams cfgs = null;

            SBConfigStor.SIP sipTmp = null;
            int    iNumElems = 0;
            string sProxyAddr = "", sAMAddr = "";

            try
            {
                sCheck = ConfigurationManager.AppSettings["CheckIpOnStartup"];
                if ((sCheck == null) || (sCheck.Length == 0) || (sCheck.ToLower() == false.ToString().ToLower()))
                {
                    // Default or 'false' is to do nothing.
                    i_Logger.Log(Level.Info, "CheckIPAutoSave - Not checking/saving IP address.");
                }
                else
                {
                    // Get current IP address and compare it against what is stored in the DB.
                    tmpIpHost  = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName());
                    tmpIpAddrs = tmpIpHost.AddressList;
                    iNumAddrs  = tmpIpAddrs.Length;

                    asAddrs = new string[iNumAddrs];
                    for (ii = 0; ii < iNumAddrs; ii++)
                    {
                        asAddrs[ii] = tmpIpAddrs[ii].ToString();
                    }
                    sCurrAddr = asAddrs[0];                             // FIX - Assumes active NIC is 1'st one

                    cfgs = new ConfigParams();
                    cfgs.LoadFromTableByComponent(ConfigParams.e_Components.SIP.ToString());
                    iNumElems = cfgs.Count;
                    if (iNumElems <= 0)
                    {
                        i_Logger.Log(Level.Exception, "SBLocalRM.CheckIPAutoSave Couldn't load settings from DB.");
                    }
                    else
                    {
                        sProxyAddr = cfgs[csProxyServer].Value;
                        sAMAddr    = cfgs[csAudiomgrAddr].Value;

                        // If address is different, save it to SIP Proxy and AudioMgr values, and save config files.
                        if ((sCurrAddr != sProxyAddr) || (sCurrAddr != sAMAddr))
                        {
                            sPath = ConfigurationManager.AppSettings["DefaultConfigPath"];
                            cfgs[csProxyServer].Value  = sCurrAddr;
                            cfgs[csAudiomgrAddr].Value = sCurrAddr;
                            bRes = cfgs.SaveToTableByComponent(ConfigParams.e_Components.SIP.ToString());
                            if (!bRes)
                            {
                                i_Logger.Log(Level.Exception, "SBLocalRM.CheckIPAutoSave Error saving settings to DB.");
                            }
                            else
                            {
                                i_Logger.Log(Level.Info, "CheckIPAutoSave Saved settings to DB.");
                            }


                            // Get the PBX Type information and append it to the other configuration data before
                            // regenerating the configuration files for the Proxy Server and the Audio Routers.
                            //
                            // NOTE: This code is very similar to what exists in ServerSettings.aspx.cs (m_buttonUpdate_Click())
                            //       so it should be refactored to a common location.
                            //       Also, as per the comment in ServerSettings.aspx.cs, if more elements are added to SIP2 then
                            //       those will also have to be added to the configuration data passed to SIP.Persist().

                            ConfigParams cfgs2 = new ConfigParams();
                            cfgs2.LoadFromTableByComponent(ConfigParams.e_Components.SIP2.ToString());
                            cfgs.Add(GetPbxValue(cfgs2));

                            // Get the load-balancing/failover information and append it to the other configuration data before
                            // regenerating the configuration files for the Proxy Server and the Audio Routers.

                            ConfigParams cfgs3 = new ConfigParams();
                            cfgs3.LoadFromTableByComponent(ConfigParams.e_Components.SIP3.ToString());

                            foreach (ConfigParams.ConfigParam cfg in cfgs3)
                            {
                                cfgs.Add(cfg);
                            }

                            sipTmp = new SIP();
                            bRes   = sipTmp.Persist(cfgs, sPath);
                            if (!bRes)
                            {
                                i_Logger.Log(Level.Exception, "SBLocalRM.CheckIPAutoSave Error saving settings to config files.");
                            }
                            else
                            {
                                i_Logger.Log(Level.Info, "CheckIPAutoSave Saved settings to config files.");
                            }

                            // Write addr to /etc/hosts, hostname to /etc/sysconfig/network
                        }
                        else
                        {
                            i_Logger.Log(Level.Info, "CheckIPAutoSave - IP addresses matched.");
                        }
                    }
                }
            }
            catch (Exception exc)
            {
                i_Logger.Log(Level.Exception, "SBLocalRM.CheckIPAutoSave caught exception: " + exc.ToString());
                bRet = false;
            }

            return(bRet);
        }         // CheckIPAutoSave
コード例 #15
0
 protected void setupSIP()
 {
     // enable Tap n' Hold & auto SIP for SensePanelTextboxItem(s)
     SIP.Enable(this.senseListCtrl.Handle);
     this.sip.EnabledChanged += new EventHandler(sip_EnabledChanged);
 }