Exemple #1
0
 /// <summary>
 /// 新增
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btn_add_Click(object sender, EventArgs e)
 {
     using (ChangeIndicatorOne dialog = new ChangeIndicatorOne())
     {
         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();
         }
     }
 }
Exemple #2
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Control_UpdateClick(object sender, int e)
        {
            BasicDataModule module = modules[e];

            using (ChangeIndicatorOne dialog = new ChangeIndicatorOne(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);
                    }
                }
            }
        }