public static void load_data_to_ddl_giai_ngan( DropDownList op_ddl , string ip_str_is_nguon_ns , decimal ip_dc_id_don_vi , string ip_str_text_tat_ca) { US_DM_GIAI_NGAN v_us = new WebUS.US_DM_GIAI_NGAN(); DS_DM_GIAI_NGAN v_ds = new DS_DM_GIAI_NGAN(); v_ds.EnforceConstraints = false; v_us.FillDataset(v_ds, "where id_don_vi=" + ip_dc_id_don_vi + " and is_nguon_ns_yn ='" + ip_str_is_nguon_ns + "'" + " order by ngay_thang desc"); for (int i = 0; i < v_ds.DM_GIAI_NGAN.Count; i++) { v_ds.Tables[0].Rows[i][DM_GIAI_NGAN.SO_UNC] = CIPConvert.ToStr(v_ds.Tables[0].Rows[i][DM_GIAI_NGAN.NGAY_THANG], "dd/MM/yyyy") + " " + v_ds.Tables[0].Rows[i][DM_GIAI_NGAN.SO_UNC]; v_ds.AcceptChanges(); } op_ddl.DataTextField = DM_GIAI_NGAN.SO_UNC; op_ddl.DataValueField = DM_GIAI_NGAN.ID; op_ddl.DataSource = v_ds.DM_GIAI_NGAN; op_ddl.DataBind(); op_ddl.Items.Insert(0, new ListItem(ip_str_text_tat_ca, "-1")); }
//protected void m_grv_RowDataBound(object sender, GridViewRowEventArgs e) //{ // try // { // if (e.Row.RowType == DataControlRowType.Header) // { // for (int i = 6; i < e.Row.Cells.Count; i++) // { // US_DM_QUYET_DINH v_us_qd = new US_DM_QUYET_DINH(); // DS_DM_QUYET_DINH v_ds_qd = new DS_DM_QUYET_DINH(); // v_us_qd.FillDataset(v_ds_qd, "where " + DM_QUYET_DINH.SO_QUYET_DINH + " = N'" + e.Row.Cells[i].Text + "'"); // if (v_ds_qd.DM_QUYET_DINH.Count > 0) // { // e.Row.Cells[i].Text = "QĐ số " + v_ds_qd.Tables[0].Rows[0][DM_QUYET_DINH.SO_QUYET_DINH] + " ngày " + // CIPConvert.ToStr(v_ds_qd.Tables[0].Rows[0][DM_QUYET_DINH.NGAY_THANG], "dd/MM/yyyy"); // } // } // } // } // catch (Exception v_e) // { // CSystemLog_301.ExceptionHandle(this, v_e); // } //} protected void m_grv_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.Header) { for (int i = 0; i < e.Row.Controls.Count; i++) { var headerCell = e.Row.Controls[i] as DataControlFieldHeaderCell; if (headerCell != null) { US_DM_GIAI_NGAN v_us_qd = new US_DM_GIAI_NGAN(); DS_DM_GIAI_NGAN v_ds_qd = new DS_DM_GIAI_NGAN(); v_us_qd.FillDataset(v_ds_qd, "where " + DM_GIAI_NGAN.SO_UNC + " = N'" + headerCell.ContainingField.ToString().Trim() + "'"); if (v_ds_qd.DM_GIAI_NGAN.Count > 0) { headerCell.Text = "Uỷ nhiệm chi số " + v_ds_qd.Tables[0].Rows[0][DM_GIAI_NGAN.SO_UNC] + " ngày " + CIPConvert.ToStr(v_ds_qd.Tables[0].Rows[0][DM_QUYET_DINH.NGAY_THANG], "dd/MM/yyyy"); } } } } else if (e.Row.RowType == DataControlRowType.DataRow) { if (m_grv.DataKeys[e.Row.RowIndex].Value.ToString().Trim().Equals("")) { e.Row.Font.Bold = true; } e.Row.Cells[1].Width = 200; for (int i = 7; i < e.Row.Controls.Count; i++) { Label v_lbl = new Label(); if (e.Row.Cells[i] == null) return; decimal v_i_so_tien = 0; bool v_b_is_number = decimal.TryParse(e.Row.Cells[i].Text, out v_i_so_tien); if (v_b_is_number) { v_lbl.Text = CIPConvert.ToStr(WebformControls.get_so_tien(e.Row.Cells[i].Text),"#,###,##"); v_lbl.CssClass = "csscurrency"; } e.Row.Cells[i].Controls.Add(v_lbl); e.Row.Cells[i].CssClass = "csscurrency"; e.Row.Cells[i].Width = 80; } } } catch (Exception v_e) { CSystemLog_301.ExceptionHandle(this, v_e); } }