using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using GThinking.N_MISPRO; using GThinking.N_MISPRO.Data; using GThinking.N_MODEL.Page; using GThinking.N_MISPRO.Utility; using GThinking.N_PUBLIC; using GThinking.N_MODEL.Dialog; using GThinking.N_WORKFLOW; using System.Collections.Generic; using GThinking.N_CONTROL; using System.Text; namespace GThinking.N_XLXSBJ { public partial class TZYZJJBInfo : SingleCardBase { TZYZJJB entity = new TZYZJJB(); protected void Page_Load(object sender, EventArgs e) { this.UMID = 100860165; this.UMName = "按主芯截面范围调表价"; this.CurMaster = Master; this.CurEntity = entity; this.PageHeight = 400; this.PageWidth = 500; SetTJYZLable(); base.InitPage(); if (!this.IsPostBack) { InitControls(); } } #region 模板事件继承 protected override void ReportDataSetAdd() { TDatabase db = TContextDatabases.GetDatabase("DBERP"); TSQL sql = new TSQL(db); sql.Add("select XLXSTZYZ_YZID, XLXSTZYZ_YZMC from XLXSTZYZ where XLXSTZYZ_MXBH='JZJ' and XLXSTZYZ_TJYS='B' order by XLXSTZYZ_XSXH,XLXSTZYZ_YZID "); DataSet ds = db.OpenDataSet(sql); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string sYZID = "TZYZ_" + ds.Tables[0].Rows[i]["XLXSTZYZ_YZID"].ToString().Trim(); string sYZMC = ds.Tables[0].Rows[i]["XLXSTZYZ_YZMC"].ToString().Trim(); AddUserReportField("XLXSJGBYZZB", sYZID, sYZMC, "N"); } base.ReportDataSetAdd(); } protected override void ReportRecordSetAdd() { TDatabase dberp = TContextDatabases.GetDatabase("DBERP"); TSQL sSQL = new TSQL(dberp); TSQL SQL = new TSQL(dberp); SQL.Clear(); SQL.Add("select XLXSTZYZ_YZID, XLXSTZYZ_YZMC "); SQL.Add(" from XLXSTZYZ"); SQL.Add(" where XLXSTZYZ_MXBH = 'JZJ' and XLXSTZYZ_TJYS='B' order by XLXSTZYZ_XSXH,XLXSTZYZ_YZID "); DataSet ds = dberp.OpenDataSet(SQL); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { sSQL.Add(string.Format(",sum(decode(XLXSJGBYZZB_YZID, '{0}', XLXSJGBYZZB_YZZ, 0)) as TZYZ_{0}", ds.Tables[0].Rows[i][0].ToString().Trim())); } sSQL.Text = "select 1" + sSQL.Text + " from XLXSJGBYZZB where XLXSJGBYZZB_JGBID='" + txtJGBID.Value.Trim() + "' and XLXSJGBYZZB_ZXJMS=" + txtZXJMS.Value + " and XLXSJGBYZZB_ZXJMZ=" + txtZXJMZ.Value + " "; AddUserReportSQL("XLXSJGBYZZB", sSQL); base.ReportRecordSetAdd(); } protected override void SetControlState() { base.SetControlState(); txtWHR.Enabled = false; datWHSJ.Enabled = false; # region 给调价因子控件设只读性 if (ControlState == TControlState.ctsInsert || ControlState == TControlState.ctsCopy || ControlState == TControlState.ctsEdit) { for (int i = 1; i <= 10; i++) { gtNumTextBox txtTJYZ = (gtNumTextBox)Master.ContentFormControl.FindControl("txt" + "TJYZ" + i); txtTJYZ.Enabled = false; } string[] sTJYZList = PageParam.GetRTrimString("TJYZList").Split(','); for (int i = 0; i < sTJYZList.Length; i++) { if (sTJYZList[i].StartsWith("JZ01|")) { txtTJYZ1.DecimalPlaces = GetXSWS("JZ01"); txtTJYZ1.Enabled = true; } else if (sTJYZList[i].StartsWith("JZ02|")) { txtTJYZ2.DecimalPlaces = GetXSWS("JZ02"); txtTJYZ2.Enabled = true; } else if (sTJYZList[i].StartsWith("JZ03|")) { txtTJYZ3.DecimalPlaces = GetXSWS("JZ03"); txtTJYZ3.Enabled = true; } else if (sTJYZList[i].StartsWith("JZ04|")) { txtTJYZ4.DecimalPlaces = GetXSWS("JZ04"); txtTJYZ4.Enabled = true; } else if (sTJYZList[i].StartsWith("JZ05|")) { txtTJYZ5.DecimalPlaces = GetXSWS("JZ05"); txtTJYZ5.Enabled = true; } else if (sTJYZList[i].StartsWith("JZ06|")) { txtTJYZ6.DecimalPlaces = GetXSWS("JZ06"); txtTJYZ6.Enabled = true; } else if (sTJYZList[i].StartsWith("JZ07|")) { txtTJYZ7.DecimalPlaces = GetXSWS("JZ07"); txtTJYZ7.Enabled = true; } else if (sTJYZList[i].StartsWith("JZ08|")) { txtTJYZ8.DecimalPlaces = GetXSWS("JZ08"); txtTJYZ8.Enabled = true; } else if (sTJYZList[i].StartsWith("JZ09|")) { txtTJYZ9.DecimalPlaces = GetXSWS("JZ09"); txtTJYZ9.Enabled = true; } else if (sTJYZList[i].StartsWith("JZ10|")) { txtTJYZ10.DecimalPlaces = GetXSWS("JZ10"); txtTJYZ10.Enabled = true; } } } #endregion } protected override void LoadRecord() { if (!IsPostBack) { entity.Param.Add("XLXSJGBYZZB_JGBID", PageParam.GetRTrimString("XLXSJGBYZZB_JGBID")); entity.Param.Add("XLXSJGBYZZB_ZXJMS", PageParam.GetRTrimString("XLXSJGBYZZB_ZXJMS")); entity.Param.Add("XLXSJGBYZZB_ZXJMZ", PageParam.GetRTrimString("XLXSJGBYZZB_ZXJMZ")); entity.Param.Add("XLXSJGBYZZB_YZID", PageParam.GetRTrimString("XLXSJGBYZZB_YZID")); } else { entity.Param.Add("XLXSJGBYZZB_JGBID", txtJGBID.Value.Trim()); entity.Param.Add("XLXSJGBYZZB_ZXJMS", txtOLD_ZXJMS.Value.Trim()); entity.Param.Add("XLXSJGBYZZB_ZXJMZ", txtOLD_ZXJMZ.Value.Trim()); entity.Param.Add("XLXSJGBYZZB_YZID", txtYZID.Value.Trim()); } base.LoadRecord(); txtOLD_ZXJMS.Value = txtZXJMS.Value.ToString().Trim(); txtOLD_ZXJMZ.Value = txtZXJMZ.Value.ToString().Trim(); # region 给调价因子控件赋值 TDatabase dberp = TContextDatabases.GetDatabase("DBERP"); TSQL sql = new TSQL(dberp); sql.Add("select XLXSJGBYZZB_YZID, XLXSJGBYZZB_YZZ, XLXSJGBYZZB_WHR, XLXSJGBYZZB_WHRID, XLXSJGBYZZB_WHSJ from XLXSJGBYZZB "); sql.Add("where XLXSJGBYZZB_JGBID=:pJGBID and XLXSJGBYZZB_ZXJMS=:pZXJMS and XLXSJGBYZZB_ZXJMZ=:pZXJMZ order by XLXSJGBYZZB_YZID"); sql.ParamByName("pJGBID").Value = txtJGBID.Value.Trim(); sql.ParamByName("pZXJMS").Value = txtZXJMS.Value; sql.ParamByName("pZXJMZ").Value = txtZXJMZ.Value; DataSet ds = dberp.OpenDataSet(sql); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string sYZID = ds.Tables[0].Rows[i]["XLXSJGBYZZB_YZID"].ToString().Trim(); double dYZZ = CMISproConvert.StrToFloat(ds.Tables[0].Rows[i]["XLXSJGBYZZB_YZZ"].ToString().Trim()); if (PageParam.GetRTrimString("TJYZList").Contains(sYZID + "|")) { if (sYZID.Equals("JZ01")) { txtTJYZ1.DecimalPlaces = GetXSWS(sYZID); txtTJYZ1.Value = dYZZ; } else if (sYZID.Equals("JZ02")) { txtTJYZ2.DecimalPlaces = GetXSWS(sYZID); txtTJYZ2.Value = dYZZ; } else if (sYZID.Equals("JZ03")) { txtTJYZ3.DecimalPlaces = GetXSWS(sYZID); txtTJYZ3.Value = dYZZ; } else if (sYZID.Equals("JZ04")) { txtTJYZ4.DecimalPlaces = GetXSWS(sYZID); txtTJYZ4.Value = dYZZ; } else if (sYZID.Equals("JZ05")) { txtTJYZ5.DecimalPlaces = GetXSWS(sYZID); txtTJYZ5.Value = dYZZ; } else if (sYZID.Equals("JZ06")) { txtTJYZ6.DecimalPlaces = GetXSWS(sYZID); txtTJYZ6.Value = dYZZ; } else if (sYZID.Equals("JZ07")) { txtTJYZ7.DecimalPlaces = GetXSWS(sYZID); txtTJYZ7.Value = dYZZ; } else if (sYZID.Equals("JZ08")) { txtTJYZ8.DecimalPlaces = GetXSWS(sYZID); txtTJYZ8.Value = dYZZ; } else if (sYZID.Equals("JZ09")) { txtTJYZ9.DecimalPlaces = GetXSWS(sYZID); txtTJYZ9.Value = dYZZ; } else if (sYZID.Equals("JZ10")) { txtTJYZ10.DecimalPlaces = GetXSWS(sYZID); txtTJYZ10.Value = dYZZ; } } } #endregion } protected override void OnNewRecorder() { base.OnNewRecorder(); txtJGBID.Value = PageParam.GetRTrimString("XLXSJGBYZZB_JGBID"); txtWHR.Text = tSession.UserName; txtWHRID.Value = tSession.UserId; datWHSJ.Text = CMISproConvert.ConvertTime(DateTime.Now); if (!PageParam.GetRTrimString("XLXSJGBYZZB_ZXJMS").Equals("")) { txtZXJMS.Value = CMISproConvert.StrToFloat(PageParam.GetRTrimString("XLXSJGBYZZB_ZXJMS")); txtZXJMZ.Value = CMISproConvert.StrToFloat(PageParam.GetRTrimString("XLXSJGBYZZB_ZXJMZ")); } } protected override void OnCopyRecorder() { base.OnCopyRecorder(); txtJGBID.Value = PageParam.GetRTrimString("XLXSJGBYZZB_JGBID"); txtWHR.Text = tSession.UserName; txtWHRID.Value = tSession.UserId; datWHSJ.Text = CMISproConvert.ConvertTime(DateTime.Now); } protected override bool DataLogicValid() { if (txtZXJMS.Value < 0) { ShowMessage("主芯截面始--不允许为负数!"); return false; } if (txtZXJMZ.Value < 0) { ShowMessage("主芯截面止--不允许为负数!"); return false; } if (txtZXJMZ.Value != 0) { if (txtZXJMS.Value > txtZXJMZ.Value) { ShowMessage("主芯截面始不允许超过主芯截面止!"); return false; } } TDatabase dberp = TContextDatabases.GetDatabase("DBERP"); TSQL sql = new TSQL(dberp); string[] sTJYZList = PageParam.GetRTrimString("TJYZList").Split(','); for (int i = 0; i < sTJYZList.Length; i++) { if (ControlState == TControlState.ctsInsert || ControlState == TControlState.ctsCopy) { sql.Clear(); sql.Add("select XLXSJGBYZZB_ZXJMS, XLXSJGBYZZB_ZXJMZ "); sql.Add("from XLXSJGBYZZB "); sql.Add("where XLXSJGBYZZB_JGBID=:pJGBID and XLXSJGBYZZB_YZID=:pYZID "); sql.Add(" and ((XLXSJGBYZZB_ZXJMS>=:pZXJMS "); if (txtZXJMZ.Value != 0) { sql.Add(" and XLXSJGBYZZB_ZXJMS<=:pZXJMZ "); } sql.Add(" ) "); sql.Add(" or ("); if (txtZXJMZ.Value != 0) { sql.Add(" XLXSJGBYZZB_ZXJMZ>0 and XLXSJGBYZZB_ZXJMZ>=:pZXJMS and XLXSJGBYZZB_ZXJMZ<=:pZXJMZ "); } else { sql.Add(" (XLXSJGBYZZB_ZXJMZ>0 and XLXSJGBYZZB_ZXJMZ>=:pZXJMS) or (XLXSJGBYZZB_ZXJMZ=0) "); } sql.Add(" ) "); sql.Add(" or (XLXSJGBYZZB_ZXJMS<=:pZXJMS and (XLXSJGBYZZB_ZXJMZ=0 or XLXSJGBYZZB_ZXJMZ>=:pZXJMZ))"); sql.Add(" ) "); sql.ParamByName("pJGBID").Value = txtJGBID.Value.Trim(); sql.ParamByName("pYZID").Value = sTJYZList[i].Split('|')[0]; sql.ParamByName("pZXJMS").Value = txtZXJMS.Value; if (txtZXJMZ.Value != 0) { sql.ParamByName("pZXJMZ").Value = txtZXJMZ.Value; } DataSet ds = dberp.OpenDataSet(sql); if (ds.Tables[0].Rows.Count > 0) { string sZXJMQJ = ""; if (CMISproConvert.StrToFloat(ds.Tables[0].Rows[0]["XLXSJGBYZZB_ZXJMZ"].ToString()) != 0) sZXJMQJ = ds.Tables[0].Rows[0]["XLXSJGBYZZB_ZXJMS"].ToString().Trim() + "~" + ds.Tables[0].Rows[0]["XLXSJGBYZZB_ZXJMZ"].ToString().Trim(); else sZXJMQJ = ds.Tables[0].Rows[0]["XLXSJGBYZZB_ZXJMS"].ToString().Trim() + "~" + "--"; ShowMessage(string.Format("因子{1}与已有主芯截面区间【{0}】的记录有交集,不允许保存!", sZXJMQJ, sTJYZList[i])); return false; } } else { sql.Clear(); sql.Add("select XLXSJGBYZZB_ZXJMS, XLXSJGBYZZB_ZXJMZ "); sql.Add("from XLXSJGBYZZB "); sql.Add("where XLXSJGBYZZB_JGBID=:pJGBID and XLXSJGBYZZB_YZID=:pYZID "); sql.Add(" and (XLXSJGBYZZB_ZXJMS<>:pOLDZXJMS or XLXSJGBYZZB_ZXJMZ<>:pOLDZXJMZ )"); sql.Add(" and ((XLXSJGBYZZB_ZXJMS>=:pZXJMS "); if (txtZXJMZ.Value != 0) { sql.Add(" and XLXSJGBYZZB_ZXJMS<=:pZXJMZ "); } sql.Add(" ) "); sql.Add(" or ("); if (txtZXJMZ.Value != 0) { sql.Add(" XLXSJGBYZZB_ZXJMZ>0 and XLXSJGBYZZB_ZXJMZ>=:pZXJMS and XLXSJGBYZZB_ZXJMZ<=:pZXJMZ "); } else { sql.Add(" (XLXSJGBYZZB_ZXJMZ>0 and XLXSJGBYZZB_ZXJMZ>=:pZXJMS) or (XLXSJGBYZZB_ZXJMZ=0) "); } sql.Add(" ) "); sql.Add(" or (XLXSJGBYZZB_ZXJMS<=:pZXJMS and (XLXSJGBYZZB_ZXJMZ=0 or XLXSJGBYZZB_ZXJMZ>=:pZXJMZ))"); sql.Add(" ) "); sql.ParamByName("pJGBID").Value = txtJGBID.Value.Trim(); sql.ParamByName("pYZID").Value = sTJYZList[i].Split('|')[0]; sql.ParamByName("pOLDZXJMS").Value = txtOLD_ZXJMS.Value.Trim(); sql.ParamByName("pOLDZXJMZ").Value = txtOLD_ZXJMZ.Value.Trim(); sql.ParamByName("pZXJMS").Value = txtZXJMS.Value; if (txtZXJMZ.Value != 0) { sql.ParamByName("pZXJMZ").Value = txtZXJMZ.Value; } DataSet ds = dberp.OpenDataSet(sql); if (ds.Tables[0].Rows.Count > 0) { string sZXJMQJ = ""; if (CMISproConvert.StrToFloat(ds.Tables[0].Rows[0]["XLXSJGBYZZB_ZXJMZ"].ToString()) != 0) sZXJMQJ = ds.Tables[0].Rows[0]["XLXSJGBYZZB_ZXJMS"].ToString().Trim() + "~" + ds.Tables[0].Rows[0]["XLXSJGBYZZB_ZXJMZ"].ToString().Trim(); else sZXJMQJ = ds.Tables[0].Rows[0]["XLXSJGBYZZB_ZXJMS"].ToString().Trim() + "~" + "--"; ShowMessage(string.Format("因子{1}与已有主芯截面区间【{0}】的记录有交集,不允许保存!", sZXJMQJ, sTJYZList[i])); return false; } } } return base.DataLogicValid(); } protected override bool Master_BeforeEditAction(object sender, EventArgs e) { return base.Master_BeforeEditAction(sender, e); } protected override bool Master_BeforeDeleteAction(object sender, EventArgs e) { string sYZIDlist = TZYZBJAInfo.GetYZIDList(PageParam.GetRTrimString("TJYZList")); entity.EntityTable.DeleteSql = " delete from XLXSJGBYZZB where XLXSJGBYZZB_JGBID=:XLXSJGBYZZB_JGBID and XLXSJGBYZZB_ZXJMS =:XLXSJGBYZZB_ZXJMS and XLXSJGBYZZB_ZXJMZ =:XLXSJGBYZZB_ZXJMZ and " + CMISproDataBase.GetWhereEqual("XLXSJGBYZZB_YZID", sYZIDlist); return base.Master_BeforeDeleteAction(sender, e); } protected override bool Master_BeforeSaveAction(object sender, EventArgs e) { if (!base.Master_BeforeSaveAction(sender, e)) return false; string sYZIDlist = TZYZBJAInfo.GetYZIDList(PageParam.GetRTrimString("TJYZList")); entity.EntityTable.UpdateSql = " update XLXSJGBYZZB " + " set XLXSJGBYZZB_ZXJMS= isnull(:XLXSJGBYZZB_ZXJMS,0), XLXSJGBYZZB_ZXJMZ = isnull(:XLXSJGBYZZB_ZXJMZ,0) " + " where XLXSJGBYZZB_JGBID=:XLXSJGBYZZB_JGBID and XLXSJGBYZZB_ZXJMS =:OLD_XLXSJGBYZZB_ZXJMS and XLXSJGBYZZB_ZXJMZ =:OLD_XLXSJGBYZZB_ZXJMZ " + " and " + CMISproDataBase.GetWhereEqual("XLXSJGBYZZB_YZID", sYZIDlist); txtWHR.Text = tSession.UserName; txtWHRID.Value = tSession.UserId; datWHSJ.Text = CMISproConvert.ConvertTime(System.DateTime.Now); return true; } protected override bool Master_AfterSaveAction(object sender, EventArgs e) { txtOLD_ZXJMS.Value = txtZXJMS.Value.ToString().Trim(); txtOLD_ZXJMZ.Value = txtZXJMZ.Value.ToString().Trim(); txtYZID.Value = PageParam.GetRTrimString("FirstYZID"); string sJGBID = txtJGBID.Value.Trim(); # region 将调价因子控件值更新至数据库中 TDatabase dberp = TContextDatabases.GetDatabase("DBERP"); TSQL sql = new TSQL(dberp); sql.Clear(); string sYZIDlist = TZYZBJAInfo.GetYZIDList(PageParam.GetRTrimString("TJYZList")); dberp.ExecSQL(string.Format("delete from XLXSJGBYZZB where XLXSJGBYZZB_JGBID='{0}' and XLXSJGBYZZB_ZXJMS={1} and XLXSJGBYZZB_ZXJMZ={2} and " + CMISproDataBase.GetWhereEqual("XLXSJGBYZZB_YZID", sYZIDlist) , sJGBID, txtZXJMS.Value, txtZXJMZ.Value)); string[] sTJYZList = PageParam.GetRTrimString("TJYZList").Split(','); DateTime tNow = DateTime.Now; for (int i = 0; i < sTJYZList.Length; i++) { sql.Clear(); sql.Add("insert into XLXSJGBYZZB(XLXSJGBYZZB_JGBID,XLXSJGBYZZB_ZXJMS,XLXSJGBYZZB_ZXJMZ,XLXSJGBYZZB_YZID,XLXSJGBYZZB_YZZ,XLXSJGBYZZB_WHR,XLXSJGBYZZB_WHRID,XLXSJGBYZZB_WHSJ)"); sql.Add(" values(:pJGBID,:pZXJMS,:pZXJMZ,:pYZID,:pYZZ,:pWHR,:pWHRID,:pWHSJ)"); sql.ParamByName("pJGBID").Value = sJGBID; sql.ParamByName("pZXJMS").Value = txtZXJMS.Value.ToString().Trim(); sql.ParamByName("pZXJMZ").Value = txtZXJMZ.Value.ToString().Trim(); sql.ParamByName("pWHR").Value = tSession.UserName; sql.ParamByName("pWHRID").Value = tSession.UserId; sql.ParamByName("pWHSJ").Value = tNow; if (sTJYZList[i].StartsWith("JZ01|")) { sql.ParamByName("pYZID").Value = "JZ01"; sql.ParamByName("pYZZ").Value = txtTJYZ1.Value; dberp.ExecSQL(sql); } else if (sTJYZList[i].StartsWith("JZ02|")) { sql.ParamByName("pYZID").Value = "JZ02"; sql.ParamByName("pYZZ").Value = txtTJYZ2.Value; dberp.ExecSQL(sql); } else if (sTJYZList[i].StartsWith("JZ03|")) { sql.ParamByName("pYZID").Value = "JZ03"; sql.ParamByName("pYZZ").Value = txtTJYZ3.Value; dberp.ExecSQL(sql); } else if (sTJYZList[i].StartsWith("JZ04|")) { sql.ParamByName("pYZID").Value = "JZ04"; sql.ParamByName("pYZZ").Value = txtTJYZ4.Value; dberp.ExecSQL(sql); } else if (sTJYZList[i].StartsWith("JZ05|")) { sql.ParamByName("pYZID").Value = "JZ05"; sql.ParamByName("pYZZ").Value = txtTJYZ5.Value; dberp.ExecSQL(sql); } else if (sTJYZList[i].StartsWith("JZ06|")) { sql.ParamByName("pYZID").Value = "JZ06"; sql.ParamByName("pYZZ").Value = txtTJYZ6.Value; dberp.ExecSQL(sql); } else if (sTJYZList[i].StartsWith("JZ07|")) { sql.ParamByName("pYZID").Value = "JZ07"; sql.ParamByName("pYZZ").Value = txtTJYZ7.Value; dberp.ExecSQL(sql); } else if (sTJYZList[i].StartsWith("JZ08|")) { sql.ParamByName("pYZID").Value = "JZ08"; sql.ParamByName("pYZZ").Value = txtTJYZ8.Value; dberp.ExecSQL(sql); } else if (sTJYZList[i].StartsWith("JZ09|")) { sql.ParamByName("pYZID").Value = "JZ09"; sql.ParamByName("pYZZ").Value = txtTJYZ9.Value; dberp.ExecSQL(sql); } else if (sTJYZList[i].StartsWith("JZ10|")) { sql.ParamByName("pYZID").Value = "JZ10"; sql.ParamByName("pYZZ").Value = txtTJYZ10.Value; dberp.ExecSQL(sql); } } #endregion return base.Master_AfterSaveAction(sender, e); } #endregion #region 自定义函数 private void InitControls() { txtYZID.Value = PageParam.GetRTrimString("FirstYZID"); } private void SetTJYZLable() { string[] sTJYZList = PageParam.GetRTrimString("TJYZList").Split(','); for (int i = 0; i < sTJYZList.Length; i++) { if (sTJYZList[i].StartsWith("JZ01|")) { lblTJYZ1.Text = sTJYZList[i].Replace("JZ01|", "") + ":"; } else if (sTJYZList[i].StartsWith("JZ02|")) { lblTJYZ2.Text = sTJYZList[i].Replace("JZ02|", "") + ":"; } else if (sTJYZList[i].StartsWith("JZ03|")) { lblTJYZ3.Text = sTJYZList[i].Replace("JZ03|", "") + ":"; } else if (sTJYZList[i].StartsWith("JZ04|")) { lblTJYZ4.Text = sTJYZList[i].Replace("JZ04|", "") + ":"; } else if (sTJYZList[i].StartsWith("JZ05|")) { lblTJYZ5.Text = sTJYZList[i].Replace("JZ05|", "") + ":"; } else if (sTJYZList[i].StartsWith("JZ06|")) { lblTJYZ6.Text = sTJYZList[i].Replace("JZ06|", "") + ":"; } else if (sTJYZList[i].StartsWith("JZ07|")) { lblTJYZ7.Text = sTJYZList[i].Replace("JZ07|", "") + ":"; } else if (sTJYZList[i].StartsWith("JZ08|")) { lblTJYZ8.Text = sTJYZList[i].Replace("JZ08|", "") + ":"; } else if (sTJYZList[i].StartsWith("JZ09|")) { lblTJYZ9.Text = sTJYZList[i].Replace("JZ09|", "") + ":"; } else if (sTJYZList[i].StartsWith("JZ10|")) { lblTJYZ10.Text = sTJYZList[i].Replace("JZ10|", "") + ":"; } } } private int GetXSWS(string sYZID) { int iXSWS = 2; TDatabase dberp = TContextDatabases.GetDatabase("DBERP"); TSQL SQL = new TSQL(dberp); SQL.Clear(); SQL.Add("select XLXSTZYZ_YZID, XLXSTZYZ_YZMC, XLXSTZYZ_JJFS "); SQL.Add(" from XLXSTZYZ"); SQL.Add(" where XLXSTZYZ_MXBH = 'JZJ' and XLXSTZYZ_TJYS='B' "); SQL.Add(" and XLXSTZYZ_YZID = :pYZID "); SQL.ParamByName("pYZID").Value = sYZID; DataSet ds = dberp.OpenDataSet(SQL); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["XLXSTZYZ_JJFS"].ToString().Trim().Equals("JJ")) iXSWS = 5; } return iXSWS; } #endregion #region 控件事件 #endregion } }