protected virtual void InitData(){ if (m_xl==null) { return; } IList<PS_tj> tjList = new List<PS_tj>(); IList<mOrg> orgList = Client.ClientHelper.PlatformSqlMap.GetList<mOrg>("where orgcode='" + m_xl.OrgCode + "'"); mOrg org = null; string strOwner = ""; if (orgList.Count>0) { org = orgList[0]; strOwner = org.OrgName; } IList gtSBList = Client.ClientHelper.PlatformSqlMap.GetList("GetPS_gtsbRowCountByWhere", ",PS_gt,PS_xl,mOrg where PS_gtsb.gtID = PS_gt.gtID and PS_gt.LineCode = PS_xl.LineCode and PS_xl.OrgCode = mOrg.OrgCode and PS_xl.LineCode = '" + m_xl.LineCode + "' group by sbModle,sbName"); //IList tqSBList = Client.ClientHelper.PlatformSqlMap.GetList("GetPS_tqsbRowCountByWhere", ",PS_tq,PS_xl,mOrg where PS_tqsb.tqID = PS_tq.tqID and PS_tq.xlCode = PS_xl.LineCode and PS_xl.OrgCode = mOrg.OrgCode and PS_xl.LineCode = '" + str.Trim() + "' group by sbModle,sbName"); foreach (object[] ob in gtSBList) { PS_tj tj = new PS_tj(); tj.SmOrg = strOwner; tj.SbOwner = m_xl.LineName; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } gridControl1.DataSource = tjList; // foreach (GridColumn c in gridView1.Columns) // { // c.Visible = false; // // } try { gridView1.Columns["SmOrg"].Visible = false; //gridView1.Columns["SbType"].Visible = true; //gridView1.Columns["SBNumber"].Visible = true; gridView1.Columns["SbOwner"].VisibleIndex = 0; gridView1.Columns["SbOwner"].Caption = "线路"; gridView1.Columns["SbName"].VisibleIndex = 1; gridView1.Columns["SbType"].VisibleIndex = 2; gridView1.Columns["SBNumber"].VisibleIndex = 3; } catch { } // foreach (object[] ob in tqSBList) // { // PS_tj tj = new PS_tj(); // string strOwner = repositoryItemCheckedComboBoxEdit3.GetDisplayText(str).Trim(); // tj.SmOrg = btGdsList.Edit.GetDisplayText(btGdsList.EditValue); // tj.SbOwner = strOwner; // tj.SBNumber = Convert.ToInt32(ob[0]); // tj.SbType = ob[1].ToString(); // tj.SbName = ob[2].ToString(); // tjList.Add(tj); // } }
protected virtual void InitData() { IList<PS_tj> tjList = new List<PS_tj>(); IList<PS_xl> xlList = new List<PS_xl>(); strGtID = null; int maxLength = 8; StringBuilder sb = new StringBuilder(); //sb.Append("设备名称\t设备类型\t设备数量\r\n"); foreach (PS_gt gt in gtList) { if (string.IsNullOrEmpty(strGtID)) { strGtID += "(" + "'" + gt.gtID + "'"; } else { strGtID += "," + "'" + gt.gtID + "'"; } IList<PS_xl> xlListTemp = Client.ClientHelper.PlatformSqlMap.GetList<PS_xl>("SelectPS_xlList"," where linecode = '" + gt.LineCode +"'"); foreach (PS_xl xl in xlListTemp) { xlList.Add(xl); if (string.IsNullOrEmpty(strLineCode)) { strLineCode += "(" + "'" + xl.LineCode + "'"; } else { strLineCode += "," + "'" + xl.LineCode + "'"; } } //sb.AppendLine(gt.gtCode); } if (string.IsNullOrEmpty(strGtID)) { strGtID = "()"; } else { strGtID += ")"; } if (string.IsNullOrEmpty(strLineCode)) { strLineCode = "()"; } else { strLineCode += ")"; } IList gtSBList = Client.ClientHelper.PlatformSqlMap.GetList("GetPS_gtsbRowCountByWhere", ",PS_gt where PS_gtsb.gtID = PS_gt.gtID and PS_gt.gtID in " + strGtID + " group by sbModle,sbName"); foreach (object[] ob in gtSBList) { if (ob[1].ToString().Length > maxLength) { maxLength = ob[1].ToString().Length; } if (ob[2].ToString().Length > maxLength) { maxLength = ob[2].ToString().Length; } //sb.Append(ob[2].ToString() + "\t" + ob[1].ToString() + "\t" + ob[0].ToString() + "\r\n"); PS_tj tj = new PS_tj(); tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } // IList byqCount = Client.ClientHelper.PlatformSqlMap.GetList("GetPS_tqbyqRowCountByWhere", ",PS_tq where PS_tqbyq.tqID = PS_tq.tqID and PS_tq.tqID in " + strLineCode + " group by byqModle,byqName"); // foreach (object[] ob in byqCount) // { // if (ob[1].ToString().Length > maxLength) // { // maxLength = ob[1].ToString().Length; // } // if (ob[2].ToString().Length > maxLength) // { // maxLength = ob[2].ToString().Length; // } // sb.Append(ob[2].ToString() + "\t" + ob[1].ToString() + "\t" + ob[0].ToString() + "\r\n"); // PS_tj tj = new PS_tj(); // tj.SBNumber = Convert.ToInt32(ob[0]); // tj.SbType = ob[1].ToString(); // tj.SbName = ob[2].ToString(); // tjList.Add(tj); // } IList gtCount = Client.ClientHelper.PlatformSqlMap.GetList("GetPS_gtRowCountByWhere", " where gtID in " + strGtID + " group by gtType, gtModle"); foreach (object[] ob in gtCount) { if (ob[1].ToString().Length > maxLength) { maxLength = ob[1].ToString().Length; } if (ob[2].ToString().Length > maxLength) { maxLength = ob[2].ToString().Length; } //sb.Append(ob[2].ToString() + "\t" + ob[1].ToString() + "\t" + ob[0].ToString() + "\r\n"); PS_tj tj = new PS_tj(); tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } IList tqCount = Client.ClientHelper.PlatformSqlMap.GetList("GetPS_tqRowCount", ",ps_gt where ps_tq.gtid=ps_gt.gtid and ps_gt.gtid in " + strGtID); if (tqCount.Count > 0) { //sb.Append("台区" + "\t" + "台区数量" + "\t" + tqCount[0].ToString()); PS_tj tj = new PS_tj(); tj.SBNumber = Convert.ToInt32(tqCount[0].ToString()); tj.SbType = "台区数量"; tj.SbName = "台区"; tjList.Add(tj); } IList byqCount = Client.ClientHelper.PlatformSqlMap.GetList("GetPS_tqbyqRowCount", ",PS_tq where PS_tqbyq.tqID = PS_tq.tqID and PS_tq.gtid in " + strGtID); if (byqCount.Count > 0) { //sb.Append("变压器" + "\t" + "变压器数量" + "\t" + byqCount[0].ToString()); PS_tj tj = new PS_tj(); tj.SBNumber = Convert.ToInt32(byqCount[0].ToString()); tj.SbType = "变压器数量"; tj.SbName = "变压器"; tjList.Add(tj); } IList gtCountSum = Client.ClientHelper.PlatformSqlMap.GetList("GetPS_gtRowCount", " where gtID in " + strGtID); if (gtCountSum.Count > 0) { //sb.Append("杆塔" + "\t" + "杆塔数量" + "\t" + gtCountSum[0].ToString()); PS_tj tj = new PS_tj(); tj.SBNumber = Convert.ToInt32(gtCountSum[0].ToString()); tj.SbType = "杆塔数量"; tj.SbName = "杆塔"; tjList.Add(tj); } IList xlLength = Client.ClientHelper.PlatformSqlMap.GetList("GetPS_xlLengthByWhere", " where gtID in " + strGtID); if (xlLength.Count > 0) { //sb.Append("线路" + "\t" + "线路长度" + "\t" + xlLength[0].ToString() + "米"); PS_tj tj = new PS_tj(); tj.SBNumber = (int)Convert.ToDouble(xlLength[0].ToString()); tj.SbType = "线路长度(米)"; tj.SbName = "线路"; tjList.Add(tj); } gridControl1.DataSource = tjList; // foreach (GridColumn c in gridView1.Columns) // { // c.Visible = false; // // } try { gridView1.Columns["SmOrg"].Visible = false; //gridView1.Columns["SbType"].Visible = true; //gridView1.Columns["SBNumber"].Visible = true; gridView1.Columns["SbOwner"].Visible = false; gridView1.Columns["SbOwner"].Caption = "线路"; gridView1.Columns["SbName"].VisibleIndex = 0; gridView1.Columns["SbType"].VisibleIndex = 1; gridView1.Columns["SBNumber"].VisibleIndex = 2; } catch { } // foreach (object[] ob in tqSBList) // { // PS_tj tj = new PS_tj(); // string strOwner = repositoryItemCheckedComboBoxEdit3.GetDisplayText(str).Trim(); // tj.SmOrg = btGdsList.Edit.GetDisplayText(btGdsList.EditValue); // tj.SbOwner = strOwner; // tj.SBNumber = Convert.ToInt32(ob[0]); // tj.SbType = ob[1].ToString(); // tj.SbName = ob[2].ToString(); // tjList.Add(tj); // } }
/// <summary> /// 刷新数据 /// </summary> /// <param name="stTtype">刷新类型:GDS(按单位),XL(按线路),TQ(按台区),SB(按设备)</param> private void RefreshGridControlData(string stTtype) { IList tqSBList = new List<object[]>(); IList gtSBList = new List<object[]>(); IList byqSBList = new List<object[]>(); IList<string> xlStringList = new List<string>(); IList<string> tqStringList = new List<string>(); tjList.Clear(); switch (stTtype) { case "GDS": if (btGdsList.EditValue!=null) { IList<mOrg> list = Client.ClientHelper.PlatformSqlMap.GetList<mOrg>("where orgcode='" + btGdsList.EditValue + "'"); mOrg org = null; if (list.Count > 0) { org = list[0]; } else { IList<sd_xl> xlList = Client.ClientHelper.PlatformSqlMap.GetListByWhere<sd_xl>(" where LEN(lineCode) = 6"); repositoryItemCheckedComboBoxEdit3.DataSource = xlList; repositoryItemCheckedComboBoxEdit3.DisplayMember = "LineName"; repositoryItemCheckedComboBoxEdit3.ValueMember = "LineCode"; //IList<sd_tq> listTQ = Client.ClientHelper.PlatformSqlMap.GetList<sd_tq>("Selectsd_tqListByWhere", ",sd_xl,mOrg where sd_tq.xlCode = sd_xl.LineCode and sd_xl.OrgCode = mOrg.OrgCode"); //repositoryItemCheckedComboBoxEdit2.DataSource = listTQ; //repositoryItemCheckedComboBoxEdit2.DisplayMember = "tqName"; //repositoryItemCheckedComboBoxEdit2.ValueMember = "tqID"; gtSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_gtsbRowCountByWhere", " Where sbName in " + getSelectSbName() + " group by sbModle,sbName"); //tqSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_tqsbRowCountByWhere", " Where sbName in " + getSelectSbName() + " group by sbModle,sbName"); // IList tqDLBHSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_tqdlbhRowCountByWhere", " Where sbName in " + getSelectSbName() + " group by sbModle,sbName"); //byqSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_tqbyqRowCountByWhere"," group by byqModle,byqName"); foreach (object[] ob in gtSBList) { PS_tj tj = new PS_tj(); tj.SmOrg = "全局"; tj.SbOwner = "全局"; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } foreach (object[] ob in tqSBList) { PS_tj tj = new PS_tj(); tj.SmOrg = "全局"; tj.SbOwner = "全局"; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } foreach (object[] ob in byqSBList) { PS_tj tj = new PS_tj(); tj.SmOrg = "全局"; tj.SbOwner = "全局"; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } } if (org != null) { IList<sd_xl> xlList = Client.ClientHelper.PlatformSqlMap.GetListByWhere<sd_xl>(" where LEN(lineCode) = 6 and OrgCode='" + org.OrgCode + "'"); repositoryItemCheckedComboBoxEdit3.DataSource = xlList; repositoryItemCheckedComboBoxEdit3.DisplayMember = "LineName"; repositoryItemCheckedComboBoxEdit3.ValueMember = "LineCode"; //IList<sd_tq> listTQ = Client.ClientHelper.PlatformSqlMap.GetList<sd_tq>("Selectsd_tqListByWhere", ",sd_xl,mOrg where sd_tq.xlCode = sd_xl.LineCode and sd_xl.OrgCode = mOrg.OrgCode and mOrg.OrgCode='" + org.OrgCode + "'"); //repositoryItemCheckedComboBoxEdit2.DataSource = listTQ; //repositoryItemCheckedComboBoxEdit2.DisplayMember = "tqName"; //repositoryItemCheckedComboBoxEdit2.ValueMember = "tqID"; gtSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_gtsbRowCountByWhere", ",sd_gt,sd_xl,mOrg where sd_gtsb.gtID = sd_gt.gtID and sd_gt.LineCode = sd_xl.LineCode and sd_xl.OrgCode = mOrg.OrgCode and mOrg.OrgCode = '" + org.OrgCode + "' and sbName in " + getSelectSbName() + " group by sbModle,sbName"); //tqSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_tqsbRowCountByWhere", ",sd_tq,sd_xl,mOrg where sd_tqsb.tqID = sd_tq.tqID and sd_tq.xlCode = sd_xl.LineCode and sd_xl.OrgCode = mOrg.OrgCode and mOrg.OrgCode = '" + org.OrgCode + "' and sbName in " + getSelectSbName() + " group by sbModle,sbName"); //byqSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_tqbyqRowCountByWhere", ",sd_tq,sd_xl,mOrg where sd_tqbyq.tqID = sd_tq.tqID and sd_tq.xlCode = sd_xl.LineCode and sd_xl.OrgCode = mOrg.OrgCode and mOrg.OrgCode = '" + org.OrgCode + "' group by byqModle,byqName"); foreach (object[] ob in gtSBList) { PS_tj tj = new PS_tj(); tj.SmOrg = org.OrgName; tj.SbOwner = "全所"; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } foreach (object[] ob in tqSBList) { PS_tj tj = new PS_tj(); tj.SmOrg = org.OrgName; tj.SbOwner = "全所"; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } foreach (object[] ob in byqSBList) { PS_tj tj = new PS_tj(); tj.SmOrg = org.OrgName; tj.SbOwner = "全所"; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } } } break; case "XL": if (!string.IsNullOrEmpty(repositoryItemCheckedComboBoxEdit3.GetCheckedItems().ToString())) { xlStringList = repositoryItemCheckedComboBoxEdit3.GetCheckedItems().ToString().Split(new char[]{','}); foreach (string str in xlStringList) { gtSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_gtsbRowCountByWhere", ",sd_gt,sd_xl,mOrg where sd_gtsb.gtID = sd_gt.gtID and sd_gt.LineCode = sd_xl.LineCode and sd_xl.OrgCode = mOrg.OrgCode and sd_xl.LineCode like '" + str.Trim() + "%' and sbName in " + getSelectSbName() + " group by sbModle,sbName"); //tqSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_tqsbRowCountByWhere", ",sd_tq,sd_xl,mOrg where sd_tqsb.tqID = sd_tq.tqID and sd_tq.xlCode = sd_xl.LineCode and sd_xl.OrgCode = mOrg.OrgCode and sd_xl.LineCode like '" + str.Trim() + "%' and sbName in " + getSelectSbName() + " group by sbModle,sbName"); //byqSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_tqbyqRowCountByWhere", ",sd_tq,sd_xl,mOrg where sd_tqbyq.tqID = sd_tq.tqID and sd_tq.xlCode = sd_xl.LineCode and sd_xl.OrgCode = mOrg.OrgCode and sd_xl.LineCode like '" + str.Trim() + "%' group by byqModle,byqName"); foreach (object[] ob in gtSBList) { PS_tj tj = new PS_tj(); string strOwner = repositoryItemCheckedComboBoxEdit3.GetDisplayText(str).Trim(); tj.SmOrg = btGdsList.Edit.GetDisplayText(btGdsList.EditValue); tj.SbOwner = strOwner; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } foreach (object[] ob in tqSBList) { PS_tj tj = new PS_tj(); string strOwner = repositoryItemCheckedComboBoxEdit3.GetDisplayText(str).Trim(); tj.SmOrg = btGdsList.Edit.GetDisplayText(btGdsList.EditValue); tj.SbOwner = strOwner; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } foreach (object[] ob in byqSBList) { PS_tj tj = new PS_tj(); string strOwner = repositoryItemCheckedComboBoxEdit3.GetDisplayText(str).Trim(); tj.SmOrg = btGdsList.Edit.GetDisplayText(btGdsList.EditValue); tj.SbOwner = strOwner; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } } } else { RefreshGridControlData("SB"); } break; case "TQ": //if (!string.IsNullOrEmpty(repositoryItemCheckedComboBoxEdit2.GetCheckedItems().ToString())) //{ // tqStringList = repositoryItemCheckedComboBoxEdit2.GetCheckedItems().ToString().Split(new char[]{','}); // foreach (string str in tqStringList) // { // gtSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_gtsbRowCountByWhere", ",sd_gt,sd_xl,mOrg where sd_gtsb.gtID = sd_gt.gtID and sd_gt.LineCode = sd_xl.LineCode and sd_xl.OrgCode = mOrg.OrgCode and sd_xl.LineCode like '" + str.Trim() + "%' and linevol='0.4' and sbName in " + getSelectSbName() + " group by sbModle,sbName"); // //tqSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_tqsbRowCountByWhere", ",sd_tq,sd_xl,mOrg where sd_tqsb.tqID = sd_tq.tqID and sd_tq.xlCode = sd_xl.LineCode and sd_xl.OrgCode = mOrg.OrgCode and sd_xl.LineCode like '" + str.Trim() + "%' and sbName in " + getSelectSbName() + " group by sbModle,sbName"); // tqSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_tqsbRowCountByWhere", ",sd_tq where sd_tqsb.tqID = sd_tq.tqID and sd_tq.tqID = '" +str.Trim() + "' and sbName in " + getSelectSbName() + " group by sbModle,sbName"); // byqSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_tqbyqRowCountByWhere", ",sd_tq,sd_xl,mOrg where sd_tqbyq.tqID = sd_tq.tqID and sd_tq.xlCode = sd_xl.LineCode and sd_xl.OrgCode = mOrg.OrgCode and sd_tq.tqID = '" + str.Trim() + "' group by byqModle,byqName"); // foreach (object[] ob in gtSBList) // { // PS_tj tj = new PS_tj(); // string strOwner = repositoryItemCheckedComboBoxEdit2.GetDisplayText(str).Trim(); // tj.SmOrg = btGdsList.Edit.GetDisplayText(btGdsList.EditValue); // tj.SbOwner = strOwner; // tj.SBNumber = Convert.ToInt32(ob[0]); // tj.SbType = ob[1].ToString(); // tj.SbName = ob[2].ToString(); // tjList.Add(tj); // } // foreach (object[] ob in tqSBList) // { // PS_tj tj = new PS_tj(); // string strOwner = repositoryItemCheckedComboBoxEdit2.GetDisplayText(str).Trim(); // tj.SmOrg = btGdsList.Edit.GetDisplayText(btGdsList.EditValue); // tj.SbOwner = strOwner; // tj.SBNumber = Convert.ToInt32(ob[0]); // tj.SbType = ob[1].ToString(); // tj.SbName = ob[2].ToString(); // tjList.Add(tj); // } // foreach (object[] ob in byqSBList) // { // PS_tj tj = new PS_tj(); // string strOwner = repositoryItemCheckedComboBoxEdit2.GetDisplayText(str).Trim(); // tj.SmOrg = btGdsList.Edit.GetDisplayText(btGdsList.EditValue); // tj.SbOwner = strOwner; // tj.SBNumber = Convert.ToInt32(ob[0]); // tj.SbType = ob[1].ToString(); // tj.SbName = ob[2].ToString(); // tjList.Add(tj); // } // } // } //else //{ // RefreshGridControlData("SB"); //} break; case "SB": if (!string.IsNullOrEmpty(repositoryItemCheckedComboBoxEdit2.GetCheckedItems().ToString())) { tqStringList = repositoryItemCheckedComboBoxEdit2.GetCheckedItems().ToString().Split(new char[] { ',' }); foreach (string str in tqStringList) { gtSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_gtsbRowCountByWhere", ",sd_gt,sd_xl,mOrg where sd_gtsb.gtID = sd_gt.gtID and sd_gt.LineCode = sd_xl.LineCode and sd_xl.OrgCode = mOrg.OrgCode and sd_xl.LineCode like '" + str.Trim() + "%' and linevol='0.4' and sbName in " + getSelectSbName() + " group by sbModle,sbName"); tqSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_tqsbRowCountByWhere", ",sd_tq where sd_tqsb.tqID = sd_tq.tqID and sd_tq.tqID = '" + str.Trim() + "' and sbName in " + getSelectSbName() + " group by sbModle,sbName"); byqSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_tqbyqRowCountByWhere", ",sd_tq,sd_xl,mOrg where sd_tqbyq.tqID = sd_tq.tqID and sd_tq.xlCode = sd_xl.LineCode and sd_xl.OrgCode = mOrg.OrgCode and sd_tq.tqID = '" + str.Trim() + "' group by byqModle,byqName"); foreach (object[] ob in gtSBList) { PS_tj tj = new PS_tj(); string strOwner = repositoryItemCheckedComboBoxEdit2.GetDisplayText(str).Trim(); tj.SmOrg = btGdsList.Edit.GetDisplayText(btGdsList.EditValue); tj.SbOwner = strOwner; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } foreach (object[] ob in tqSBList) { PS_tj tj = new PS_tj(); string strOwner = repositoryItemCheckedComboBoxEdit2.GetDisplayText(str).Trim(); tj.SmOrg = btGdsList.Edit.GetDisplayText(btGdsList.EditValue); tj.SbOwner = strOwner; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } foreach (object[] ob in byqSBList) { PS_tj tj = new PS_tj(); string strOwner = repositoryItemCheckedComboBoxEdit2.GetDisplayText(str).Trim(); tj.SmOrg = btGdsList.Edit.GetDisplayText(btGdsList.EditValue); tj.SbOwner = strOwner; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } } } else if (!string.IsNullOrEmpty(repositoryItemCheckedComboBoxEdit3.GetCheckedItems().ToString())) { xlStringList = repositoryItemCheckedComboBoxEdit3.GetCheckedItems().ToString().Split(new char[] { ',' }); foreach (string str in xlStringList) { gtSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_gtsbRowCountByWhere", ",sd_gt,sd_xl,mOrg where sd_gtsb.gtID = sd_gt.gtID and sd_gt.LineCode = sd_xl.LineCode and sd_xl.OrgCode = mOrg.OrgCode and sd_xl.LineCode like '" + str.Trim() + "%' and sbName in " + getSelectSbName() + " group by sbModle,sbName"); //tqSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_tqsbRowCountByWhere", ",sd_tq,sd_xl,mOrg where sd_tqsb.tqID = sd_tq.tqID and sd_tq.xlCode = sd_xl.LineCode and sd_xl.OrgCode = mOrg.OrgCode and sd_xl.LineCode like '" + str.Trim() + "%' and sbName in " + getSelectSbName() + " group by sbModle,sbName"); //byqSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_tqbyqRowCountByWhere", ",sd_tq,sd_xl,mOrg where sd_tqbyq.tqID = sd_tq.tqID and sd_tq.xlCode = sd_xl.LineCode and sd_xl.OrgCode = mOrg.OrgCode and sd_xl.LineCode like '" + str.Trim() + "%' group by byqModle,byqName"); foreach (object[] ob in gtSBList) { PS_tj tj = new PS_tj(); string strOwner = repositoryItemCheckedComboBoxEdit3.GetDisplayText(str).Trim(); tj.SmOrg = btGdsList.Edit.GetDisplayText(btGdsList.EditValue); tj.SbOwner = strOwner; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } foreach (object[] ob in tqSBList) { PS_tj tj = new PS_tj(); string strOwner = repositoryItemCheckedComboBoxEdit3.GetDisplayText(str).Trim(); tj.SmOrg = btGdsList.Edit.GetDisplayText(btGdsList.EditValue); tj.SbOwner = strOwner; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } foreach (object[] ob in byqSBList) { PS_tj tj = new PS_tj(); string strOwner = repositoryItemCheckedComboBoxEdit3.GetDisplayText(str).Trim(); tj.SmOrg = btGdsList.Edit.GetDisplayText(btGdsList.EditValue); tj.SbOwner = strOwner; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } } } else if (btGdsList.EditValue != null) { IList<mOrg> list = Client.ClientHelper.PlatformSqlMap.GetList<mOrg>("where orgcode='" + btGdsList.EditValue + "'"); mOrg org = null; if (list.Count > 0) { org = list[0]; } else { gtSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_gtsbRowCountByWhere", " Where sbName in " + getSelectSbName() + " group by sbModle,sbName"); //tqSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_tqsbRowCountByWhere", " Where sbName in " + getSelectSbName() + " group by sbModle,sbName"); //byqSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_tqbyqRowCountByWhere", " group by byqModle,byqName"); foreach (object[] ob in gtSBList) { PS_tj tj = new PS_tj(); tj.SmOrg = "全局"; tj.SbOwner = "全局"; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } foreach (object[] ob in tqSBList) { PS_tj tj = new PS_tj(); tj.SmOrg = "全局"; tj.SbOwner = "全局"; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } foreach (object[] ob in byqSBList) { PS_tj tj = new PS_tj(); tj.SmOrg = "全局"; tj.SbOwner = "全局"; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } } if (org != null) { gtSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_gtsbRowCountByWhere", ",sd_gt,sd_xl,mOrg where sd_gtsb.gtID = sd_gt.gtID and sd_gt.LineCode = sd_xl.LineCode and sd_xl.OrgCode = mOrg.OrgCode and mOrg.OrgCode = '" + org.OrgCode + "' and sbName in " + getSelectSbName() + " group by sbModle,sbName"); //tqSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_tqsbRowCountByWhere", ",sd_tq,sd_xl,mOrg where sd_tqsb.tqID = sd_tq.tqID and sd_tq.xlCode = sd_xl.LineCode and sd_xl.OrgCode = mOrg.OrgCode and mOrg.OrgCode = '" + org.OrgCode + "' and sbName in " + getSelectSbName() + " group by sbModle,sbName"); //byqSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_tqbyqRowCountByWhere", ",sd_tq,sd_xl,mOrg where sd_tqbyq.tqID = sd_tq.tqID and sd_tq.xlCode = sd_xl.LineCode and sd_xl.OrgCode = mOrg.OrgCode and mOrg.OrgCode = '" + org.OrgCode + "' group by byqModle,byqName"); foreach (object[] ob in gtSBList) { PS_tj tj = new PS_tj(); tj.SmOrg = org.OrgName; tj.SbOwner = "全所"; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } foreach (object[] ob in tqSBList) { PS_tj tj = new PS_tj(); tj.SmOrg = org.OrgName; tj.SbOwner = "全所"; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } foreach (object[] ob in byqSBList) { PS_tj tj = new PS_tj(); tj.SmOrg = org.OrgName; tj.SbOwner = "全所"; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } } } break; default: { IList<mOrg> list = Client.ClientHelper.PlatformSqlMap.GetList<mOrg>("where orgcode='" + btGdsList.EditValue + "'"); mOrg org = null; if (list.Count > 0) { org = list[0]; } else { gtSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_gtsbRowCountByWhere", " Where sbName in " + getSelectSbName() + " group by sbModle,sbName"); //tqSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_tqsbRowCountByWhere", " Where sbName in " + getSelectSbName() + " group by sbModle,sbName"); //byqSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_tqbyqRowCountByWhere", " group by byqModle,byqName"); foreach (object[] ob in gtSBList) { PS_tj tj = new PS_tj(); tj.SmOrg = "全局"; tj.SbOwner = "全局"; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } foreach (object[] ob in tqSBList) { PS_tj tj = new PS_tj(); tj.SmOrg = "全局"; tj.SbOwner = "全局"; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } foreach (object[] ob in byqSBList) { PS_tj tj = new PS_tj(); tj.SmOrg = "全局"; tj.SbOwner = "全局"; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } } if (org != null) { gtSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_gtsbRowCountByWhere", ",sd_gt,sd_xl,mOrg where sd_gtsb.gtID = sd_gt.gtID and sd_gt.LineCode = sd_xl.LineCode and sd_xl.OrgCode = mOrg.OrgCode and mOrg.OrgCode = '" + org.OrgCode + "' and sbName in " + getSelectSbName() + " group by sbModle,sbName"); //tqSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_tqsbRowCountByWhere", ",sd_tq,sd_xl,mOrg where sd_tqsb.tqID = sd_tq.tqID and sd_tq.xlCode = sd_xl.LineCode and sd_xl.OrgCode = mOrg.OrgCode and mOrg.OrgCode = '" + org.OrgCode + "' and sbName in " + getSelectSbName() + " group by sbModle,sbName"); //byqSBList = Client.ClientHelper.PlatformSqlMap.GetList("Getsd_tqbyqRowCountByWhere", ",sd_tq,sd_xl,mOrg where sd_tqbyq.tqID = sd_tq.tqID and sd_tq.xlCode = sd_xl.LineCode and sd_xl.OrgCode = mOrg.OrgCode and mOrg.OrgCode = '" + org.OrgCode + "' group by byqModle,byqName"); foreach (object[] ob in gtSBList) { PS_tj tj = new PS_tj(); tj.SmOrg = org.OrgName; tj.SbOwner = "全所"; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } foreach (object[] ob in tqSBList) { PS_tj tj = new PS_tj(); tj.SmOrg = org.OrgName; tj.SbOwner = "全所"; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } foreach (object[] ob in byqSBList) { PS_tj tj = new PS_tj(); tj.SmOrg = org.OrgName; tj.SbOwner = "全所"; tj.SBNumber = Convert.ToInt32(ob[0]); tj.SbType = ob[1].ToString(); tj.SbName = ob[2].ToString(); tjList.Add(tj); } } } break; } gridControl1.BeginInit(); gridControl1.DataSource = tjList; gridView1.Columns["SbOwner"].Caption = "线路"; gridControl1.EndInit(); }