private void 月度预算申请表_Form_btnPrint(object sender, EventArgs e)
        {
            IBudgetMonth serviceBudgetMonth = Service_Economic_Financial.ServerModuleFactory.GetServerModule <IBudgetMonth>();

            if (tabControl1.SelectedTab.Text == "全部")
            {
                MessageDialog.ShowPromptMessage("请选择【已处理】或【待处理】中的记录");
                return;
            }

            string billNo = "";

            if (tabControl1.SelectedTab.Text == "已处理")
            {
                if (dataGridView2.Rows.Count > 0)
                {
                    billNo = dataGridView2.CurrentRow.Cells["业务编号"].Value.ToString();
                }
            }
            else if (tabControl1.SelectedTab.Text == "待处理")
            {
                if (dataGridView1.Rows.Count > 0)
                {
                    billNo = dataGridView1.CurrentRow.Cells["业务编号"].Value.ToString();
                }
            }

            Business_Finance_Budget_Month billInfo = serviceBudgetMonth.GetBillSingleInfo(billNo);
            DataTable tempTable = serviceBudgetMonth.GetDetailInfo(billInfo);

            ExcelHelperP.DataTableToExcel(saveFileDialog1, tempTable, null);
        }
Пример #2
0
        public override void LoadFormInfo()
        {
            try
            {
                txtBillNo.Text    = this.FlowInfo_BillNo;
                lbBillStatus.Text = _ServiceFlow.GetNowBillStatus(this.FlowInfo_BillNo);

                cmbYearValue.MaxYear = 2025;
                cmbYearValue.MinYear = 2015;
                cmbYearValue.Init();

                cmbMonthValue.Init <CE_MonthValue>();

                _LnqBillInfo = _ServiceMonth.GetBillSingleInfo(this.FlowInfo_BillNo);

                if (_LnqBillInfo == null)
                {
                    _LnqBillInfo = new Business_Finance_Budget_Month();

                    _LnqBillInfo.MonthValue = ServerTime.Time.Month;
                    _LnqBillInfo.YearValue  = ServerTime.Time.Year;
                    _LnqBillInfo.BillNo     = txtBillNo.Text;
                    _LnqBillInfo.DeptCode   = UniversalFunction.GetDept_Belonge(BasicInfo.DeptCode).DeptCode;
                }

                cmbYearValue.Text  = _LnqBillInfo.YearValue.ToString();
                cmbMonthValue.Text = GlobalObject.GeneralFunction.ValueConvertToEnum <CE_MonthValue>(Convert.ToInt32(_LnqBillInfo.MonthValue)).ToString();

                RefreshDataGridView();

                cmbYearValue.SelectedIndexChanged  += new EventHandler(cmbYearValue_SelectedIndexChanged);
                cmbMonthValue.SelectedIndexChanged += new EventHandler(cmbMonthValue_SelectedIndexChanged);

                if (lbBillStatus.Text != CE_CommonBillStatus.新建单据.ToString())
                {
                    cmbMonthValue.Enabled = false;
                    cmbYearValue.Enabled  = false;
                }
            }
            catch (Exception ex)
            {
                MessageDialog.ShowPromptMessage(ex.Message);
            }
        }