private void cmbReposi_DropDown(object sender, EventArgs e) { try { EnvDTE.DTE dte = Model.SolutionCommon.Dte; bool result = LoadProjectLogic.Load(dte); //加载所有表信息 if (result) { _entitys = LoadProjectLogic.GetEntitys(); cmbReposi.DataSource = _entitys; cmbReposi.DisplayMember = "Entity"; cmbReposi.ValueMember = "Data2Obj"; cmbReturn.Enabled = true; } else { MsgBoxHelp.ShowWorning("加载仓储列表出错!"); } } catch (Exception ex) { MsgBoxHelp.ShowError(ex.Message, ex); } }
private void button2_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(textBox1.Text) == true) { MsgBoxHelp.ShowWorning("关键字名称不能为空!"); return; } if (string.IsNullOrEmpty(CommonContainer.SolutionPath)) { return; } string xmlPath = Path.Combine(CommonContainer.SolutionPath, CommonContainer.xmlName); xmlManager.WriteModel(textBox1.Text, textBox2.Text, xmlPath); IniDgv(); }
private void button2_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(textBox1.Text) == true) { MsgBoxHelp.ShowWorning("关键字名称不能为空!"); return; } if (operate == 1) { FileOprateHelp.SetKeyComment(textBox1.Text, textBox3.Text, textBox2.Text); //IniDgv(dataGridView1.SelectedRows[0].Index); MsgBoxHelp.ShowInfo("修改成功!"); } else if (operate == 2) { FileOprateHelp.SetKeyComment(textBox1.Text, textBox3.Text, textBox2.Text); // IniDgv(dataGridView1.Rows.Count); MsgBoxHelp.ShowInfo("插入成功!"); } IniDgv(); }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { if (e.ColumnIndex == 3) { OpenFileDialog dlg = new OpenFileDialog(); dlg.Filter = "应用程序集(.dll)|*.dll"; dlg.Multiselect = false; if (dlg.ShowDialog() == DialogResult.OK) { string sourcePath = dlg.FileName; int index = e.RowIndex; string name = Path.GetFileNameWithoutExtension(sourcePath); if (string.Compare(name, dataGridView1[0, index].Value.ToString(), true) == 0) { File.Copy(sourcePath, dataGridView1[4, index].Value.ToString(), true); ReferManageArgment arg = ReferManageLogic.GetReferInfo(dataGridView1[4, index].Value.ToString()); dataGridView1[0, index].Value = arg.ReferName; dataGridView1[1, index].Value = arg.currentVesion; dataGridView1[2, index].Value = arg.ModifyTime; dataGridView1[3, index].Value = "更新"; dataGridView1[4, index].Value = arg.Path; dataGridView1.Refresh(); } else { MsgBoxHelp.ShowWorning("引用程序集名称和源名称不一致,请选择正确的程序集"); } } } } catch (Exception ex) { MsgBoxHelp.ShowError("更新程序集错误", ex); } }