private void lueCOD_DEPA_EditValueChanged(object sender, EventArgs e) { LookUpEdit Obj = (LookUpEdit)sender; if (Obj.EditValue != null) { var oBe = new BESVMC_PROV(); var oBr = new BRSVMC_PROV(); oBe.NUM_ACCI = 5; oBe.COD_DEPA = Convert.ToString(Obj.EditValue); var oList = oBr.Get_SVPR_PROV_LIST(oBe); lueCOD_PROV.Properties.DataSource = oList; lueCOD_PROV.Properties.Columns.Clear(); lueCOD_PROV.Properties.Columns.Add(new LookUpColumnInfo("ALF_PROV", 100, "Provincia")); lueCOD_PROV.Properties.DisplayMember = "ALF_PROV"; lueCOD_PROV.Properties.ValueMember = "COD_PROV"; if (lueCOD_PROV.EditValue != null) { var oBeP = new BESVMC_DIST(); var oBrP = new BRSVMC_DIST(); oBeP.NUM_ACCI = 5; oBeP.COD_DEPA = Convert.ToString(lueCOD_DEPA.EditValue); oBeP.COD_PROV = Convert.ToString(lueCOD_PROV.EditValue); var oListP = oBrP.Get_SVPR_DIST_LIST(oBeP); lueCOD_DIST.Properties.DataSource = oListP; lueCOD_DIST.Properties.Columns.Clear(); lueCOD_DIST.Properties.Columns.Add(new LookUpColumnInfo("ALF_DIST", 100, "Distrito")); lueCOD_DIST.Properties.DisplayMember = "ALF_DIST"; lueCOD_DIST.Properties.ValueMember = "COD_DIST"; } else { lueCOD_DIST.Properties.DataSource = null; } } else { lueCOD_PROV.Properties.DataSource = null; lueCOD_DIST.Properties.DataSource = null; } }
/// <summary> /// CARGAR PROVINCIAS EN FUNCION AL DEPARTAMENTO SELECCIONADO /// </summary> /// <param name="COD_DEPA"></param> /// <param name="selector"></param> private void cargarProvincias(string COD_DEPA) { BESVMC_PROV oBeProvinciaOrigen = new BESVMC_PROV(); BRSVMC_PROV oBrProvinciaOrigen = new BRSVMC_PROV(); List<BESVMC_PROV> oListProvinciaOrigen = new List<BESVMC_PROV>(); oBeProvinciaOrigen.COD_DEPA = COD_DEPA; oBeProvinciaOrigen.NUM_ACCI = 5; oListProvinciaOrigen = oBrProvinciaOrigen.Get_SVPR_PROV_LIST(oBeProvinciaOrigen); luePopCOD_PROV.Properties.DataSource = oListProvinciaOrigen; luePopCOD_PROV.Properties.Columns.Clear(); luePopCOD_PROV.Properties.Columns.Add(new LookUpColumnInfo("ALF_PROV", 100, "Provincia")); luePopCOD_PROV.Properties.DisplayMember = "ALF_PROV"; luePopCOD_PROV.Properties.ValueMember = "COD_PROV"; if (luePopCOD_PROV.EditValue != null) cargarDistritos(luePopCOD_PROV.EditValue.ToString(), COD_DEPA); else luePopCOD_DIST.Properties.DataSource = null; }