using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Data;
|
using System.Drawing;
|
using System.Text;
|
using System.Windows.Forms;
|
using SQLHelper;
|
|
namespace DBUtility
|
{
|
public partial class Xt_BillCheckFlowStatusNow : Form
|
{
|
|
public Xt_BillCheckFlowStatusNow()
|
{
|
InitializeComponent();
|
}
|
|
public string HBillTypeID;
|
public string sBillNo;
|
public Int64 HBillInterID;
|
public Int64 HCheckFlowID;
|
public int sStatus;
|
public string HBillName;
|
|
private void Xt_BillCheckFlowStatusNow_Load(object sender, EventArgs e)
|
{
|
|
}
|
|
private void timer1_Tick(object sender, EventArgs e)
|
{
|
timer1.Enabled = false;
|
initGrid();
|
Display();
|
//AutoCheck();
|
}
|
|
ClsCN oCn = new ClsCN();
|
public long HEmpID;
|
public DateTime HDate;
|
|
public void Display()
|
{
|
DataSet Ds ;
|
ClsCN oCn = new ClsCN();
|
string sWhere = "";
|
sWhere = sWhere + "," + HBillTypeID + "";
|
sWhere = sWhere + "," + HBillInterID + "";
|
//sWhere = sWhere + ",'" + sBillNo + "'";
|
sWhere = sWhere + "," + HCheckFlowID + "";
|
if (sWhere.Trim().Length > 0)
|
{
|
sWhere = sWhere.Substring(1, sWhere.Length - 1);
|
}
|
Ds = oCn.RunProcReturn("exec h_p_Xt_BillCheckFlowStatusNow_add " + sWhere, "h_p_Xt_BillCheckFlowStatusNow");
|
if (Ds != null && Ds.Tables[0].Rows.Count!=0)
|
{
|
grdShow.DataSource = Ds.Tables[0].DefaultView;
|
//ÉèÖÃÍ¼Æ¬Íø¸ñÁУ¬ÐÐ
|
grdPic.RowCount =2;
|
grdPic.ColumnCount = Ds.Tables[0].Rows.Count * 2 - 1;
|
grdPic.Rows[0].Height = 70;
|
grdPic.Rows[1].Height = 35;
|
//grdPic.Rows[2].Height = 35;
|
//ÉóºËÁ÷ͼƬ
|
for (int i = 0; i < Ds.Tables[0].Rows.Count; i++)
|
{
|
//ÊÇ·ñÒÑÉóºË
|
if (ClsPub.isStrNull(Ds.Tables[0].Rows[i]["ÉóºËÈË"]) == "")
|
{
|
//DataGridViewImageCell sCell = new DataGridViewImageCell();
|
//sCell.ImageLayout = DataGridViewImageCellLayout.Stretch;
|
//sCell.Value = System.Drawing.Image.FromFile(ClsPub.AppPath + @"\CheckPic.jpg");
|
//grdPic.Rows[0].Cells[2 * i] = sCell;
|
//grdPic.Columns[2 * i].Width = 70;
|
if (i != 0)
|
{
|
//DataGridViewImageCell sCell2 = new DataGridViewImageCell();
|
//sCell2.ImageLayout = DataGridViewImageCellLayout.Stretch;
|
//sCell2.Value = System.Drawing.Image.FromFile(ClsPub.AppPath + @"\CheckPic3.jpg");
|
//grdPic.Rows[0].Cells[2 * i - 1] = sCell2;
|
//grdPic.Columns[2 * i - 1].Width = 70;
|
}
|
}
|
else
|
{
|
//DataGridViewImageCell sCell = new DataGridViewImageCell();
|
//sCell.ImageLayout = DataGridViewImageCellLayout.Stretch;
|
//sCell.Value = System.Drawing.Image.FromFile(ClsPub.AppPath + @"\CheckPic4.jpg");
|
//grdPic.Rows[0].Cells[2 * i] = sCell;
|
//grdPic.Columns[2 * i].Width = 70;
|
if (i != 0)
|
{
|
//DataGridViewImageCell sCell2 = new DataGridViewImageCell();
|
//sCell2.ImageLayout = DataGridViewImageCellLayout.Stretch;
|
//sCell2.Value = System.Drawing.Image.FromFile(ClsPub.AppPath + @"\CheckPic2.jpg");
|
//grdPic.Rows[0].Cells[2 * i - 1] = sCell2;
|
//grdPic.Columns[2 * i - 1].Width = 70;
|
}
|
//grdPic.Rows[2].Cells[2 * i].Value = ClsPub.isDate(Ds.Tables[0].Rows[i]["ÉóºËÈÕÆÚ"]); ;
|
}
|
grdPic.Rows[1].Cells[2 * i].Value = ClsPub.isStrNull(Ds.Tables[0].Rows[i]["ÉóºËÏîÄ¿"]); ;
|
|
}
|
}
|
ClsPub.GetGridView(grdShow, this.Name,ClsPub.AppPath);
|
}
|
|
private void initGrid()
|
{
|
grdShow.SelectionMode = DataGridViewSelectionMode.FullRowSelect; //Ñ¡ÖÐģʽ--ÐÐÑ¡ÖÐ
|
grdShow.ColumnHeadersVisible = true; //±êÌâÁÐÏÔʾ--ÊÇ
|
grdShow.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing; //±êÌâÁгߴçģʽ--£¨×Ô¶¯µ÷Õû£¬¿Éµ÷Õû£©
|
grdShow.RowTemplate.Height = 30;
|
grdShow.RowTemplate.MinimumHeight = 30;
|
grdShow.ColumnHeadersHeight = 35; //±êÌâÐиß
|
grdShow.RowHeadersVisible = true; //±êÌâÐпɼû--·ñ
|
grdShow.AllowUserToAddRows = false; //ÊÇ·ñÔÊÐí×ÔÔö--·ñ
|
grdShow.AllowUserToDeleteRows = false; //ÊÇ·ñÔÊÐíɾ³ý--·ñ
|
//grdShow.ColumnCount = 0; //×ÜÁÐÊý--5
|
//grdShow.RowCount = 0;
|
grdShow.AllowUserToResizeColumns = true; //ÔÊÐíµ÷ÕûÁпí--ÊÇ
|
grdShow.AllowUserToResizeRows = false; //ÔÊÐíµ÷ÕûÐиß--·ñ
|
grdShow.ReadOnly = true; //Ö»¶Á--ÊÇ
|
//grdShow.BackgroundColor = Color.White;
|
grdShow.GridColor = Color.LightGray;
|
grdShow.DefaultCellStyle.SelectionBackColor = Color.Black;
|
grdShow.EnableHeadersVisualStyles = true; //Íø¸ñ±êÌâ Ñùʽ
|
//
|
//
|
grdPic.SelectionMode = DataGridViewSelectionMode.CellSelect; //Ñ¡ÖÐģʽ--ÐÐÑ¡ÖÐ
|
grdPic.ColumnHeadersVisible = false; //±êÌâÁÐÏÔʾ--ÊÇ
|
grdPic.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing; //±êÌâÁгߴçģʽ--£¨×Ô¶¯µ÷Õû£¬¿Éµ÷Õû£©
|
grdPic.RowTemplate.Height = 35;
|
grdPic.RowTemplate.MinimumHeight = 30;
|
grdPic.RowHeadersVisible = false; //±êÌâÐпɼû--·ñ
|
grdPic.AllowUserToAddRows = false; //ÊÇ·ñÔÊÐí×ÔÔö--·ñ
|
grdPic.AllowUserToDeleteRows = false; //ÊÇ·ñÔÊÐíɾ³ý--·ñ
|
grdPic.AllowUserToResizeColumns = false; //ÔÊÐíµ÷ÕûÁпí--ÊÇ
|
grdPic.AllowUserToResizeRows = false; //ÔÊÐíµ÷ÕûÐиß--·ñ
|
grdPic.ReadOnly = true; //Ö»¶Á--ÊÇ
|
grdPic.DefaultCellStyle.SelectionBackColor = Color.White;
|
grdPic.EnableHeadersVisualStyles = false; //Íø¸ñ±êÌâ Ñùʽ
|
grdPic.CellBorderStyle = DataGridViewCellBorderStyle.None;
|
grdPic.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
|
}
|
|
private void button1_Click(object sender, EventArgs e)
|
{
|
//ÅжÏÊÇÉóºË»¹ÊÇ·´ÉóºË,»òÊDzµ»Ø
|
if (sStatus == 1) //ÉóºË
|
{
|
ClsPub.HCheckStatus = ClsPub.Xt_BillCheckFlowStatus(HBillInterID,sBillNo, HBillTypeID, HCheckFlowID, txtHCheckNote.Text, HBillName);
|
//if (ClsPub.HCheckStatus == 1)
|
//{
|
button1.Enabled = false;
|
//}
|
}
|
else if (sStatus == 2) //·´ÉóºË
|
{
|
ClsPub.HCheckStatus= ClsPub.Xt_BillCheckFlowStatusback(HBillInterID,sBillNo, HBillTypeID, HCheckFlowID,HBillName);
|
//if (ClsPub.HCheckStatus == 1)
|
//{
|
button1.Enabled = false;
|
//}
|
}
|
//´¦ÀíÍêË¢ÐÂ
|
Display();
|
}
|
|
public void AutoCheck()
|
{
|
//ÅжÏÊÇÉóºË»¹ÊÇ·´ÉóºË,»òÊDzµ»Ø
|
if (sStatus == 1) //ÉóºË
|
{
|
ClsPub.HCheckStatus = ClsPub.Xt_BillCheckFlowStatus(HBillInterID,sBillNo, HBillTypeID, HCheckFlowID, txtHCheckNote.Text, HBillName);
|
//if (ClsPub.HCheckStatus == 1)
|
//{
|
button1.Enabled = false;
|
//}
|
}
|
else if (sStatus == 2) //·´ÉóºË
|
{
|
ClsPub.HCheckStatus = ClsPub.Xt_BillCheckFlowStatusback(HBillInterID,sBillNo, HBillTypeID, HCheckFlowID, HBillName);
|
//if (ClsPub.HCheckStatus == 1)
|
//{
|
button1.Enabled = false;
|
//}
|
}
|
//´¦ÀíÍêË¢ÐÂ
|
Display();
|
}
|
|
private void button2_Click(object sender, EventArgs e)
|
{
|
this.Close();
|
}
|
|
private void Xt_BillCheckFlowStatusNow_FormClosing(object sender, FormClosingEventArgs e)
|
{
|
ClsPub.SaveGridView(grdShow, this.Name, ClsPub.AppPath);
|
}
|
|
private void grdShow_CellContentClick(object sender, DataGridViewCellEventArgs e)
|
{
|
|
}
|
|
private void cmdHBack_Click(object sender, EventArgs e)
|
{
|
|
}
|
}
|
}
|