Пример #1
0
        private void SaveModel(Models model)
        {
            if (Global.listModel == null)
            {
                Global.listModel = new List <Models>();
            }
            ModelsHelper modelhple = new ModelsHelper("pro.pt");
            var          res       = modelhple.AddModel("pro.pt", Global.listModel, model);

            if (res)
            {
            }
            else
            {
                //    MessageBox.Show("文件保存失败.");
            }
        }
Пример #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            Models models = new Models();

            models.FileName = metroTabPage1.Text;
            ModelsHelper moder = new ModelsHelper("");
            var          res   = moder.DeleteModel("pro.pt", Global.listModel, models);

            if (!res)
            {
                MessageBox.Show("fali");
            }
            else
            {
                metroTabPage1.Text = "";
                dataGridView1.Rows.Clear();;
            }
        }