ab56a9bcf7
SVN-Revision: r240
118 lines
4.0 KiB
C#
118 lines
4.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using Lskj.Business.Impl;
|
|
using Lskj.Data;
|
|
using Lskj.Core;
|
|
using System.Diagnostics;
|
|
using Lskj.Business;
|
|
using System.Text.RegularExpressions;
|
|
|
|
namespace Lskj.Control
|
|
{
|
|
public partial class FrmProjectManager : BaseForm
|
|
{
|
|
/// <summary>
|
|
/// 菜单ID
|
|
/// </summary>
|
|
public string ModuleId;
|
|
/// <summary>
|
|
/// 方案数据
|
|
/// </summary>
|
|
public DataTable Projects = new DataTable();
|
|
|
|
public FrmProjectManager()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:初始化</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-11-16 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The source of the event.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
private void FrmPeojectManager_Load(object sender, EventArgs e)
|
|
{
|
|
try {
|
|
this.lbContainer.Items.Clear();
|
|
this.lbContainer.Items.AddRange(this.Projects.Select("1=1").Select(x => x["ProjectName"]).ToArray());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
Lskj.Control.Model.AutoSizeChange.ControllInitializeSize(this);
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:关闭界面</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-11-16 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The source of the event.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
private void btnClose_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
this.DialogResult = DialogResult.OK;
|
|
this.Close();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:删除方案</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-11-16 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The source of the event.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
private void btnDelete_Click(object sender, EventArgs e)
|
|
{
|
|
try {
|
|
string projectName = this.lbContainer.SelectedItem + "";
|
|
if (BaseModuleImpl.DeleteProject(ModuleId, projectName))
|
|
{
|
|
MessageUtil.Show(ResourceKeys.DeleteSuccess);
|
|
this.lbContainer.Items.Remove(projectName);
|
|
this.Projects.Rows.Remove(this.Projects.Select("ProjectName='" + projectName + "'")[0]);
|
|
}
|
|
else
|
|
{
|
|
MessageUtil.Show(ResourceKeys.DeleteFault);
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message,ex.Message);
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|