public void disp_list() { DataTable dt = null; dgv_list.Rows.Clear(); dt = db.QueryBySQLCode("SELECT loan_code, loan_desc, loan_location, loan_type, user_id, whs_location_code, loan_cost_center_code,loan_cost_center_name,loan_sub_cost_center,employee_no,employee_name,loan_amount,loan_deduction,TO_CHAR(loan_transdate,'YYYY-MM-DD') AS loan_transdate,TO_CHAR(deduction_date,'YYYY-MM-DD') AS deduction_date FROM rssys.hr_loanhdr WHERE loan_transdate BETWEEN '" + dtp_frm.Value.ToString("yyyy-MM-dd") + "' AND '" + dtp_to.Value.ToString("yyyy-MM-dd") + "' ORDER BY loan_code"); for (int r = 0; r < dt.Rows.Count; r++) { int i = dgv_list.Rows.Add(); DataGridViewRow row = dgv_list.Rows[i]; row.Cells["dgvl_code"].Value = dt.Rows[r]["loan_code"].ToString(); row.Cells["dgvl_description"].Value = dt.Rows[r]["loan_desc"].ToString(); row.Cells["dgvl_location"].Value = dt.Rows[r]["loan_location"].ToString(); row.Cells["dgvl_trn_type"].Value = dt.Rows[r]["loan_type"].ToString(); row.Cells["dgvl_userid"].Value = dt.Rows[r]["user_id"].ToString(); row.Cells["dgvl_whscode"].Value = dt.Rows[r]["whs_location_code"].ToString(); row.Cells["dgvl_ccname"].Value = dt.Rows[r]["loan_cost_center_name"].ToString(); row.Cells["dgvl_sub_costcenter"].Value = dt.Rows[r]["loan_sub_cost_center"].ToString(); row.Cells["dgvl_empno"].Value = dt.Rows[r]["employee_no"].ToString(); row.Cells["dgvl_empname"].Value = dt.Rows[r]["employee_name"].ToString(); row.Cells["dgvl_loan_amount"].Value = gm.toAccountingFormat(dt.Rows[r]["loan_amount"].ToString()); row.Cells["dgvl_deduction_amount"].Value = gm.toAccountingFormat(dt.Rows[r]["loan_deduction"].ToString()); row.Cells["dgvl_trnxdate"].Value = dt.Rows[r]["loan_transdate"].ToString(); row.Cells["dgvl_deduction_date"].Value = dt.Rows[r]["deduction_date"].ToString(); } }
void pdoc_PrintPage(object sender, PrintPageEventArgs e) { GlobalMethod gm = new GlobalMethod(); NumberToEnglish_orig amtinwords = new NumberToEnglish_orig(); GlobalClass gc = new GlobalClass(); Graphics graphics = e.Graphics; String fontfamily = "Arial"; Font font = new Font(fontfamily, 10); //Font font_headernote = new Font(fontfamily, 9); //Font font_bd = new Font(fontfamily, 8, FontStyle.Italic); // Font font_grand = new Font(fontfamily, 9, FontStyle.Underline); int ppwidth = pdoc.DefaultPageSettings.PaperSize.Width; float fontHeight = font.GetHeight(); int startX = 0; int startY = 0; int Offset = 15; int incY = 30; int col2 = 30; int col3 = 120; int col4 = 625; String str = ""; Offset = Offset + incY; str = t_date.ToString("MMM dd, yyyy"); graphics.DrawString(str, font, new SolidBrush(Color.Black), startX + col4, Offset); Offset = Offset + incY; graphics.DrawString(this.payto, font, new SolidBrush(Color.Black), startX + col3, Offset); graphics.DrawString(gm.toAccountingFormat(this.amt), font, new SolidBrush(Color.Black), startX + col4, Offset); Offset = Offset + incY; graphics.DrawString(amtinwords.changeCurrencyToWordsForCheck(this.amt.ToString()), font, new SolidBrush(Color.Black), startX + col3 - 10, Offset); }
private void disp_list() { try { dgv_list.Rows.Clear(); } catch (Exception) { } int i = 0; DataTable dt = db.QueryBySQLCode("SELECT * from rssys.hr_sss WHERE COALESCE(cancel,cancel,'')<>'Y'"); for (int r = 0; r < dt.Rows.Count; r++) { i = dgv_list.Rows.Add(); DataGridViewRow row = dgv_list.Rows[i]; row.Cells["dgvl_code"].Value = dt.Rows[r]["code"].ToString(); row.Cells["dgvl_bracket1"].Value = gm.toAccountingFormat(dt.Rows[r]["bracket1"].ToString()); row.Cells["dgvl_bracket2"].Value = gm.toAccountingFormat(dt.Rows[r]["bracket2"].ToString()); row.Cells["dgvl_s_credit"].Value = gm.toAccountingFormat(dt.Rows[r]["s_credit"].ToString()); row.Cells["dgvl_empshare_sc"].Value = gm.toAccountingFormat(dt.Rows[r]["empshare_sc"].ToString()); row.Cells["dgvl_s_ec"].Value = gm.toAccountingFormat(dt.Rows[r]["s_ec"].ToString()); row.Cells["dgvl_empshare_ec"].Value = gm.toAccountingFormat(dt.Rows[r]["empshare_ec"].ToString()); Double er = Convert.ToDouble(dt.Rows[r]["empshare_sc"].ToString()); Double ee = Convert.ToDouble(dt.Rows[r]["empshare_ec"].ToString()); Double ec = Convert.ToDouble(dt.Rows[r]["s_ec"].ToString()); Double total = er + ee + ec; row.Cells["dgvl_total_cont"].Value = gm.toAccountingFormat(total.ToString()); } }
void calculate_gross() { Double gross = gm.toNormalDoubleFormat(txt_basic_pay.Text) + gm.toNormalDoubleFormat(txt_reg_ot_b.Text) + gm.toNormalDoubleFormat(txt_dayoffot_b.Text) + gm.toNormalDoubleFormat(txt_legalhol_ot_b.Text) + gm.toNormalDoubleFormat(txt_specialhol_ot_b.Text) + gm.toNormalDoubleFormat(txt_legalhol_pay_b.Text) + gm.toNormalDoubleFormat(txt_specialhol_pay_b.Text) + gm.toNormalDoubleFormat(txt_night_diff_b.Text) + gm.toNormalDoubleFormat(txt_other_earning.Text) + gm.toNormalDoubleFormat(txt_vl_b.Text) + gm.toNormalDoubleFormat(txt_sl_b.Text) + gm.toNormalDoubleFormat(txt_pl_b.Text) + gm.toNormalDoubleFormat(txt_legalhol_pay_b.Text) + gm.toNormalDoubleFormat(txt_specialhol_pay_b.Text); lbl_total_gross.Text = gm.toAccountingFormat(gross); }