private void buttonSave_Click(object sender, EventArgs e) { try { param = read_param(); create(); } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } DialogResult = DialogResult.OK; }
private STParamReportTeamStanding read_param() { STParamReportTeamStanding ret = new STParamReportTeamStanding(); List <int> li = new List <int>(); try { ret.idseason = IS.idseason; if (comboBoxDivision.Text.Length > 0) { clDiv = new CDivision(connect, IS.idseason, comboBoxDivision.Text.Trim()); ret.iddivision = clDiv.stDiv.id; } else { ret.iddivision = 0; } for (int i = 0; i < checkedListBoxGroupR1.Items.Count; i++) { if (checkedListBoxGroupR1.GetItemChecked(i)) { string name = checkedListBoxGroupR1.Items[i].ToString(); clGroup = new CGroup(connect, IS.idseason, ret.iddivision, name); if (clGroup.stGroup.idgroup > 0) { li.Add(clGroup.stGroup.idgroup); } } } if (li.Count > 0) { ret.arr_idgroup = new int[li.Count]; for (int j = 0; j < ret.arr_idgroup.Length; j++) { ret.arr_idgroup[j] = li[j]; } } else { ret.arr_idgroup = new int[0]; } if (checkBoxDate.CheckState == CheckState.Checked) { ret.dt = new DateTime(dateTimePickerDate.Value.Year, dateTimePickerDate.Value.Month, dateTimePickerDate.Value.Day, 0, 0, 0, 0); prAll = true; } else { prAll = false; ret.dt = null; } ret.filename = string.Format("Положение команд_{0}.xls", clDiv.stDiv.name); } catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); } return(ret); }