private void load_data_2_grid() { m_us = new US_GD_CUOC_GOI_YEU_CAU(); decimal v_dc_id_nguoi_dung = CIPConvert.ToDecimal(m_ddl_dien_thoai_vien.SelectedValue); DateTime v_dat_tu_ngay, v_dat_den_ngay; if (m_dat_tu_ngay.SelectedDate != CIPConvert.ToDatetime("01/01/0001")) { v_dat_tu_ngay = Convert.ToDateTime(m_dat_tu_ngay.SelectedDate); } else { v_dat_tu_ngay = Convert.ToDateTime("01/01/1900"); } if (m_dat_den_ngay.SelectedDate != CIPConvert.ToDatetime("01/01/0001")) { v_dat_den_ngay = Convert.ToDateTime(m_dat_den_ngay.SelectedDate); } else { v_dat_den_ngay = Convert.ToDateTime("01/01/1900"); } m_ds_bc_cham_cong = m_us.load_bao_cao_cham_cong(v_dat_tu_ngay, v_dat_den_ngay, v_dc_id_nguoi_dung); // Load table header m_str_table_cham_cong = "<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" border=\"1px\" border-style=\"solid\" border-collapse=\"collapse\">"; m_str_table_cham_cong += "\n <thead style='background-color:#810C15; color:White; text-align:center; font-weight:bold;'>"; m_str_table_cham_cong += "\n <tr style='height:28px;'>"; for (int v_i = 0; v_i < m_ds_bc_cham_cong.Tables[0].Columns.Count; v_i++) { m_str_table_cham_cong += "\n <td>" + m_ds_bc_cham_cong.Tables[0].Rows[0][v_i].ToString() + "</td>"; } m_str_table_cham_cong += "\n </tr>"; m_str_table_cham_cong += "\n </thead>"; // Load Table Body for (int v_i = 1; v_i < m_ds_bc_cham_cong.Tables[0].Rows.Count; v_i++) { m_str_table_cham_cong += "\n <tr style='height:28px;'>"; load_cham_cong_by_ngay(v_i); m_str_table_cham_cong += "\n </tr>"; } // Load footer của Table m_str_table_cham_cong += "\n </table>"; }
private void loadTieuDe(ref string strTable) { m_us = new US_GD_CUOC_GOI_YEU_CAU(); decimal v_dc_id_nguoi_dung = CIPConvert.ToDecimal(m_ddl_dien_thoai_vien.SelectedValue); DateTime v_dat_tu_ngay, v_dat_den_ngay; if (m_dat_tu_ngay.SelectedDate != CIPConvert.ToDatetime("01/01/0001")) { v_dat_tu_ngay = Convert.ToDateTime(m_dat_tu_ngay.SelectedDate); } else { v_dat_tu_ngay = Convert.ToDateTime("01/01/1900"); } if (m_dat_den_ngay.SelectedDate != CIPConvert.ToDatetime("01/01/0001")) { v_dat_den_ngay = Convert.ToDateTime(m_dat_den_ngay.SelectedDate); } else { v_dat_den_ngay = Convert.ToDateTime("01/01/1900"); } m_ds_bc_cham_cong = m_us.load_bao_cao_cham_cong(v_dat_tu_ngay, v_dat_den_ngay, v_dc_id_nguoi_dung); strTable += "<table cellpadding='2' cellspacing='0' class='cssTableReport'>"; strTable += "\n<tr>"; strTable += "\n<td colspan='6' align='center'><class='cssTableView' style='width: 100%; height: 40px; font-size: large; color:White; background-color:#810C15;' nowrap='wrap'><span style='font-family:Times New Roman; font-weight:bold; font-size:1.3em;'>BÁO CÁO CHẤM CÔNG" + "</span></td>"; strTable += "\n</tr>"; // strTable += "\n<tr>"; strTable += "\n<td colspan='3' align='center'><class='cssTableView' style='width:100%;' nowrap='nowrap'> <span style='font-family:Times New Roman; font-size:1.0em'>Từ ngày: " + v_dat_tu_ngay.ToShortDateString() + "</span></td>"; strTable += "\n<td colspan='3' align='center'><class='cssTableView' style='width:100%;' nowrap='nowrap'> <span style='font-family:Times New Roman; font-size:1.0em'>đến ngày: " + v_dat_den_ngay.ToShortDateString() + "</span></td>"; strTable += "\n</tr>"; strTable += "\n</table>"; //table noi dung strTable += "<table cellpadding='2' cellspacing='0' class='cssTableReport'>"; strTable += "\n<tr>"; for (int v_i = 0; v_i < m_ds_bc_cham_cong.Tables[0].Columns.Count; v_i++) { strTable += "\n<td style='width:12%;' class='cssTableView' nowrap='nowrap'>" + m_ds_bc_cham_cong.Tables[0].Rows[0][v_i].ToString() + "</td>"; } strTable += "\n</tr>"; loadDSExprort(ref strTable); strTable += "\n</table>"; }