Exemplo n.º 1
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Control_UpdateClick(object sender, int e)
        {
            BasicDataModule module = modules[e];

            using (ChangeIndicatorTwo dialog = new ChangeIndicatorTwo(modules, module))
            {
                dialog.ChangeTitle = "修改 二级指标";
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    BasicDataModule module1 = dialog.GetModule;
                    SqliteHelper.Update(TableName.BasicData, module.ID, module1, out string msg);
                    if (string.IsNullOrEmpty(msg))
                    {
                        DataRefresh();
                    }
                    else
                    {
                        MessageBox.Show(msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 新增
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btn_add_Click(object sender, EventArgs e)
 {
     if (combo_one.Items.Count == 0)
     {
         MessageBox.Show("请先添加一级指标", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     using (ChangeIndicatorTwo dialog = new ChangeIndicatorTwo(modules))
     {
         dialog.ChangeTitle = "新增 二级指标";
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             BasicDataModule module = dialog.GetModule;
             SqliteHelper.Insert(TableName.BasicData, module, out string msg);
             if (!string.IsNullOrEmpty(msg))
             {
                 MessageBox.Show(msg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 return;
             }
             DataRefresh();
         }
     }
 }