private void focus_new_row_created(DevExpress.XtraGrid.Views.Grid.GridView ip_grv)
{
int v_row_index = 0;
decimal v_id_gd_hd_f340 = 0;
string v_da_xoa_f340 = "N";
v_id_gd_hd_f340 = find_id_hd(CIPConvert.ToDecimal(m_sle_chon_nhan_vien.EditValue));
if (ip_grv == m_grv_hs_lns)
{
US_V_F340_DAT_HS_LNS v_us = new US_V_F340_DAT_HS_LNS();
DS_V_F340_DAT_HS_LNS v_ds = new DS_V_F340_DAT_HS_LNS();
v_us.FillDataset(v_ds);
for (v_row_index = 0; v_row_index < v_ds.Tables[0].Rows.Count; v_row_index++)
{
var v_id_gd_hd = CIPConvert.ToDecimal(ip_grv.GetDataRow(v_row_index)["ID_HOP_DONG"].ToString());
var v_da_xoa = ip_grv.GetDataRow(v_row_index)["DA_XOA_LNS"].ToString();
if (v_id_gd_hd == v_id_gd_hd_f340 && v_da_xoa == v_da_xoa_f340)
{
break;
}
}
ip_grv.FocusedRowHandle = v_row_index;
}
else if (ip_grv == m_grv_lcd)
{
US_V_F340_DAT_LCD v_us = new US_V_F340_DAT_LCD();
DS_V_F340_DAT_LCD v_ds = new DS_V_F340_DAT_LCD();
v_us.FillDataset(v_ds);
for (v_row_index = 0; v_row_index < v_ds.Tables[0].Rows.Count; v_row_index++)
{
var v_id_gd_hd = CIPConvert.ToDecimal(ip_grv.GetDataRow(v_row_index)["ID_HOP_DONG"].ToString());
var v_da_xoa = ip_grv.GetDataRow(v_row_index)["DA_XOA_LCD"].ToString();
if (v_id_gd_hd == v_id_gd_hd_f340 && v_da_xoa == v_da_xoa_f340)
{
break;
}
}
ip_grv.FocusedRowHandle = v_row_index;
}
}