Example #1
0
        private void frmSetEventTemplate_Load(object sender, EventArgs e)
        {
            cbxScoreType.DropDownStyle = ComboBoxStyle.DropDownList;
            LoadScoreType();

            if (_isAdd)
            {
                _EventTemplates = new UDT.EventTemplates();
            }
            else
            {
                // 編輯模式
                txtCategory.Enabled = txtName.Enabled = false;
                txtCategory.Text    = _EventTemplates.Category;
                txtName.Text        = _EventTemplates.Name;
                foreach (UDT.ScoreTypes x in _ScoreTypesList)
                {
                    int uid = int.Parse(x.UID);
                    if (uid == _EventTemplates.RefScoreTypeId)
                    {
                        cbxScoreType.Text = x.Name;
                    }
                }
                chkIsTeam.Checked       = _EventTemplates.IsTeam;
                chkAthleticOnly.Checked = _EventTemplates.AthleticOnly;
                iptMaxMemberCount.Value = _EventTemplates.MaxMemberCount;
                iptMinMemberCount.Value = _EventTemplates.MinMemberCount;
            }
        }
Example #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            UDT.EventTemplates addEventtemplates = null;

            frmSetEventTemplate addFrom = new frmSetEventTemplate();

            addFrom.SetEventTemplates(addEventtemplates);
            addFrom.SetIsAdd(true);
            addFrom.setScoreTypesList(_ScoreTypesList);
            if (addFrom.ShowDialog() == DialogResult.OK)
            {
                // 資料重整
                _bgwLoadData.RunWorkerAsync();
            }
        }
Example #3
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            if (dgData.SelectedRows.Count == 0)
            {
                FISCA.Presentation.Controls.MsgBox.Show("請選擇項目");
            }
            else
            {
                UDT.EventTemplates selectEventTemplates = dgData.SelectedRows[0].Tag as UDT.EventTemplates;

                if (FISCA.Presentation.Controls.MsgBox.Show("當選「是」將刪除競賽樣板,請問是否刪除?", "刪除競賽樣板", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                {
                    selectEventTemplates.Deleted = true;
                    selectEventTemplates.Save();
                    // 資料重整
                    _bgwLoadData.RunWorkerAsync();
                }
            }
        }
Example #4
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (dgData.SelectedRows.Count == 0)
            {
                FISCA.Presentation.Controls.MsgBox.Show("請選擇項目");
            }
            else
            {
                UDT.EventTemplates selectEventTemplates = dgData.SelectedRows[0].Tag as UDT.EventTemplates;

                frmSetEventTemplate editFrom = new frmSetEventTemplate();
                editFrom.SetIsAdd(false);
                editFrom.SetEventTemplates(selectEventTemplates);
                editFrom.setScoreTypesList(_ScoreTypesList);

                if (editFrom.ShowDialog() == DialogResult.OK)
                {
                    // 資料重整
                    _bgwLoadData.RunWorkerAsync();
                }
            }
        }
 private void btnOk_Click(object sender, EventArgs e)
 {
     if (dgData.SelectedRows.Count == 0)
     {
         FISCA.Presentation.Controls.MsgBox.Show("請選擇項目");
         return;
     }
     else
     {
         UDT.EventTemplates temp = dgData.SelectedRows[0].Tag as UDT.EventTemplates;
         _AddEvents                   = new UDT.Events();
         _AddEvents.Category          = temp.Category;
         _AddEvents.Name              = temp.Name;
         _AddEvents.IsTeam            = temp.IsTeam;
         _AddEvents.RefScoreTypeId    = temp.RefScoreTypeId;
         _AddEvents.MaxMemberCount    = temp.MaxMemberCount;
         _AddEvents.MinMemberCount    = temp.MinMemberCount;
         _AddEvents.AthleticOnly      = temp.AthleticOnly;
         _AddEvents.RefItemTemplateId = int.Parse(temp.UID);
         _AddEvents.SchoolYear        = iptSchoolYear.Value;
     }
     this.DialogResult = DialogResult.OK;
 }
Example #6
0
 public void SetEventTemplates(UDT.EventTemplates data)
 {
     _EventTemplates = data;
 }