/// <summary> /// 登陆界面 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void CUserTariffPanel_Load(object sender, EventArgs e) { if (!CStaticClass.CheckPushService()) {// 检查服务 return; } QueryServiceClient proxy = new QueryServiceClient(); try { // 查询所有标准收费信息 List <CTariffDto> lstTariff = proxy.GetTariffList(); this.CboTariff.Items.Clear(); // 添加列表信息 this.CboTariff.Items.AddRange(lstTariff.ToArray()); } catch (TimeoutException) { MessageBox.Show("The service operation timed out. ", "超时", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (FaultException exception) { MessageBox.Show(CStaticClass.GetExceptionInfo(exception), "SOAP错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (CommunicationException exception) { MessageBox.Show("There was a communication problem. " + CStaticClass.GetExceptionInfo(exception), "通信错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception exception) { MessageBox.Show(CStaticClass.GetExceptionInfo(exception), "应用程序异常", MessageBoxButtons.OK, MessageBoxIcon.Error); } proxy.Close(); }
/// <summary> /// 登陆界面 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CFormTariff_Load(object sender, EventArgs e) { if (!CStaticClass.CheckPushService()) {// 检查服务 return; } QueryServiceClient proxy = new QueryServiceClient(); try { // 查询所有标准收费信息 List <CTariffDto> lstTariff = proxy.GetTariffList(); if (EnmICCardType.Temp == m_currentICCardType) { lstTariff = lstTariff.FindAll(s => s.iccardtype == (int)m_currentICCardType); } else { lstTariff = lstTariff.FindAll(s => s.iccardtype != (int)EnmICCardType.Temp); } this.CboTariffDescp.Items.Clear(); // 添加列表信息 this.CboTariffDescp.Items.AddRange(lstTariff.ToArray()); CTariffDto tariff = lstTariff.Find(s => s.id == m_nTariffID); if (null != tariff) { this.CboTariffDescp.SelectedItem = tariff; } else { this.CutpTariff.Visible = false; } } catch (TimeoutException) { MessageBox.Show("The service operation timed out. ", "超时", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (FaultException exception) { MessageBox.Show(CStaticClass.GetExceptionInfo(exception), "SOAP错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (CommunicationException exception) { MessageBox.Show("There was a communication problem. " + CStaticClass.GetExceptionInfo(exception), "通信错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception exception) { MessageBox.Show(CStaticClass.GetExceptionInfo(exception), "应用程序异常", MessageBoxButtons.OK, MessageBoxIcon.Error); } proxy.Close(); }
/// <summary> /// 计费标准单选框状态变化时触发 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void RbtnTariff_CheckedChanged(object sender, EventArgs e) { QueryServiceClient proxy = new QueryServiceClient(); try { if (this.RbtnTariff.Checked == true) { this.label1.Text = "计费标准"; this.CboTariff.Visible = true; this.TxtDelayDays.Visible = false; if (!CStaticClass.CheckPushService()) {// 检查服务 return; } //this.CboTariff.Items.Clear(); List <CTariffDto> lstTariffTBL = proxy.GetTariffList(); //DataTable dtTariffInfo = new DataTable(); //DataColumn dc1 = new DataColumn("TariffDescp", typeof(string)); //DataColumn dc2 = new DataColumn("TariffID", typeof(int)); //dtTariffInfo.Columns.Add(dc1); //dtTariffInfo.Columns.Add(dc2); //foreach (CTariffDto table in lstTariffTBL) //{ // DataRow dr = dtTariffInfo.NewRow(); // dr[0] = table.tariffdescp; // dr[1] = table.id; // dtTariffInfo.Rows.Add(dr); // //this.CboTariff.Items.Add(table); //} //this.CboTariff.DisplayMember = "TariffDescp"; //this.CboTariff.ValueMember = "TariffID"; //this.CboTariff.DataSource = dtTariffInfo; this.CboTariff.DisplayMember = "tariffdescp"; this.CboTariff.ValueMember = "id"; this.CboTariff.DataSource = lstTariffTBL; } else { this.label1.Text = "推迟天数"; this.CboTariff.Visible = false; this.TxtDelayDays.Visible = true; } } catch (TimeoutException) { MessageBox.Show("The service operation timed out. ", "超时", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (FaultException exception) { MessageBox.Show(CStaticClass.GetExceptionInfo(exception), "SOAP错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (CommunicationException exception) { MessageBox.Show("There was a communication problem. " + CStaticClass.GetExceptionInfo(exception), "通信错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception exception) { MessageBox.Show(CStaticClass.GetExceptionInfo(exception), "应用程序异常", MessageBoxButtons.OK, MessageBoxIcon.Error); } proxy.Close(); }