📄 frmwarrantupdate.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using property.model.Warrant;
using property.control.warrantInfo;
using property.view.WarrantInfo.CrRepotr;
namespace property.view.WarrantInfo
{
public partial class frmWarrantUpdate : Form
{
public frmWarrantUpdate()
{
InitializeComponent();
}
private void frmWarrantUpdate_Load(object sender, EventArgs e)
{
GetWarInfo getwar = new GetWarInfo();
getwar.GedListView(this.listView1);
}
// 修改
private void button1_Click(object sender, EventArgs e)
{
if (this.G_str_add == null)
{
MessageBox.Show("请选择要修改的记录", "友情提示", MessageBoxButtons.OK, MessageBoxIcon.Question);
return;
}// end block
else
{
WarrantUpdate frmWarupdate = new WarrantUpdate(G_str_add);
// frmsub.ShowDialog();
if (frmWarupdate.ShowDialog() == DialogResult.OK)
{ //全局变量P_str_id 调用函数修改
string P_str_warupdate = WarrantUpdate.P_str_Update;
if (P_str_warupdate == "updateOk")
{
MessageBox.Show("修改成功","友情提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
GetWarInfo getwar = new GetWarInfo();
getwar.GedListView(this.listView1);
this.G_str_add = null;
WarrantUpdate.P_str_Update = null;
return;
}// end block if
if (P_str_warupdate == "updateNO")
{
MessageBox.Show("修改失败请重新操作", "友情提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.G_str_add = null;
return;
}// end block if
if (P_str_warupdate == "updateError")
{
MessageBox.Show("对不起系统出现异常", "友情提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.G_str_add = null;
return;
}// end block if
}// end block if
}// end block else
}
private void button4_Click(object sender, EventArgs e)
{
DialogResult a = MessageBox.Show("是否要退出?", "退出", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (Convert.ToString(a) == "Yes")
{
this.Close();
}// end block
}
public string G_str_add;
private void listView1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void listView1_Click(object sender, EventArgs e)
{
try
{
this.G_str_add = this.listView1.SelectedItems[0].Text.ToString();//填冲件
}
catch (Exception ee)
{ MessageBox.Show(ee.Message); }
}
//删除
private void button2_Click(object sender, EventArgs e)
{
if (this.G_str_add == null)
{
MessageBox.Show("请选择要删除的记录", "友情提示", MessageBoxButtons.OK, MessageBoxIcon.Question);
return;
}// end block
else
{
DialogResult a = MessageBox.Show("你确定要删除此记录", "友情提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (Convert.ToString(a) == "Yes")
{
GetWarInfo getwar = new GetWarInfo();
string P_str_delet = getwar.GetWarrantDelete(Convert.ToInt32(G_str_add));//调用方法删除
if (P_str_delet == "deleteOk")
{
MessageBox.Show("删除成功", "友情提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
getwar.GedListView(this.listView1);
this.G_str_add = null;
return;
}// end block if
if (P_str_delet == "deleteNO")
{
MessageBox.Show("删除失败请重新操作", "友情提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}// end block if
if (P_str_delet == "deleteError")
{
MessageBox.Show("对不起系统出现异常", "友情提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}// end block
}// end block if
else
{ this.G_str_add = null; }// end block else
}// end block if
}
private void button3_Click(object sender, EventArgs e)
{
if (G_str_add != null)
{
RepfrmWarrantinfo fr = new RepfrmWarrantinfo(Convert.ToInt32(G_str_add));
fr.Show();
G_str_add = null;
}
else
{
MessageBox.Show("请选择要打印的记录","友情提示");
return;
}//
}
private void groupBox1_Enter(object sender, EventArgs e)
{
}// end block if
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -