Ejemplo n.º 1
0
        //https://github.com/telerik/aspnet-sdk/blob/master/Grid/ThreeRadGridsExport/ThreeRadGridsExport.aspx.cs
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var y = ClientManager.getAllClients();
                ClientDDL.DataTextField  = "name";
                ClientDDL.DataValueField = "clientid";
                ClientDDL.DataSource     = y;
                ClientDDL.DataBind();

                int promotionid = int.Parse(ClientDDL.SelectedValue);
                var x           = ClientManager.getStockSummaryByClient(promotionid);
                RadGrid1.DataSource = x;
                RadGrid1.DataBind();
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Creates a warning box when the amend client details button is pressed
            AmendBttn.Attributes.Add("onclick", "return confirm('Warning: This will amend this Client\\'s details.\\r\\nAmend this Client?');");
            PushsftpBttn.Attributes.Add("onclick", "return confirm('Warning: This will push the Client\\'s Activation Key to their SFTP. \\r\\n Push Activation Key to SFTP?');");


            if (ClientDDL.Items.Count == 0) //The first time the form is loaded, when the client list is unpopulated
            {
                try
                {
                    ClientDDL.Focus();
                    ClearAllActivationStuff();
                    SystemCodeTB.ForeColor    = Color.Black;
                    AmendBttn.Enabled         = false;
                    ActivationKeyBttn.Enabled = false;
                    //Find the names of the clients from the directory
                    ClientDDL.Items.Add("Select a client.");
                    string[] clientsIncPath = Directory.GetFiles(path, "*.txt");
                    foreach (string ClientName in clientsIncPath)
                    {
                        string Client = Path.GetFileNameWithoutExtension(ClientName);
                        if (!Client.StartsWith("_") & !Client.StartsWith("$") & !Client.StartsWith("%"))
                        {
                            ClientDDL.Items.Add(Client);
                        }
                    }
                }
                catch (Exception ex)
                {
                    //Normally when the Client list has been moved
                    Page.ClientScript.RegisterStartupScript(GetType(), "msgbox", "alert('Could not get Client List.');", true);
                    ClientLabel.Text    = ex.Message;
                    ClientLabel.Visible = true;
                }
            }
        }