/// <summary> /// Hàm này có chức năng chuyển từ id_loai_su_kien trong bảng dm_su_kien sang tên ngắn trong bảng từ điển /// </summary> //private void mapping_col_id_to_ten_loai_su_kien() //{ // m_ds_cm_dm_tu_dien.CM_DM_TU_DIEN.Clear(); // m_us_cm_dm_tu_dien.FillDataset(m_ds_cm_dm_tu_dien); // foreach (DataRow v_dr in m_ds_cm_dm_tu_dien.CM_DM_TU_DIEN.Rows) // { // m_hst_mapping_id_to_ten_loai_su_kien.Add(v_dr[CM_DM_TU_DIEN.ID], v_dr[CM_DM_TU_DIEN.TEN]); // m_hst_mapping_ten_loai_su_kien_to_id_.Add(v_dr[CM_DM_TU_DIEN.TEN], v_dr[CM_DM_TU_DIEN.ID]); // } //} /// <summary> /// Load dữ liệu từ US đổ vào form /// </summary> /// <param name="ip_dm_su_kien"></param> private void us_obj_2_form(US_DM_SU_KIEN ip_us_su_kien) { m_txt_ten_su_kien.Text = ip_us_su_kien.strTEN_SU_KIEN; m_ddl_loai_su_kien.SelectedValue = CIPConvert.ToStr(ip_us_su_kien.dcID_LOAI_SU_KIEN); m_dat_ngay_dien_ra.SelectedDate = ip_us_su_kien.datNGAY_DIEN_RA; m_ddl_trang_thai.SelectedValue = CIPConvert.ToStr(ip_us_su_kien.dcID_TRANG_THAI); m_txt_mo_ta.Text = ip_us_su_kien.strMO_TA; }
private void form_2_us_object(US_DM_SU_KIEN ip_us_su_kien) { ip_us_su_kien.strTEN_SU_KIEN = m_txt_ten_su_kien.Text.Trim(); ip_us_su_kien.dcID_LOAI_SU_KIEN = CIPConvert.ToDecimal(m_ddl_loai_su_kien.SelectedValue); ip_us_su_kien.datNGAY_DIEN_RA = m_dat_ngay_dien_ra.SelectedDate; ip_us_su_kien.dcID_TRANG_THAI = CIPConvert.ToDecimal(m_ddl_trang_thai.SelectedValue); ip_us_su_kien.strMO_TA = m_txt_mo_ta.Text.Trim(); }
private void load_data_2_us_by_id(int ip_i_id) { decimal v_dc_id_dm_su_kien = CIPConvert.ToDecimal(m_grv_dm_su_kien.DataKeys[ip_i_id].Value); hdf_id.Value = v_dc_id_dm_su_kien.ToString(); US_DM_SU_KIEN v_us_dm_su_kien = new US_DM_SU_KIEN(v_dc_id_dm_su_kien); // Đẩy us lên form us_obj_2_form(v_us_dm_su_kien); }
private void load_2_cbo_su_kien() { US_DM_SU_KIEN v_us_su_kien = new US_DM_SU_KIEN(); DS_DM_SU_KIEN v_ds_su_kien = new DS_DM_SU_KIEN(); v_us_su_kien.FillDataset(v_ds_su_kien, " WHERE ID_LOAI_SU_KIEN=" + CIPConvert.ToDecimal(m_cbo_loai_su_kien.SelectedValue) + " ORDER BY ID DESC"); m_cbo_su_kien.DataTextField = DM_SU_KIEN.TEN_SU_KIEN; m_cbo_su_kien.DataValueField = DM_SU_KIEN.ID; m_cbo_su_kien.DataSource = v_ds_su_kien.DM_SU_KIEN; m_cbo_su_kien.DataBind(); }
public string mapping_ten_su_kien_by_id(object ip_obj_id_su_kien) { US_DM_SU_KIEN v_us_dm_su_kien = new US_DM_SU_KIEN(CIPConvert.ToDecimal(ip_obj_id_su_kien)); return(v_us_dm_su_kien.strTEN_SU_KIEN); }