Пример #1
0
        public override void OnShow()
        {
            base.OnShow();

            _PartyModeInfos = CParty.GetPartyModeInfos();

            _SelectSlides[_SelectSlideModes].Clear();
            foreach (SPartyModeInfos info in _PartyModeInfos)
            {
                _SelectSlides[_SelectSlideModes].AddValue(info.Name, info.ExtInfo.ID);
            }
            _SelectSlides[_SelectSlideModes].Selection = 0;
            _UpdateSelection();

            _SelectElement(_SelectSlides[_SelectSlideModes]);
        }
Пример #2
0
        private void lvParty_DoubleClick(object sender, EventArgs e)
        {
            CParty oParty = lvParty.FocusedItem.Tag as CParty;

            txtOId.Text            = oParty.Party_OID;
            txtPartyName.Text      = oParty.Party_Name;
            txtAddress.Text        = oParty.Party_Address;
            txtCity.Text           = oParty.Party_City;
            txtCountry.Text        = oParty.Party_Country;
            txtPhone.Text          = oParty.Party_Phone;
            txtMobile.Text         = oParty.Party_Mobile;
            txtEmail.Text          = oParty.Party_Email;
            txtContactPerson1.Text = oParty.Party_ContactPerson1;
            txtPhone1.Text         = oParty.Party_Phone1;
            txtContactPerson2.Text = oParty.Party_Contactperson2;
            txtPhone2.Text         = oParty.Party_Phone2;
        }
Пример #3
0
        public CResult Delete(CParty oParty)
        {
            oResult = new CResult();
            conn    = oConnManager.GetConnection(out s_DBError);
            if (conn != null)
            {
                SqlCommand cmd = new SqlCommand();
                cmd.Connection = conn;

                cmd.Transaction = oConnManager.BeginTransaction();
                try
                {
                    cmd.CommandText = "sp_Party_Delete";
                    cmd.CommandType = CommandType.StoredProcedure;

                    cmd.Parameters.AddWithValue("@Party_OID", oParty.Party_OID);
                    cmd.Parameters.Add("@IsSuccess", SqlDbType.Char, 1);
                    cmd.Parameters["@IsSuccess"].Direction = ParameterDirection.ReturnValue;
                    cmd.ExecuteNonQuery();
                    string st = cmd.Parameters["@IsSuccess"].Value.ToString();

                    oConnManager.Commit();
                    oResult.Data      = st;
                    oResult.IsSuccess = true;
                }
                catch (SqlException e)
                {
                    string sRollbackError = oConnManager.Rollback();

                    oResult.IsSuccess = false;
                    oResult.ErrMsg    = sRollbackError.Equals("") ? oConnManager.GetErrorMessage(e) : sRollbackError;
                }
                finally
                {
                    oConnManager.Close();
                }
            }
            else
            {
                oResult.IsSuccess = false;
                oResult.ErrMsg    = s_DBError;
            }

            return(oResult);
        }
Пример #4
0
        public override bool HandleInput(SKeyEvent keyEvent)
        {
            base.HandleInput(keyEvent);

            if (!keyEvent.KeyPressed)
            {
                switch (keyEvent.Key)
                {
                case Keys.Escape:
                case Keys.Back:
                    _SaveConfig();
                    CGraphics.FadeTo(EScreen.Options);
                    break;

                case Keys.S:
                    CParty.SetNormalGameMode();
                    _SaveConfig();
                    CGraphics.FadeTo(EScreen.Song);
                    break;

                case Keys.Enter:
                    if (_Buttons[_ButtonExit].Selected)
                    {
                        _SaveConfig();
                        CGraphics.FadeTo(EScreen.Options);
                    }
                    else if (_Buttons[_ButtonServer].Selected)
                    {
                        CGraphics.ShowPopup(EPopupScreens.PopupServerQR);
                    }
                    break;

                case Keys.Left:
                    _SaveConfig();
                    break;

                case Keys.Right:
                    _SaveConfig();
                    break;
                }
            }
            return(true);
        }
Пример #5
0
 private CParty GetFormData(CParty oParty)
 {
     oParty.Party_Branch         = currentBranch.CompBrn_Code;
     oParty.Party_Name           = txtPartyName.Text.Trim();
     oParty.Party_Address        = txtAddress.Text.Trim();
     oParty.Party_City           = txtCity.Text.Trim();
     oParty.Party_Country        = txtCountry.Text.Trim();
     oParty.Party_Phone          = txtPhone.Text.Trim();
     oParty.Party_Mobile         = txtMobile.Text.Trim();
     oParty.Party_Email          = txtEmail.Text.Trim();
     oParty.Party_ContactPerson1 = txtContactPerson1.Text.Trim();
     oParty.Party_Phone1         = txtPhone1.Text.Trim();
     oParty.Party_Contactperson2 = txtContactPerson2.Text.Trim();
     oParty.Party_Phone2         = txtPhone2.Text.Trim();
     oParty.Creator      = currentUser.User_OID;
     oParty.CreationDate = DateTime.Now;
     oParty.UpdateBy     = currentUser.User_OID;
     oParty.UpdateDate   = DateTime.Now;
     return(oParty);
 }
Пример #6
0
        private void _StartPartyMode()
        {
            if (_PartyModeInfos.Count == 0)
            {
                return;
            }

            int index = _SelectSlides[_SelectSlideModes].Selection;

            if (index >= _PartyModeInfos.Count)
            {
                _Buttons[_ButtonStart].Visible = false;
                _Texts[_TextError].Text        = "TR_SCREENPARTY_ERROR";
                _Texts[_TextError].Visible     = true;
                return;
            }

            CParty.SetPartyMode(_PartyModeInfos[index].ExtInfo.ID);
            CGraphics.FadeTo(CParty.GetStartScreen());
        }
Пример #7
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            CParty   oParty   = lvParty.FocusedItem.Tag as CParty;
            CPartyBO oPartyBO = new CPartyBO();
            CResult  oResult  = new CResult();

            if (validatedata())
            {
                oResult = oPartyBO.Update(GetFormData(oParty));
                if (oResult.IsSuccess)
                {
                    MessageBox.Show("Update successfully");
                }
                else
                {
                    MessageBox.Show("Not Updated" + oResult.ErrMsg + "");
                }
                ClearControl(groupBox4);
                LoadParty();
            }
        }
Пример #8
0
        public override bool HandleInput(SKeyEvent keyEvent)
        {
            base.HandleInput(keyEvent);

            if (keyEvent.KeyPressed)
            {
            }
            else
            {
                switch (keyEvent.Key)
                {
                case Keys.Escape:
                case Keys.Back:
                    _Close();
                    break;

                case Keys.S:
                    CParty.SetNormalGameMode();
                    _SaveConfig();
                    CGraphics.FadeTo(EScreen.Song);
                    break;

                case Keys.Enter:
                    if (_Buttons[_ButtonExit].Selected)
                    {
                        _Close();
                    }
                    break;

                case Keys.Left:
                    _OnChange();
                    break;

                case Keys.Right:
                    _OnChange();
                    break;
                }
            }
            return(true);
        }
Пример #9
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            CParty   oParty   = new CParty();
            CPartyBO oPartyBO = new CPartyBO();
            CResult  oResult  = new CResult();

            if (validatedata())
            {
                oResult = oPartyBO.Create(GetFormData(oParty));
                if (oResult.IsSuccess)
                {
                    MessageBox.Show("Saved successfully");
                }
                else
                {
                    //MessageBox.Show(oResult.ErrMsg);
                    MessageBox.Show("Not Saved" + oResult.ErrMsg + "");
                }
                ClearControl(groupBox4);
                LoadParty();
            }
        }
Пример #10
0
        private CParty GetResultSetToParty(DataRow dr)
        {
            CParty oParty = new CParty();

            oParty.Party_OID            = dr[0].ToString();
            oParty.Party_Branch         = dr[1].ToString();
            oParty.Party_Name           = dr[2].ToString();
            oParty.Party_Address        = dr[3].ToString();
            oParty.Party_City           = dr[4].ToString();
            oParty.Party_Country        = dr[5].ToString();
            oParty.Party_Phone          = dr[6].ToString();
            oParty.Party_Mobile         = dr[7].ToString();
            oParty.Party_Email          = dr[8].ToString();
            oParty.Party_ContactPerson1 = dr[9].ToString();
            oParty.Party_Phone1         = dr[10].ToString();
            oParty.Party_Contactperson2 = dr[11].ToString();
            oParty.Party_Phone2         = dr[12].ToString();
            oParty.Creator      = dr[13].ToString();
            oParty.CreationDate = DateTime.Parse(dr[14].ToString());
            oParty.UpdateBy     = dr[15].ToString();
            oParty.UpdateDate   = DateTime.Parse(dr[16].ToString());
            return(oParty);
        }
Пример #11
0
        public override bool HandleInput(SKeyEvent keyEvent)
        {
            base.HandleInput(keyEvent);

            if (keyEvent.KeyPressed)
            {
            }
            else
            {
                switch (keyEvent.Key)
                {
                case Keys.Escape:
                case Keys.Back:
                    _SaveConfig();
                    CGraphics.FadeTo(EScreen.Options);
                    break;

                case Keys.S:
                    CParty.SetNormalGameMode();
                    _SaveConfig();
                    CGraphics.FadeTo(EScreen.Song);
                    break;

                case Keys.Enter:
                    if (_Buttons[_ButtonExit].Selected)
                    {
                        _SaveConfig();
                        CGraphics.FadeTo(EScreen.Options);
                    }
                    else if (_Buttons[_ButtonScreenAdjustments].Selected)
                    {
                        _SaveConfig();
                        CGraphics.FadeTo(EScreen.OptionsVideoAdjustments);
                    }
                    break;

                case Keys.Left:
                    if (_SelectSlides[_SelectSlideWebcamDevices].Selected)
                    {
                        _OnDeviceEvent();
                    }
                    if (_SelectSlides[_SelectSlideWebcamCapabilities].Selected)
                    {
                        _OnCapabilitiesEvent();
                    }
                    _SaveConfig();
                    break;

                case Keys.Right:
                    if (_SelectSlides[_SelectSlideWebcamDevices].Selected)
                    {
                        _OnDeviceEvent();
                    }
                    if (_SelectSlides[_SelectSlideWebcamCapabilities].Selected)
                    {
                        _OnCapabilitiesEvent();
                    }
                    _SaveConfig();
                    break;
                }
            }
            return(true);
        }
Пример #12
0
 private void _LeaveScreen()
 {
     CParty.LeavingHighscore();
 }
Пример #13
0
        private static void _Run(string[] args)
        {
            Application.DoEvents();

            try
            {
                // Create data folder
                Directory.CreateDirectory(CSettings.DataFolder);

                // Init Log
                CLog.Init();

                if (!CProgrammHelper.CheckRequirements())
                {
                    return;
                }
                CProgrammHelper.Init();

                CLog.StartBenchmark("Init Program");
                CMain.Init();
                Application.DoEvents();

                // Init Language
                CLog.StartBenchmark("Init Language");
                if (!CLanguage.Init())
                {
                    throw new CLoadingException("Language");
                }
                CLog.StopBenchmark("Init Language");

                Application.DoEvents();

                // load config
                CLog.StartBenchmark("Init Config");
                CConfig.LoadCommandLineParams(args);
                CConfig.UseCommandLineParamsBefore();
                CConfig.Init();
                CConfig.UseCommandLineParamsAfter();
                CLog.StopBenchmark("Init Config");

                // Create folders
                CSettings.CreateFolders();

                _SplashScreen = new CSplashScreen();
                Application.DoEvents();

                // Init Draw
                CLog.StartBenchmark("Init Draw");
                if (!CDraw.Init())
                {
                    throw new CLoadingException("drawing");
                }
                CLog.StopBenchmark("Init Draw");

                Application.DoEvents();

                // Init Playback
                CLog.StartBenchmark("Init Playback");
                if (!CSound.Init())
                {
                    throw new CLoadingException("playback");
                }
                CLog.StopBenchmark("Init Playback");

                Application.DoEvents();

                // Init Record
                CLog.StartBenchmark("Init Record");
                if (!CRecord.Init())
                {
                    throw new CLoadingException("record");
                }
                CLog.StopBenchmark("Init Record");

                Application.DoEvents();

                // Init VideoDecoder
                CLog.StartBenchmark("Init Videodecoder");
                if (!CVideo.Init())
                {
                    throw new CLoadingException("video");
                }
                CLog.StopBenchmark("Init Videodecoder");

                Application.DoEvents();

                // Init Database
                CLog.StartBenchmark("Init Database");
                if (!CDataBase.Init())
                {
                    throw new CLoadingException("database");
                }
                CLog.StopBenchmark("Init Database");

                Application.DoEvents();

                //Init Webcam
                CLog.StartBenchmark("Init Webcam");
                if (!CWebcam.Init())
                {
                    throw new CLoadingException("webcam");
                }
                CLog.StopBenchmark("Init Webcam");

                Application.DoEvents();

                // Init Background Music
                CLog.StartBenchmark("Init Background Music");
                CBackgroundMusic.Init();
                CLog.StopBenchmark("Init Background Music");

                Application.DoEvents();

                // Init Profiles
                CLog.StartBenchmark("Init Profiles");
                CProfiles.Init();
                CLog.StopBenchmark("Init Profiles");

                Application.DoEvents();

                // Init Fonts
                CLog.StartBenchmark("Init Fonts");
                if (!CFonts.Init())
                {
                    throw new CLoadingException("fonts");
                }
                CLog.StopBenchmark("Init Fonts");

                Application.DoEvents();

                // Theme System
                CLog.StartBenchmark("Init Theme");
                if (!CThemes.Init())
                {
                    throw new CLoadingException("theme");
                }
                CLog.StopBenchmark("Init Theme");

                CLog.StartBenchmark("Load Theme");
                CThemes.Load();
                CLog.StopBenchmark("Load Theme");

                Application.DoEvents();

                // Load Cover
                CLog.StartBenchmark("Init Cover");
                if (!CCover.Init())
                {
                    throw new CLoadingException("covertheme");
                }
                CLog.StopBenchmark("Init Cover");

                Application.DoEvents();

                // Init Screens
                CLog.StartBenchmark("Init Screens");
                CGraphics.Init();
                CLog.StopBenchmark("Init Screens");

                Application.DoEvents();

                // Init Server
                CLog.StartBenchmark("Init Server");
                CVocaluxeServer.Init();
                CLog.StopBenchmark("Init Server");

                Application.DoEvents();

                // Init Input
                CLog.StartBenchmark("Init Input");
                CController.Init();
                CController.Connect();
                CLog.StopBenchmark("Init Input");

                Application.DoEvents();

                // Init Game;
                CLog.StartBenchmark("Init Game");
                CGame.Init();
                CProfiles.Update();
                CConfig.UsePlayers();
                CLog.StopBenchmark("Init Game");

                Application.DoEvents();

                // Init Party Modes;
                CLog.StartBenchmark("Init Party Modes");
                if (!CParty.Init())
                {
                    throw new CLoadingException("Party Modes");
                }
                CLog.StopBenchmark("Init Party Modes");

                Application.DoEvents();
                //Only reasonable point to call GC.Collect() because initialization may cause lots of garbage
                //Rely on GC doing its job afterwards and call Dispose methods where appropriate
                GC.Collect();
                CLog.StopBenchmark("Init Program");
            }
            catch (Exception e)
            {
                MessageBox.Show("Error on start up: " + e.Message);
                CLog.LogError("Error on start up: " + e);
                if (_SplashScreen != null)
                {
                    _SplashScreen.Close();
                }
                _CloseProgram();
                return;
            }
            Application.DoEvents();

            // Start Main Loop
            if (_SplashScreen != null)
            {
                _SplashScreen.Close();
            }

            CDraw.MainLoop();
        }
Пример #14
0
        private static void _Run(string[] args)
        {
            Application.DoEvents();

            try
            {
                // Create data folder
                Directory.CreateDirectory(CSettings.DataFolder);

                // Init Log
                CLog.Init(CSettings.FolderNameLogs,
                          CSettings.FileNameMainLog,
                          CSettings.FileNameSongLog,
                          CSettings.FileNameCrashMarker,
                          CSettings.GetFullVersionText(),
                          CReporter.ShowReporterFunc,
                          ELogLevel.Information);

                if (!CProgrammHelper.CheckRequirements())
                {
                    return;
                }
                CProgrammHelper.Init();

                using (CBenchmark.Time("Init Program"))
                {
                    CMain.Init();
                    Application.DoEvents();

                    // Init Language
                    using (CBenchmark.Time("Init Language"))
                    {
                        if (!CLanguage.Init())
                        {
                            throw new CLoadingException("Language");
                        }
                    }

                    Application.DoEvents();

                    // load config
                    using (CBenchmark.Time("Init Config"))
                    {
                        CConfig.LoadCommandLineParams(args);
                        CConfig.UseCommandLineParamsBefore();
                        CConfig.Init();
                        CConfig.UseCommandLineParamsAfter();
                    }

                    // Create folders
                    CSettings.CreateFolders();

                    _SplashScreen = new CSplashScreen();
                    Application.DoEvents();

                    // Init Draw
                    using (CBenchmark.Time("Init Draw"))
                    {
                        if (!CDraw.Init())
                        {
                            throw new CLoadingException("drawing");
                        }
                    }

                    Application.DoEvents();

                    // Init Playback
                    using (CBenchmark.Time("Init Playback"))
                    {
                        if (!CSound.Init())
                        {
                            throw new CLoadingException("playback");
                        }
                    }

                    Application.DoEvents();

                    // Init Record
                    using (CBenchmark.Time("Init Record"))
                    {
                        if (!CRecord.Init())
                        {
                            throw new CLoadingException("record");
                        }
                    }

                    Application.DoEvents();

                    // Init VideoDecoder
                    using (CBenchmark.Time("Init Videodecoder"))
                    {
                        if (!CVideo.Init())
                        {
                            throw new CLoadingException("video");
                        }
                    }

                    Application.DoEvents();

                    // Init Database
                    using (CBenchmark.Time("Init Database"))
                    {
                        if (!CDataBase.Init())
                        {
                            throw new CLoadingException("database");
                        }
                    }

                    Application.DoEvents();

                    //Init Webcam
                    using (CBenchmark.Time("Init Webcam"))
                    {
                        if (!CWebcam.Init())
                        {
                            throw new CLoadingException("webcam");
                        }
                    }

                    Application.DoEvents();

                    // Init Background Music
                    using (CBenchmark.Time("Init Background Music"))
                    {
                        CBackgroundMusic.Init();
                    }

                    Application.DoEvents();

                    // Init Profiles
                    using (CBenchmark.Time("Init Profiles"))
                    {
                        CProfiles.Init();
                    }

                    Application.DoEvents();

                    // Init Fonts
                    using (CBenchmark.Time("Init Fonts"))
                    {
                        if (!CFonts.Init())
                        {
                            throw new CLoadingException("fonts");
                        }
                    }

                    Application.DoEvents();

                    // Theme System
                    using (CBenchmark.Time("Init Theme"))
                    {
                        if (!CThemes.Init())
                        {
                            throw new CLoadingException("theme");
                        }
                    }

                    using (CBenchmark.Time("Load Theme"))
                    {
                        CThemes.Load();
                    }

                    Application.DoEvents();

                    // Load Cover
                    using (CBenchmark.Time("Init Cover"))
                    {
                        if (!CCover.Init())
                        {
                            throw new CLoadingException("covertheme");
                        }
                    }

                    Application.DoEvents();

                    // Init Screens
                    using (CBenchmark.Time("Init Screens"))
                    {
                        CGraphics.Init();
                    }

                    Application.DoEvents();

                    // Init Server
                    using (CBenchmark.Time("Init Server"))
                    {
                        CVocaluxeServer.Init();
                    }

                    Application.DoEvents();

                    // Init Input
                    using (CBenchmark.Time("Init Input"))
                    {
                        CController.Init();
                        CController.Connect();
                    }

                    Application.DoEvents();

                    // Init Game
                    using (CBenchmark.Time("Init Game"))
                    {
                        CGame.Init();
                        CProfiles.Update();
                        CConfig.UsePlayers();
                    }

                    Application.DoEvents();

                    // Init Party Modes
                    using (CBenchmark.Time("Init Party Modes"))
                    {
                        if (!CParty.Init())
                        {
                            throw new CLoadingException("Party Modes");
                        }
                    }

                    Application.DoEvents();
                    //Only reasonable point to call GC.Collect() because initialization may cause lots of garbage
                    //Rely on GC doing its job afterwards and call Dispose methods where appropriate
                    GC.Collect();
                }
            }
            catch (Exception e)
            {
                CLog.Error(e, "Error on start up: {ExceptionMessage}", CLog.Params(e.Message), show: true);
                if (_SplashScreen != null)
                {
                    _SplashScreen.Close();
                }
                _CloseProgram();
                return;
            }
            Application.DoEvents();

            // Start Main Loop
            if (_SplashScreen != null)
            {
                _SplashScreen.Close();
            }

            CDraw.MainLoop();
        }
Пример #15
0
        public override bool HandleInput(SKeyEvent keyEvent)
        {
            base.HandleInput(keyEvent);

            if (keyEvent.KeyPressed)
            {
            }
            else
            {
                switch (keyEvent.Key)
                {
                case Keys.Escape:
                case Keys.Back:
                    if (_PlayerEditActive)
                    {
                        _ExitPlayerEdit();
                        break;
                    }
                    _SaveMicConfig();
                    _ExitScreen();
                    break;

                case Keys.S:
                    CParty.SetNormalGameMode();
                    _SaveMicConfig();
                    CGraphics.FadeTo(EScreen.Song);
                    break;

                case Keys.Enter:
                    if (_HandlePlayerButtonPress())
                    {
                        break;
                    }

                    if (_Buttons[_EditButtonApply].Selected)
                    {
                        _SetMicConfig();
                        _ExitPlayerEdit();
                    }

                    if (_Buttons[_EditButtonCancel].Selected)
                    {
                        _ExitPlayerEdit();
                    }

                    if (_Buttons[_ButtonExit].Selected)
                    {
                        _SaveMicConfig();
                        _ExitScreen();
                    }

                    if (_Buttons[_ButtonDelayTest].Selected)
                    {
                        _TestDelay();
                    }

                    break;

                case Keys.D:
                    _TestDelay();
                    break;

                case Keys.Left:
                    _SelectSlideAction();
                    break;

                case Keys.Right:
                    _SelectSlideAction();
                    break;
                }
            }
            return(true);
        }
Пример #16
0
        public override bool HandleInput(SKeyEvent keyEvent)
        {
            base.HandleInput(keyEvent);

            if (keyEvent.KeyPressed)
            {
            }
            else
            {
                switch (keyEvent.Key)
                {
                case Keys.O:
                    CGraphics.FadeTo(EScreen.Options);
                    break;

                case Keys.S:
                    if (CProfiles.NumProfiles > 0)
                    {
                        CGraphics.FadeTo(EScreen.Song);
                    }
                    break;

                case Keys.C:
                    CGraphics.FadeTo(EScreen.Credits);
                    break;

                case Keys.T:
                    CGraphics.FadeTo(EScreen.Test);
                    break;

                case Keys.Enter:
                    if (_Buttons[_ButtonSing].Selected)
                    {
                        CParty.SetNormalGameMode();
                        CGraphics.FadeTo(EScreen.Song);
                    }

                    if (_Buttons[_ButtonParty].Selected)
                    {
                        CGraphics.FadeTo(EScreen.Party);
                    }

                    if (_Buttons[_ButtonOptions].Selected)
                    {
                        CGraphics.FadeTo(EScreen.Options);
                    }

                    if (_Buttons[_ButtonProfiles].Selected)
                    {
                        CGraphics.FadeTo(EScreen.Profiles);
                    }

                    if (_Buttons[_ButtonExit].Selected)
                    {
                        return(false);
                    }

                    break;

                case Keys.Escape:
                    _SelectElement(_Buttons[_ButtonExit]);
                    break;
                }
            }
            return(true);
        }