200 lines
8.0 KiB
C#
200 lines
8.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 SOH.Kernel;
|
|
using EAS.Services;
|
|
using SOH.BLL;
|
|
using SOH.Entities;
|
|
using SOH.Data;
|
|
using SOH.Common;
|
|
using System.Text.RegularExpressions;
|
|
using SOH;
|
|
using System.Data.SqlClient;
|
|
|
|
|
|
namespace TiJianJieGuo
|
|
{
|
|
[ModuleAttribute(ModuleID = "EAD8459D-B5FF-47EB-A886-B8FE7CF20AF0", ModuleName = "当日体检人查询")]
|
|
public partial class frmDRTJRCX : SOH.Window.baseChildForm
|
|
{
|
|
public TiJianJieGuoGuanLi.frmYiShengJieGuoLuRuNew yslr=null;
|
|
|
|
public frmDRTJRCX()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void btnshuaxin_Click(object sender, EventArgs e)
|
|
{
|
|
var vservice = ServiceContainer.GetService<It_tempdjxm>();
|
|
String czym = LoginUser.username;
|
|
String data = vservice.getDrtjr(dtptjrq.Value.Date, czym);
|
|
DataTable dt = Newtonsoft.Json.JsonConvert.DeserializeObject(data, typeof(DataTable)) as DataTable;
|
|
dgvdrtjjg.DataSource = dt;
|
|
for (int i = 0; i < dgvdrtjjg.Rows.Count; i++)
|
|
{
|
|
//dgvdrtjjg.Rows[i].Cells["tm"].Value.ToString();
|
|
if (dgvdrtjjg.Rows[i].Cells["ztz"].Value.ToString().Equals("4")) //4=审核完成
|
|
{
|
|
dgvdrtjjg.Rows[i].DefaultCellStyle.BackColor = Color.LightGreen;
|
|
}
|
|
else if (dgvdrtjjg.Rows[i].Cells["ztz"].Value.ToString().Equals("1"))//1=临时保存
|
|
{
|
|
dgvdrtjjg.Rows[i].DefaultCellStyle.BackColor = Color.LightPink;
|
|
}
|
|
else if (dgvdrtjjg.Rows[i].Cells["ztz"].Value.ToString().Equals("3"))//3=待查
|
|
{
|
|
dgvdrtjjg.Rows[i].DefaultCellStyle.BackColor = Color.LightSkyBlue;
|
|
}
|
|
else if (dgvdrtjjg.Rows[i].Cells["ztz"].Value.ToString().Equals("2"))//2=放弃
|
|
{
|
|
dgvdrtjjg.Rows[i].DefaultCellStyle.BackColor = Color.LightGray;
|
|
}
|
|
|
|
if (dgvdrtjjg.Rows[i].Cells["czy"].Value.ToString().Equals("王元玺"))//CT二次审核
|
|
{
|
|
dgvdrtjjg.Rows[i].DefaultCellStyle.BackColor = Color.Magenta;
|
|
}
|
|
}
|
|
int myfinish = 0;
|
|
if (dt.Rows.Count > 0)
|
|
{
|
|
//myfinish = Convert.ToInt32(dt.Compute("count([tm])", "ztz = '完成'"));
|
|
myfinish = Convert.ToInt32(dt.Compute("count([tm])", "ztz = '4'"));
|
|
}
|
|
tbxmyfinish.Text = myfinish.ToString();
|
|
tbxwait.Text = vservice.getWait(dtptjrq.Value.Date, czym).ToString();
|
|
tbxfinish.Text = vservice.getFinish(dtptjrq.Value.Date, czym).ToString();
|
|
}
|
|
|
|
private void button1_Click(object sender, EventArgs e)
|
|
{
|
|
if (dgvdrtjjg.SelectedRows.Count > 0)
|
|
{
|
|
String tm = dgvdrtjjg.SelectedRows[0].Cells["tm"].Value.ToString();
|
|
if (dgvdrtjjg.SelectedRows[0].Cells["ztz"].Value.ToString() == "2")
|
|
{
|
|
MessageBox.Show("放弃检查状态,无需录入体检结果");
|
|
return;
|
|
}
|
|
if (dgvdrtjjg.SelectedRows[0].Cells["ztz"].Value.ToString() == "3")
|
|
{
|
|
MessageBox.Show("待查状态,请先到前台登记");
|
|
return;
|
|
}
|
|
//TiJianJieGuoGuanLi.frmYiShengJieGuoLuRuNew yslr = new TiJianJieGuoGuanLi.frmYiShengJieGuoLuRuNew(tm);
|
|
//yslr.Show(this.Pane.DockPanel);
|
|
//yslr.ShowDialog(this.Pane.DockPanel);
|
|
|
|
if(yslr==null)
|
|
{
|
|
yslr = new TiJianJieGuoGuanLi.frmYiShengJieGuoLuRuNew(this,tm);
|
|
yslr.Show(this.Pane.DockPanel);
|
|
}else
|
|
{
|
|
yslr.Close();
|
|
yslr = new TiJianJieGuoGuanLi.frmYiShengJieGuoLuRuNew(this, tm);
|
|
yslr.Show(this.Pane.DockPanel);
|
|
//yslr.Activate();
|
|
}
|
|
}
|
|
}
|
|
|
|
private void button2_Click(object sender, EventArgs e)
|
|
{
|
|
string czym = LoginUser.username;
|
|
DateTime startTime = dtpstartbks.Value.Date;
|
|
DateTime endTime = dtpendbks.Value.Date.AddDays(1);
|
|
var vservice = ServiceContainer.GetService<It_tempdjxm>();
|
|
String data = vservice.getBksGzl(startTime, endTime, czym);
|
|
DataTable dt = Newtonsoft.Json.JsonConvert.DeserializeObject(data, typeof(DataTable)) as DataTable;
|
|
Dictionary<String, Dictionary<int, int>> dicData = new Dictionary<string, Dictionary<int, int>>();
|
|
for (int i = 0; i < dt.Rows.Count; i++)
|
|
{
|
|
|
|
String xmmc = dt.Rows[i]["xmmc"].ToString();
|
|
Dictionary<int, int> dicCount;
|
|
if (!dicData.Keys.Contains(xmmc))
|
|
{
|
|
dicCount = new Dictionary<int, int>();
|
|
dicData.Add(xmmc, dicCount);
|
|
}
|
|
else
|
|
{
|
|
dicCount = dicData[xmmc];
|
|
}
|
|
int ztz = Convert.ToInt32(dt.Rows[i]["ztz"].ToString());
|
|
int count = 0;
|
|
if (!dicCount.Keys.Contains(ztz))
|
|
{
|
|
dicCount.Add(ztz, 0);
|
|
}
|
|
else
|
|
{
|
|
count = dicCount[ztz];
|
|
}
|
|
count++;
|
|
dicCount[ztz] = count;
|
|
dicData[xmmc] = dicCount;
|
|
}
|
|
|
|
DataTable oveTable = new DataTable();
|
|
oveTable.Columns.Add("xmmc", Type.GetType("System.String"));
|
|
oveTable.Columns.Add("tjrs", Type.GetType("System.Int32"));
|
|
oveTable.Columns.Add("wcrs", Type.GetType("System.Int32"));
|
|
oveTable.Columns.Add("wtj", Type.GetType("System.Int32"));
|
|
oveTable.Columns.Add("tjfq", Type.GetType("System.Int32"));
|
|
oveTable.Columns.Add("grdc", Type.GetType("System.Int32"));
|
|
foreach (var oneData in dicData)
|
|
{
|
|
String xmmc = oneData.Key;
|
|
for (int i = 0; i <= 4; i++)
|
|
{
|
|
if (!oneData.Value.Keys.Contains(i))
|
|
{
|
|
oneData.Value.Add(i, 0);
|
|
}
|
|
}
|
|
int wcrs = oneData.Value[4];
|
|
int wtj = oneData.Value[0];
|
|
int tjfq = oneData.Value[2];
|
|
int grdc = oneData.Value[3];
|
|
int tjrs = wcrs + wtj + tjfq + grdc;
|
|
oveTable.Rows.Add(new object[] { xmmc, tjrs, wcrs, wtj, tjfq, grdc });
|
|
}
|
|
dgvgzl.DataSource = oveTable;
|
|
}
|
|
|
|
private void button3_Click(object sender, EventArgs e)
|
|
{
|
|
string czym = LoginUser.username;
|
|
DateTime startTime = dtprsstart.Value.Date;
|
|
DateTime endTime = dtprsend.Value.Date.AddDays(1);
|
|
var vservice = ServiceContainer.GetService<It_tempdjxm>();
|
|
String data = vservice.rygzl(startTime, endTime, czym);
|
|
DataTable dt = Newtonsoft.Json.JsonConvert.DeserializeObject(data, typeof(DataTable)) as DataTable;
|
|
dgvrs.DataSource = dt;
|
|
}
|
|
|
|
private void dgvdrtjjg_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
|
|
{
|
|
SolidBrush b = new SolidBrush(this.dgvdrtjjg.RowHeadersDefaultCellStyle.ForeColor);
|
|
e.Graphics.DrawString((e.RowIndex + 1).ToString(System.Globalization.CultureInfo.CurrentUICulture),
|
|
this.dgvdrtjjg.DefaultCellStyle.Font, b, e.RowBounds.Location.X + 10, e.RowBounds.Location.Y + 4);
|
|
}
|
|
|
|
private void frmDRTJRCX_FormClosing(object sender, FormClosingEventArgs e)
|
|
{
|
|
//if(yslr!=null)
|
|
//{
|
|
// yslr.Close();
|
|
//}
|
|
}
|
|
}
|
|
}
|