void BindGrid() { try { List <Client> ds = ClientBLL.GetList(); grdUsers.DataSource = ds; grdUsers.DataBind(); } catch (Exception ex) { grdUsers.EmptyDataText = ex.Message; grdUsers.DataBind(); } }
private void BindClients() { try { drpClients.DataSource = ClientBLL.GetList(); drpClients.DataTextField = "FullName"; drpClients.DataValueField = "ClientId"; drpClients.DataBind(); } catch (Exception) { this.ShowHelperMessage("Error", "There is no clients so far", HelperNotify.NotificationType.error); } }
protected void rdlst_SelectedIndexChanged(object sender, EventArgs e) { if (rdlst.SelectedIndex == 0) { pnlRelationData.Visible = true; drpClients.DataSource = ClientBLL.GetList(); drpClients.DataTextField = "FullName"; drpClients.DataValueField = "ClientId"; drpClients.DataBind(); } else { pnlRelationData.Visible = false; Application["flag"] = "false"; } }
private void BindData() { try { Client client = ClientBLL.GetItem(Convert.ToInt32(Request.QueryString["id"])); int id = Convert.ToInt32(Request.QueryString["id"]); if (client.HasArelation == HasRelations.yes) { Application["flag"] = "true"; rdlst.SelectedIndex = 0; drpClients.DataSource = ClientBLL.GetList(); drpClients.DataTextField = "FullName"; drpClients.DataValueField = "ClientId"; drpClients.DataBind(); Relatives rel = RelativesBLL.GetItem(id); txtRelName.Text = rel.RelationName; drpClients.SelectedItem.Text = rel.ClientRelName; } else { Application["flag"] = "false"; pnlRelationData.Visible = false; rdlst.SelectedIndex = 1; } txtFName.Text = client.FirstName; txtMiddleName.Text = client.MiddleName; txtSurrName.Text = client.SurrName; txtCity.Text = client.City; drpCountry.SelectedItem.Text = client.Country; txtAdress.Text = client.Address; txtTelephone.Text = client.Telephone; txtMob.Text = client.Mob; txtDateOf.Text = client.DateOfBirth.ToString("dd/MM/yyyy"); drpGender.SelectedItem.Text = client.Gender; txtNotes.Text = client.Notes; } catch (Exception ex) { this.ShowHelperMessage("Error", ex.Message, HelperNotify.NotificationType.error); } }