public UCSharpeDyt(string tqCode) { InitializeComponent(); _tq = ClientHelper.PlatformSqlMap.GetOne<PS_tq>("where tqcode='" + tqCode + "'"); InitTree(); createCheckGroup(); }
private void simpleButton1_Click(object sender, EventArgs e) { //查询 btnOK.Enabled = false; xl = null; xl = Client.ClientHelper.PlatformSqlMap.GetOne<PS_tq>(string.Format("where tqcode='{0}'", txOldCode.Text.Trim())); if (xl != null) { StringBuilder sb = new StringBuilder(); sb.AppendLine("台区代码:" + xl.tqCode); sb.AppendLine("台区名称:" + xl.tqName); sb.AppendLine("所在线路代码:" + xl.xlCode); sb.AppendLine("所在分支线路代码:" + xl.xlCode2); var xlnum = Client.ClientHelper.PlatformSqlMap.GetRowCount<PS_xl>(string.Format("where linecode like '{0}%' and linevol='0.4'", xl.tqCode)); sb.AppendLine("台区线路数:" + xlnum); var gtnum = Client.ClientHelper.PlatformSqlMap.GetRowCount<PS_gt>(string.Format("where linecode in (select linecode from ps_xl where linecode like '{0}%' and linevol='0.4')", xl.tqCode)); sb.AppendLine("线路杆塔基数:" +gtnum); btnOK.Enabled = true; memoEdit1.Text = sb.ToString(); } }
/// <summary> /// 新建对象设置Key值 /// </summary> /// <param name="newobj"></param> void gridViewOperation_CreatingObjectEvent(PS_tq newobj) { //if (parentID == null) return; if (gridView1.FocusedRowHandle > -1) { PS_tq tq = gridView1.GetFocusedRow() as PS_tq; Ebada.Core.ConvertHelper.CopyTo(tq, newobj); newobj.tqName = ""; } newobj.gtID = parentID; //newobj.tqCode = newobj.tqID = getcode(); newobj.tqID = newobj.CreateID(); newobj.tqCode = getcode(); }
private bool checktq(out PS_tq pstq) { pstq = null; if (ParentObj == null) return false; if (ParentObj.LineVol != "0.4") { MsgBox.ShowWarningMessageBox("此功能只对0.4kV线路有效!"); return false; } string linecode = ParentObj.LineCode.Substring(0, ParentObj.LineCode.Length - 3); PS_tq tq = ClientHelper.PlatformSqlMap.GetOne<PS_tq>("where tqcode='" + linecode + "'"); if (tq == null) { MsgBox.ShowTipMessageBox(string.Format("没有找到台区号为{{0}}的台区,请重新选择一级线路!", linecode)); return false; } pstq = tq; return true; }