示例#1
0
        private void ButtonModify_Click(object sender, EventArgs e)
        {
            var form = new NewStatistics(CurrentStatistics);

            if (form.ShowDialog() == DialogResult.OK)
            {
                var model = form.Result;

                var result = StatisticsHelperClient.ModifyStatistics(model);
                if (string.IsNullOrEmpty(result))
                {
                    MessageBox.Show("修改成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    LoadStatistics(model);
                    ComboModules.SelectedItem = model.Name;
                }
            }
        }
示例#2
0
        private Sys_Statistics_Item SaveNewStatistics()
        {
            var form = new NewStatistics();

            if (form.ShowDialog() == DialogResult.OK)
            {
                var model  = form.Result;
                var result = StatisticsHelperClient.NewStatistics(model);
                if (string.IsNullOrEmpty(result) == false)
                {
                    MessageBox.Show(result, "添加统计项失败", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return(null);
                }

                LoadStatistics(model);

                return(model);
            }

            return(null);
        }