|
using DevExpress.Utils.Svg;
|
using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Data;
|
using System.Drawing;
|
using System.Linq;
|
using System.Reflection;
|
using System.Text;
|
using System.Threading.Tasks;
|
using System.Windows.Forms;
|
|
namespace IStation.WinFrmUI.CalcErQu
|
{
|
public partial class CalcPrjHistoryContainter : DocumentPage
|
{
|
public CalcPrjHistoryContainter()
|
{
|
InitializeComponent();
|
|
this.PageTitle.Caption = "历史方案";
|
this.SurfaceGuid = new SurfaceGuid()
|
{
|
Modular = eModular.PrjHistory,
|
Function = this.PageTitle.Caption
|
};
|
}
|
|
private void CalcPrjHistoryContainter_Load(object sender, EventArgs e)
|
{
|
spinEditYear.Text = DateTime.Today.Year.ToString();
|
comboBoxMonth.Text = DateTime.Today.Month.ToString();
|
RefreshList();
|
listBoxDay.SelectedIndex = DateTime.Today.Day - 1;
|
}
|
public override void InitialDataSource()
|
{
|
base.InitialDataSource();
|
|
|
}
|
private void spinEditYear_EditValueChanged(object sender, EventArgs e)
|
{
|
RefreshList();
|
}
|
private void RefreshList()
|
{
|
int year = Convert.ToInt32(spinEditYear.Text);
|
int month = Convert.ToInt32(comboBoxMonth.Text);
|
|
int day_count = DateTime.DaysInMonth(year, month);
|
listBoxDay.Items.Clear();
|
for(int i=1;i<=day_count; i++)
|
{
|
listBoxDay.Items.Add(i.ToString());
|
}
|
|
dict = BLL.AnaPrj.GetExistStatus( year, month );
|
}
|
Dictionary<int, bool> dict = null;
|
|
|
private void comboBoxMonth_SelectedIndexChanged(object sender, EventArgs e)
|
{
|
RefreshList();
|
}
|
|
private void listBoxDay_SelectedIndexChanged(object sender, EventArgs e)
|
{
|
if (listBoxDay.SelectedIndex < 0)
|
return;
|
if (listBoxDay.Items.Count == 0)
|
return;
|
|
int year = Convert.ToInt32(spinEditYear.Text);
|
int month = Convert.ToInt32(comboBoxMonth.Text);
|
int day = listBoxDay.SelectedIndex + 1;
|
var yester1_day_anaPrj = IStation.BLL.AnaPrj.GetPrj(new DateTime(year,month,day));
|
if (yester1_day_anaPrj != null)
|
anaResultInfoManuCtrl1.SetBindingData(yester1_day_anaPrj);
|
else
|
anaResultInfoManuCtrl1.ClearContent();
|
}
|
|
private void listBoxDay_CustomItemDisplayText(object sender, DevExpress.XtraEditors.CustomItemDisplayTextEventArgs e)
|
{
|
if (dict == null)
|
return;
|
if (e.Item == null)
|
return;
|
if (!dict[e.Index + 1])
|
{
|
e.DisplayText = string.Format("{0} (无)",e.Value);
|
|
}
|
}
|
|
private void 删除ToolStripMenuItem_Click(object sender, EventArgs e)
|
{
|
DialogResult result = MessageBox.Show("请问是否 删除", "询问",
|
System.Windows.Forms.MessageBoxButtons.YesNo,
|
System.Windows.Forms.MessageBoxIcon.Warning);
|
if (result != DialogResult.Yes)
|
{
|
return;
|
}
|
|
var day = listBoxDay.SelectedIndex + 1;
|
dict[day] = false;
|
int year = Convert.ToInt32(spinEditYear.Text);
|
int month = Convert.ToInt32(comboBoxMonth.Text);
|
// HistoryAnaPrjFileHelper.Delete(new DateTime(year, month, day));
|
|
}
|
|
|
}
|
}
|