You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
223 lines
5.2 KiB
223 lines
5.2 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Drawing;
|
|
using System.Data;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
|
|
namespace SSLMS.MobileUI.uc
|
|
{
|
|
public partial class ucPLAN_QUERY : UserControl
|
|
{
|
|
private string _PLAN_STATUS = string.Empty;
|
|
|
|
private ucGrid ugPLAN = new ucGrid();
|
|
|
|
private DataRow _drPLAN
|
|
{
|
|
get
|
|
{
|
|
DataRow dr = null;
|
|
|
|
|
|
MyDataGrid mdgv = ugPLAN.dgv;
|
|
|
|
if (null == mdgv)
|
|
{
|
|
return dr;
|
|
}
|
|
|
|
dr = mdgv.GetCurDataRow();
|
|
|
|
return dr;
|
|
}
|
|
}
|
|
|
|
public ucPLAN_QUERY()
|
|
{
|
|
this.InitializeComponent();
|
|
}
|
|
|
|
public ucPLAN_QUERY(string PLAN_STATUS)
|
|
{
|
|
this.InitializeComponent();
|
|
|
|
ugPLAN.Dock = DockStyle.Fill;
|
|
|
|
ugPLAN.dgv.Click += new EventHandler(dgv_Click);
|
|
|
|
this.Controls.Add(ugPLAN);
|
|
|
|
if (!string.IsNullOrEmpty(PLAN_STATUS))
|
|
{
|
|
this._PLAN_STATUS = string.Format(" and PLAN_STATUS in ({0})", PLAN_STATUS.Replace('|', ','));
|
|
}
|
|
|
|
this.IO_PLAN_Bind();
|
|
}
|
|
|
|
private void IO_PLAN_Bind()
|
|
{
|
|
try
|
|
{
|
|
|
|
ugPLAN.sTable = "V_PLAN";
|
|
|
|
ugPLAN.sXml = "PLAN_MAIN";
|
|
|
|
ugPLAN.sWhere = string.Format(" {0} ", this._PLAN_STATUS);
|
|
|
|
ugPLAN.Init();
|
|
|
|
this.PLAN_Change();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageBox.Show("ϵͳ�쳣" + ex.Message);
|
|
}
|
|
}
|
|
|
|
private void PLAN_Change()
|
|
{
|
|
try
|
|
{
|
|
if (null == this._drPLAN)
|
|
{
|
|
return;
|
|
}
|
|
|
|
this.PLAN_ACTION_Bind();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageBox.Show("ϵͳ�쳣" + ex.Message);
|
|
}
|
|
|
|
}
|
|
|
|
private void PLAN_ACTION_Bind()
|
|
{
|
|
try
|
|
{
|
|
this.plPlan.Controls.Clear();
|
|
|
|
Button btnRefresh = new Button();
|
|
|
|
btnRefresh.Name = "btnRefresh";
|
|
|
|
btnRefresh.Text = "ˢ��";
|
|
|
|
btnRefresh.Location = new Point(0, 0);
|
|
|
|
plPlan.Controls.Add(btnRefresh);
|
|
|
|
btnRefresh.Click += new EventHandler(btn_Click);
|
|
|
|
switch (this._drPLAN["PLAN_TYPE_GROUP"].ToString())
|
|
{
|
|
case "1":
|
|
|
|
Button btnIn = new Button();
|
|
|
|
btnIn.Name = "btnIn";
|
|
|
|
btnIn.Text = "����";
|
|
|
|
btnIn.Location = new Point(btnRefresh.Right, 0);
|
|
|
|
plPlan.Controls.Add(btnIn);
|
|
|
|
btnIn.Click += new EventHandler(btn_Click);
|
|
|
|
break;
|
|
|
|
case "2":
|
|
|
|
Button btnOut = new Button();
|
|
|
|
btnOut.Name = "btnOut";
|
|
|
|
btnOut.Text = "����";
|
|
|
|
btnOut.Location = new Point(btnRefresh.Right, 0);
|
|
|
|
plPlan.Controls.Add(btnOut);
|
|
|
|
btnOut.Click += new EventHandler(btn_Click);
|
|
|
|
break;
|
|
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageBox.Show("ϵͳ�쳣" + ex.Message);
|
|
}
|
|
}
|
|
|
|
private void dgv_Click(object sender, EventArgs e)
|
|
{
|
|
this.PLAN_Change();
|
|
}
|
|
|
|
private void tcIO_PLAN_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
this.PLAN_Change();
|
|
}
|
|
|
|
private void btn_Click(object sender, EventArgs e)
|
|
{
|
|
if (null == this._drPLAN)
|
|
{
|
|
MessageBox.Show("Please Select Invoice");
|
|
|
|
return;
|
|
}
|
|
|
|
try
|
|
{
|
|
string PLAN_ID = this._drPLAN["PLAN_ID"].ToString();
|
|
|
|
Button btn = sender as Button;
|
|
|
|
switch (btn.Name)
|
|
{
|
|
case "btnIn":
|
|
|
|
ucMANAGE_PLAN_IN MANAGE_PLAN_IN = new ucMANAGE_PLAN_IN(Convert.ToInt32(PLAN_ID), "ManageIn");
|
|
|
|
SSLMS.MobileUI.MAIN.frmMain.MAIN_AddControl(MANAGE_PLAN_IN, "����");
|
|
|
|
break;
|
|
|
|
case "btnOut":
|
|
|
|
//ucMANAGE_INOUT MANAGE_OUT = new ucMANAGE_INOUT(PLAN_ID);
|
|
|
|
//SSLMS.MobileUI.MAIN.frmMain.MAIN_AddControl(MANAGE_OUT, "����");
|
|
|
|
break;
|
|
|
|
//case "btnPeiPan":
|
|
|
|
// ucMANAGE_CHANGE MANAGE_CHANGE = new ucMANAGE_CHANGE(PLAN_ID);
|
|
|
|
// SSLMS.MobileUI.MAIN.frm.MAIN_AddControl(MANAGE_CHANGE, "����");
|
|
|
|
// break;
|
|
|
|
case "btnRefresh":
|
|
|
|
this.IO_PLAN_Bind();
|
|
|
|
break;
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageBox.Show("ϵͳ�쳣" + ex.Message);
|
|
}
|
|
}
|
|
}
|
|
}
|