Exemplo n.º 1
0
 public void bindCompanyType()
 {
     try
     {
         ApplicationSettingsModel ComName = client.GetAllApplicationList2(ParlourId, 0, 0);
         if (ComName != null)
         {
             ApplicationSettingsModel[] model = client.GetAllApplicationList(ParlourId, 1, 0);
             if (model != null)
             {
                 ddlCompanyList.Visible        = true;
                 ddlCompanyList.DataTextField  = "ApplicationName";
                 ddlCompanyList.DataValueField = "pkiApplicationID";
                 ddlCompanyList.DataSource     = model;
                 ddlCompanyList.DataBind();
                 ddlCompanyList.Items.Insert(0, new ListItem("Select", "0"));
                 int a = SelectName();
                 ddlCompanyList.SelectedValue = a.ToString();
             }
         }
     }
     catch (Exception ex)
     {
         ShowMessage(ref lblMessage, MessageType.Danger, ex.Message);
     }
 }
Exemplo n.º 2
0
 public void BindCompanyList(DropDownList ddlCompanyList, HtmlControl dvAdministrator)
 {
     FuneralServiceReference.FuneralServicesClient privateClient = new FuneralServiceReference.FuneralServicesClient();
     dvAdministrator.Visible = IsAdministrator;
     if (this.IsAdministrator)
     {
         List <ApplicationSettingsModel> model = privateClient.GetAllApplicationList(ParlourId, 1, 0).ToList();
         if (model != null)
         {
             ddlCompanyList.Visible        = true;
             ddlCompanyList.DataTextField  = "ApplicationName";
             ddlCompanyList.DataValueField = "ParlourId";
             ddlCompanyList.DataSource     = model;
             ddlCompanyList.DataBind();
             //ddlCompanyList.Items.Insert(0, new ListItem("Select", "0"));
             ddlCompanyList.SelectedValue = ParlourId.ToString();
         }
         else
         {
             ddlCompanyList.Items.Insert(0, new ListItem(ApplicationName, ParlourId.ToString()));
             ddlCompanyList.SelectedValue = ParlourId.ToString();
         }
     }
     else
     {
         ddlCompanyList.Items.Insert(0, new ListItem(ApplicationName, ParlourId.ToString()));
         ddlCompanyList.SelectedValue = ParlourId.ToString();
     }
 }