/// <summary> /// Gets all regions. /// </summary> /// <returns></returns> public static Region GetAllRegions() { BLL.Region reg = new Region(); reg.LoadAll(); reg.Sort = "RegionName ASC"; return(reg); }
private void Hospital_Load(object sender, EventArgs e) { SetPermission(); BLL.Region reg = new BLL.Region(); reg.LoadAll(); //cboRegion.DataSource = reg.DefaultView; Zone zon = new Zone(); zon.LoadAll(); //cboZone.DataSource = zon.DefaultView; Woreda wor = new Woreda(); wor.LoadAll(); //cboWoreda.DataSource = wor.DefaultView; PopulateFields(); }
/// <summary> /// Loads the location tree /// </summary> private void PopulateLocationTree() { BLL.Region reg = new BLL.Region(); Zone zon = new Zone(); Woreda wrd = new Woreda(); reg.LoadAll(); locationTree.Nodes.Clear(); foreach (DataRowView dv in reg.DefaultView) { TreeNode nodes = new TreeNode { Name = "Reg" + dv["ID"].ToString(), Text = dv["RegionName"].ToString(), ToolTipText = "Double Click to Edit." }; zon.GetZoneByRegion(Convert.ToInt32(dv["ID"])); foreach (DataRowView subDv in zon.DefaultView) { TreeNode zonNodes = new TreeNode { Name = "Zon" + subDv["ID"].ToString(), Text = subDv["ZoneName"].ToString(), ToolTipText = "Double Click to Edit." }; wrd.GetWoredaByZone(Convert.ToInt32(subDv["ID"])); foreach (DataRowView worDv in wrd.DefaultView) { TreeNode wrdNodes = new TreeNode { Name = "Wrd" + worDv["ID"].ToString(), Text = worDv["WoredaName"].ToString(), ToolTipText = "Double Click to Edit." }; zonNodes.Nodes.Add(wrdNodes); } nodes.Nodes.Add(zonNodes); } locationTree.Nodes.Add(nodes); } cboRegion.DataSource = reg.DefaultView; }
private void LoadReceivingUnits() { BLL.Region reg = new BLL.Region(); reg.LoadAll(); lkRegion.Properties.DataSource = reg.DefaultView; BLL.InstitutionType ruType = new InstitutionType(); ruType.Where.IsActive.Value = 1; ruType.Query.Load(); lkRUType.Properties.DataSource = ruType.DefaultView; BLL.OwnershipType ownershipType = new OwnershipType(); ownershipType.LoadAll(); lkOwnership.Properties.DataSource = ownershipType.DefaultView; Route r = new Route(); r.LoadAll(); lkRoute.Properties.DataSource = r.DefaultView; }