Пример #1
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            if (Config.No == 0)
            {
                var config = GetConfig();
                // Add
                if (RerolForm != null)
                {
                    RerolForm.AddScript(config);
                }
                else if (ClubShareForm != null)
                {
                    ClubShareForm.AddScript(config);
                }
                else if (ClubForm != null)
                {
                    ClubForm.AddScript(config);
                }
                else if (MainFForm != null)
                {
                    MainFForm.AddScript(config);
                }
                else if (ActionForm != null)
                {
                    ActionForm.AddScript(config);
                }
            }
            else
            {
                var config = GetConfig();

                // Edit
                if (RerolForm != null)
                {
                    RerolForm.UpdateScript(config);
                }
                else if (ClubShareForm != null)
                {
                    ClubShareForm.UpdateScript(config);
                }
                else if (ClubForm != null)
                {
                    ClubForm.UpdateScript(config);
                }
                else if (MainFForm != null)
                {
                    MainFForm.UpdateScript(config);
                }
                else if (ActionForm != null)
                {
                    ActionForm.UpdateScript(config);
                }
            }

            Close();
        }
Пример #2
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            Action.No   = int.Parse(txtNo.Text);
            Action.Name = txtName.Text;

            if (Action.No == 0)
            {
                MainFForm.AddAction(Action);
            }
            else
            {
                MainFForm.EditAction(Action);
            }

            Close();
        }