コード例 #1
0
 private void Button_总账查询_Click(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(TextBox_科目及单位名称.Text))
     {
         MessageBoxCommon.Show("请选择科目");
         TextBox_科目及单位名称.Focus();
         return;
     }
     else
     {
         string          a = TextBox_科目及单位名称.Text.ToString();
         List <Model_总账> lm;
         if (a.Substring(0, 1) == "4" || a.Substring(0, 1) == "5")
         {
             lm = vmk.GetTotalFee(a, true);
         }
         else
         {
             lm = vmk.GetTotalFee(a);
         }
         this.DataGrid_总账.ItemsSource = lm;
         if (lm.Count > 1)
         {
             this.Label_总账年.Content = lm[1].年 + "年";
         }
         else
         {
             Model_总账 m = new Model_总账();
             m.摘要 = "查询不到数据!";
             lm.Add(m);
         }
         this.DataGrid_总账.ItemsSource = lm;
     }
 }
コード例 #2
0
        private void Button_总账Print_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(TextBox_科目及单位名称.Text))
            {
                MessageBoxCommon.Show("请选择科目");
                TextBox_科目及单位名称.Focus();
                return;
            }
            string Parm   = TextBox_科目及单位名称.Text.ToString();
            string result = new PA.Helper.ExcelHelper.ExcelWriter().ExportLedger(Parm);

            if (result != "")
            {
                MessageBoxCommon.Show(result);
            }
        }