private void btnGetFile_Click(object sender, EventArgs e) { SaveFileDialog dialog = new SaveFileDialog(); dialog.DefaultExt = ".txt"; var sb = new StringBuilder(); string line = "1 1 " + JMoney.RemoveMoney(lbSum.Text); sb.AppendLine(line); line = txtAccountNo.Text + " " + JMoney.RemoveMoney(lbSum.Text) + " D"; sb.AppendLine(line); //file.WriteLine(firstLine); DataTable table = grdReport.DataSource; foreach (DataRow row in table.Rows) { sb.AppendLine(row["AccountNo"].ToString() + " " + row["PaymentPrice"].ToString() + " C"); } if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { System.IO.File.WriteAllText(dialog.FileName, sb.ToString()); } }
private void btnSearch_Click(object sender, EventArgs e) { if (cmbBuses.SelectedIndex == -1 && cmbOwners.SelectedIndex == -1) { JMessages.Error("لطفا مالک یا اتوبوس را انتخاب کنبد.", ""); return; } grdReport.DataSource = JAUTDocumentReport.GetData(Convert.ToInt32(cmbOwners.SelectedValue), Convert.ToInt32(cmbBuses.SelectedValue)); DataTable tableSum = JAUTDocumentReport.GetSumData(Convert.ToInt32(cmbOwners.SelectedValue), Convert.ToInt32(cmbBuses.SelectedValue)); lbBed.Text = JMoney.StringToMoney(tableSum.Rows[0]["Bed"].ToString()); lbBes.Text = JMoney.StringToMoney(tableSum.Rows[0]["Bes"].ToString()); lbRemain.Text = JMoney.StringToMoney((Convert.ToInt64(tableSum.Rows[0]["Bes"]) - Convert.ToInt64(tableSum.Rows[0]["Bed"])).ToString()); }
private void btnSearch_Click(object sender, EventArgs e) { string Str = Where(); _dtSearch = JReport.GetDataManager(Str); jJanusGrid1.bind(_dtSearch, "ReportManagerBascolShow"); _dtTotal = JReport.GetTotalDataManager(Str); if (_dtTotal != null) { lblTotalPay.Text = JMoney.StringToMoney(_dtTotal.Rows[0]["Pay"].ToString()); lblTotalPay_h.Text = JMoney.StringToMoney(_dtTotal.Rows[0]["Pay_h"].ToString()); lblTotalTax.Text = JMoney.StringToMoney(_dtTotal.Rows[0]["Tax"].ToString()); lblTotalDuty.Text = JMoney.StringToMoney(_dtTotal.Rows[0]["Duty"].ToString()); } }