void ViewBox_Load(object sender, EventArgs e) { TxtSearch.Focus(); DataSet ds = new ServiceController().GetAllServies(); AvailableServices = DSParser.ParseServices(ref ds); if (AvailableServices != null && AvailableServices.Count > 0) { SetAdapter(); } }
private void AddInvoiceControl() { ClearPanel(); saveToolStripMenuItem.Tag = "Invoice"; InvoiceControl = new InvoiceBox(); InvoiceControl.Dock = DockStyle.Fill; MainPanel.Controls.Add(InvoiceControl); int width = (InvoiceControl.Width > this.Width) ? InvoiceControl.Width : this.Width; int height = (InvoiceControl.Height > (this.Height - MarginTop)) ? (InvoiceControl.Height + MarginTop) : this.Height; DataSet ServicesDataset = new ServiceController().GetAllServies(); InvoiceControl.AvailableItems = DSParser.ParseServices(ref ServicesDataset); InvoiceControl.ApplyAvailableItemsViaOutSideController(); CurrentSize = new Size(width, height); //ChangeCurrentSize(CurrentSize); this.WindowState = FormWindowState.Maximized; AdjustInvoiceControlSize(); InvoiceControl.btnExit.Click += iconButton1_Click; }