Example #1
0
        protected void LoginButton_Click(object sender, EventArgs e)
        {
            try
            {
                DataTable dt = Client.GetOrganizations(WarehouseLoginTextBox.Text, WarehousePasswordTextBox.Text);
                if (dt.Rows.Count > 0)
                {
                    WarehouseLoginPanel.Visible = false;
                    ConnectPanel.Visible        = true;
                    OrganizationList.DataSource = dt;
                    OrganizationList.DataBind();
                    OrganizationList.SelectedIndex = 0;

                    dt = Client.GetInstances(new Guid(OrganizationList.SelectedValue));
                    if (dt.Rows.Count > 0)
                    {
                        InstanceList.DataSource = dt;
                        InstanceList.DataBind();
                    }
                }
            }
            catch
            {
                errorLabel.Visible = true;
            }
        }
        private void FillList()
        {
            var query = string.Format("SELECT [objID], [name] FROM [{0}]", hasWork ? "_Division" : "Division");
            var da    = new SqlDataAdapter(query, ConString);
            var dt    = new DataTable();

            da.Fill(dt);
            InstanceList.DataSource     = dt;
            InstanceList.DataTextField  = "name";
            InstanceList.DataValueField = "objID";
            InstanceList.DataBind();
        }
Example #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.OrgId = _functions.GetUserOrgId(HttpContext.Current.User.Identity.Name, false);
     if (!IsPostBack)
     {
         string key = orders.GetIntegrationKey(this.OrgId);
         MessagePanel.Visible        = !string.IsNullOrEmpty(key);
         WarehouseLoginPanel.Visible = string.IsNullOrEmpty(key);
     }
     else
     {
         if (OrganizationList.Items.Count > 0 && ConnectPanel.Visible)
         {
             DataTable dt = Client.GetInstances(new Guid(OrganizationList.SelectedValue));
             if (dt.Rows.Count > 0)
             {
                 InstanceList.DataSource = dt;
                 InstanceList.DataBind();
             }
         }
     }
 }