|
|
|
|
using DB.Dto;
|
|
|
|
|
using DB.Entity;
|
|
|
|
|
using DB.Service;
|
|
|
|
|
|
|
|
|
|
using HZH_Controls.Controls;
|
|
|
|
|
using HZH_Controls.Forms;
|
|
|
|
|
|
|
|
|
|
using Microsoft.VisualBasic.ApplicationServices;
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace RfidWeb.Frm
|
|
|
|
|
{
|
|
|
|
|
public partial class FrmPlan : UserControl
|
|
|
|
|
{
|
|
|
|
|
private FromPlanService fromPlanService = new FromPlanService();
|
|
|
|
|
public FrmPlan()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
this.dataGridView1.Columns["CreateDate"].DefaultCellStyle.Format = "yyyy-MM-dd";
|
|
|
|
|
|
|
|
|
|
this.dataGridView1.AutoGenerateColumns = false;
|
|
|
|
|
|
|
|
|
|
ucPagerControl21.PageModel = PageModel.PageCount;
|
|
|
|
|
ucPagerControl21.PageIndex = 1;
|
|
|
|
|
ucPagerControl21.PageSize = 20;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ucBtnAdd_BtnClick(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
FormPlanAdd formRegis = new FormPlanAdd();
|
|
|
|
|
formRegis.StartPosition = FormStartPosition.CenterScreen; // 设置窗口显示在屏幕中央
|
|
|
|
|
formRegis.ShowDialog();
|
|
|
|
|
|
|
|
|
|
Replace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Replace()
|
|
|
|
|
{
|
|
|
|
|
ucPagerControl21.PageIndex = 1;
|
|
|
|
|
ucPagerControl21_ShowSourceChanged(new object());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ucPagerControl21_ShowSourceChanged(object currentSource)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
int index = ucPagerControl21.PageIndex;
|
|
|
|
|
var page = fromPlanService.GetPagedList(ucPagerControl21.PageIndex,
|
|
|
|
|
ucPagerControl21.PageSize);
|
|
|
|
|
ucPagerControl21.PageCount = page.TotalPages;
|
|
|
|
|
this.dataGridView1.DataSource = page.Items;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ucBtnUpdate_BtnClick(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
var dataGridViewRows = this.dataGridView1.SelectedRows;
|
|
|
|
|
if (dataGridViewRows.Count != 1)
|
|
|
|
|
{
|
|
|
|
|
FrmDialog.ShowDialog(this, "只能修改一条", "警告窗体");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var dto = dataGridViewRows[0].DataBoundItem as FromPlan;
|
|
|
|
|
FormPlanAdd formRegis = new FormPlanAdd(dto.ID);
|
|
|
|
|
formRegis.StartPosition = FormStartPosition.CenterScreen; // 设置窗口显示在屏幕中央
|
|
|
|
|
formRegis.ShowDialog();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Replace();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ucBtnDel_BtnClick(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
var dataGridViewRows = this.dataGridView1.SelectedRows;
|
|
|
|
|
if (dataGridViewRows.Count != 1)
|
|
|
|
|
{
|
|
|
|
|
FrmDialog.ShowDialog(this, "只能修改一条", "警告窗体");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var dto = dataGridViewRows[0].DataBoundItem as FromPlan;
|
|
|
|
|
fromPlanService.Del(dto.ID);
|
|
|
|
|
|
|
|
|
|
Replace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|