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 CommonLib; using CommonLib.data; namespace Lskj.PubBill { public partial class frmBackSelect : FormBase { public int SelectStepCode = 0; public string ComfirmMsg = string.Empty; public frmBackSelect(string typeCode, int CurrStepcode, int billType, string Billdocument_Id, string masterTable, string column_Prefix) { InitializeComponent(); //string sql = "select * from (select stepCode,stepName " + // "from p_systembillflowtypestep " + // "where typeCode='" + typeCode + "'" + // " and billType=" + billType.ToString() + // " and stepCode<" + CurrStepcode + // "union all " + // "select 0,'退回至提交人') x order by stepcode desc "; string sql = "select * from (select stepCode,stepName " + "from p_systembillflowtypestep " + "where typeCode='" + typeCode + "'" + " and billType=" + billType+ " and stepCode<" + CurrStepcode + "union all " + "select 0,'退回至提交人') x order by stepcode desc "; sql = @"select * from (select distinct a.stepCode,c.stepName from wms_billflowstep a inner join "+masterTable + @" b on a.flowsourcekey=b."+column_Prefix+@"Billdocument_Id inner join p_systembillflowtypestep c on a.stepCode=c.stepCode and c.billType=b."+column_Prefix+@"billtype where a.flowSourceKey='"+Billdocument_Id+ @"' and isnull(a.autoStep,0)=0 and ISNULL(a.operDirection,'F')='F' and a.stepCode<" + CurrStepcode + "union all " + "select 0,'退回至提交人') x order by stepcode desc "; //DataTable dt = SqlHelper.ExecuteDataSet(sql).Tables[0]; searchStep.setDataSource(sql, "stepCode", "stepName"); searchStep.getComboBox.DropDownStyle = ComboBoxStyle.DropDownList; searchStep.getComboBox.SelectedValue = 9999; } private void simpleButton2_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.Cancel; this.Close(); } private void simpleButton1_Click(object sender, EventArgs e) { if (searchStep.Text == "") { MessageBox.Show("请选择返退步骤"); return; } if ((txtYj.Text.Trim()) == "") { MessageBox.Show("请输入返退意见"); return; } SelectStepCode = Convert.ToInt32( searchStep.getComboBox.SelectedValue); ComfirmMsg = txtYj.Text; this.DialogResult = DialogResult.OK; this.Close(); } } }