public BillingRptParaClass(BillingRptPara pPara) { this.m_Txttitle = pPara.Txttitle; this.m_Txtwriter = pPara.Txtwriter; this.m_Dtptime = pPara.Dtptime; this.m_RptType = pPara.RptType; this.m_BeginText = pPara.BeginText; this.m_Cboduration = pPara.Cboduration; this.m_ret_list = this.getAnalysisGroup(pPara); }
private System.Collections.ArrayList getAnalysisGroup(BillingRptPara pPara) { System.Collections.ArrayList arrayList = new System.Collections.ArrayList(); foreach (ListViewItem listViewItem in pPara.Grouplist) { string text = System.Convert.ToString(listViewItem.Tag).Split(new char[] { '|' })[0]; string text2 = System.Convert.ToString(listViewItem.Tag).Split(new char[] { '|' })[1]; if (text2.Length == 0) { text2 = "0"; } string text3 = System.Convert.ToString(listViewItem.Tag).Split(new char[] { '|' })[2]; string text4 = listViewItem.SubItems[1].Text; string text5 = "0,"; string text6 = "0,"; string text7 = "0,"; System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); string key; switch (key = text3) { case "zone": { string str_sql = "select racks from zone_info where id in (" + text2 + ") and racks <>''"; DataTable dataTable = DBTools.CreateDataTable4SysDB(str_sql); text7 = "0,"; for (int i = 0; i < dataTable.Rows.Count; i++) { string str_sql2 = "select id as device_ids from device_base_info where rack_id in (" + System.Convert.ToString(dataTable.Rows[i]["racks"]) + ") "; DataTable dataTable2 = DBTools.CreateDataTable4SysDB(str_sql2); string text8 = ""; stringBuilder = new System.Text.StringBuilder(); for (int j = 0; j < dataTable2.Rows.Count; j++) { stringBuilder.Append(System.Convert.ToString(dataTable2.Rows[j]["device_ids"]) + ","); } text8 += stringBuilder.ToString(); if (text8.Length > 0) { text8 = text8.Substring(0, text8.Length - 1); } text7 = text7 + text8 + ","; } text7 = commUtil.uniqueIDs(text7); if (text7.Length > 0) { text5 = text7.Substring(0, text7.Length - 1); } if (text6.Length > 0) { text6 = text6.Substring(0, text6.Length - 1); } break; } case "rack": case "allrack": { string str_sql2 = "select id as device_ids from device_base_info where rack_id in (" + text2 + ")"; DataTable dataTable2 = DBTools.CreateDataTable4SysDB(str_sql2); stringBuilder = new System.Text.StringBuilder(); for (int k = 0; k < dataTable2.Rows.Count; k++) { stringBuilder.Append(System.Convert.ToString(dataTable2.Rows[k]["device_ids"]) + ","); } text7 += stringBuilder.ToString(); if (text7.Length > 0) { text5 = text7.Substring(0, text7.Length - 1); } if (text6.Length > 0) { text6 = text6.Substring(0, text6.Length - 1); } break; } case "dev": case "alldev": { string str_sql2 = "select id,model_nm from device_base_info where id in (" + text2 + ")"; DataTable dataTable2 = DBTools.CreateDataTable4SysDB(str_sql2); stringBuilder = new System.Text.StringBuilder(); for (int l = 0; l < dataTable2.Rows.Count; l++) { stringBuilder.Append(System.Convert.ToString(dataTable2.Rows[l]["id"]) + ","); } text5 += stringBuilder.ToString(); if (text5.Length > 0) { text5 = text5.Substring(0, text5.Length - 1); } if (text6.Length > 0) { text6 = text6.Substring(0, text6.Length - 1); } break; } case "alloutlet": { text5 = "0"; string str_sql3 = "select a.id,b.model_nm,b.fw_version from port_info a left join device_base_info b on a.device_id=b.id where a.id in (select id from port_info)"; DataTable dataTable3 = DBTools.CreateDataTable4SysDB(str_sql3); stringBuilder = new System.Text.StringBuilder(); for (int m = 0; m < dataTable3.Rows.Count; m++) { string modelname = System.Convert.ToString(dataTable3.Rows[m]["model_nm"]); string fmwareVer = System.Convert.ToString(dataTable3.Rows[m]["fw_version"]); if (DevAccessCfg.GetInstance().getDeviceModelConfig(modelname, fmwareVer).perportreading == 2) { stringBuilder.Append(System.Convert.ToString(dataTable3.Rows[m]["id"]) + ","); } } text6 += stringBuilder.ToString(); if (text6.Length > 0) { text6 = text6.Substring(0, text6.Length - 1); } break; } case "outlet": { text5 = "0"; string str_sql3 = "select a.id,b.model_nm,b.fw_version from port_info a left join device_base_info b on a.device_id=b.id where a.id in (select dest_id from group_detail where grouptype='outlet' and group_id=" + text + ")"; DataTable dataTable3 = DBTools.CreateDataTable4SysDB(str_sql3); stringBuilder = new System.Text.StringBuilder(); for (int n = 0; n < dataTable3.Rows.Count; n++) { string modelname2 = System.Convert.ToString(dataTable3.Rows[n]["model_nm"]); string fmwareVer2 = System.Convert.ToString(dataTable3.Rows[n]["fw_version"]); if (DevAccessCfg.GetInstance().getDeviceModelConfig(modelname2, fmwareVer2).perportreading == 2) { stringBuilder.Append(System.Convert.ToString(dataTable3.Rows[n]["id"]) + ","); } } text6 += stringBuilder.ToString(); if (text6.Length > 0) { text6 = text6.Substring(0, text6.Length - 1); } break; } } arrayList.Add(string.Concat(new string[] { text5, "|", text, "|", text4, "|", text3.ToString(), "|", text6 })); } return(arrayList); }
private void InitializeComponent() { ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(Billing)); this.panel1 = new Panel(); this.flowLayoutPanelBillingPage = new FlowLayoutPanel(); this.butBillSetting = new Button(); this.butBillGenerate = new Button(); this.butBillRptMng = new Button(); this.panel2 = new Panel(); this.billingRptPara1 = new BillingRptPara(); this.billingSettings1 = new BillingSettings(); this.billingRptMng1 = new BillingRptMng(); this.billingRptShow1 = new BillingRptShow(); this.panel1.SuspendLayout(); this.flowLayoutPanelBillingPage.SuspendLayout(); this.panel2.SuspendLayout(); base.SuspendLayout(); this.panel1.BackColor = Color.Gainsboro; this.panel1.Controls.Add(this.flowLayoutPanelBillingPage); componentResourceManager.ApplyResources(this.panel1, "panel1"); this.panel1.Name = "panel1"; this.flowLayoutPanelBillingPage.BackColor = Color.Gainsboro; this.flowLayoutPanelBillingPage.Controls.Add(this.butBillSetting); this.flowLayoutPanelBillingPage.Controls.Add(this.butBillGenerate); this.flowLayoutPanelBillingPage.Controls.Add(this.butBillRptMng); componentResourceManager.ApplyResources(this.flowLayoutPanelBillingPage, "flowLayoutPanelBillingPage"); this.flowLayoutPanelBillingPage.Name = "flowLayoutPanelBillingPage"; componentResourceManager.ApplyResources(this.butBillSetting, "butBillSetting"); this.butBillSetting.MinimumSize = new Size(150, 27); this.butBillSetting.Name = "butBillSetting"; this.butBillSetting.Tag = "BillSetting"; this.butBillSetting.UseVisualStyleBackColor = true; this.butBillSetting.Click += new System.EventHandler(this.comm_butClick); componentResourceManager.ApplyResources(this.butBillGenerate, "butBillGenerate"); this.butBillGenerate.MinimumSize = new Size(150, 27); this.butBillGenerate.Name = "butBillGenerate"; this.butBillGenerate.Tag = "BillRpt"; this.butBillGenerate.UseVisualStyleBackColor = true; this.butBillGenerate.Click += new System.EventHandler(this.comm_butClick); componentResourceManager.ApplyResources(this.butBillRptMng, "butBillRptMng"); this.butBillRptMng.MinimumSize = new Size(150, 27); this.butBillRptMng.Name = "butBillRptMng"; this.butBillRptMng.Tag = "BillMng"; this.butBillRptMng.UseVisualStyleBackColor = true; this.butBillRptMng.Click += new System.EventHandler(this.comm_butClick); this.panel2.Controls.Add(this.billingRptPara1); this.panel2.Controls.Add(this.billingSettings1); this.panel2.Controls.Add(this.billingRptMng1); this.panel2.Controls.Add(this.billingRptShow1); componentResourceManager.ApplyResources(this.panel2, "panel2"); this.panel2.Name = "panel2"; this.billingRptPara1.BackColor = Color.WhiteSmoke; componentResourceManager.ApplyResources(this.billingRptPara1, "billingRptPara1"); this.billingRptPara1.Name = "billingRptPara1"; this.billingSettings1.BackColor = Color.WhiteSmoke; componentResourceManager.ApplyResources(this.billingSettings1, "billingSettings1"); this.billingSettings1.Name = "billingSettings1"; this.billingRptMng1.BackColor = Color.WhiteSmoke; componentResourceManager.ApplyResources(this.billingRptMng1, "billingRptMng1"); this.billingRptMng1.Name = "billingRptMng1"; this.billingRptShow1.BackColor = Color.WhiteSmoke; componentResourceManager.ApplyResources(this.billingRptShow1, "billingRptShow1"); this.billingRptShow1.Name = "billingRptShow1"; base.AutoScaleMode = AutoScaleMode.None; this.BackColor = Color.WhiteSmoke; base.Controls.Add(this.panel2); base.Controls.Add(this.panel1); componentResourceManager.ApplyResources(this, "$this"); base.Name = "Billing"; this.panel1.ResumeLayout(false); this.flowLayoutPanelBillingPage.ResumeLayout(false); this.flowLayoutPanelBillingPage.PerformLayout(); this.panel2.ResumeLayout(false); base.ResumeLayout(false); }