public FormAskClient(DatabaseManager DBManager_O) { InitializeComponent(); mDBManager_O = DBManager_O; this.CenterToParent(); this.DBListViewClient.ListTitle = "Sélection client"; List <String> TableField_ST = new List <String>(); List <String> ColumnHeaderName_ST = new List <String>(); List <int> ColumnHeaderDefaultSize_i = new List <int>(); List <HorizontalAlignment> TextAlign_O = new List <HorizontalAlignment>(); TableField_ST.Add("NumClientInterne"); TableField_ST.Add("ClientNom"); TableField_ST.Add("NrTVA"); TableField_ST.Add("ClientID"); ColumnHeaderName_ST.Add("N° de client"); ColumnHeaderName_ST.Add("Nom"); ColumnHeaderName_ST.Add("N° TVA"); ColumnHeaderDefaultSize_i.Add(100); ColumnHeaderDefaultSize_i.Add(300); ColumnHeaderDefaultSize_i.Add(150); TextAlign_O.Add(HorizontalAlignment.Left); TextAlign_O.Add(HorizontalAlignment.Left); TextAlign_O.Add(HorizontalAlignment.Left); DBListViewClient.Initialize(mDBManager_O, "Client", TableField_ST, 3, ColumnHeaderName_ST, ColumnHeaderDefaultSize_i, TextAlign_O); DBListViewClient.ItemDoubleClicked += new DBListView.ItemDoubleClickedHandler(this.ClientDoubleClic); ToolStripValidate.Renderer = new BorderlessToolStripRenderer(); ControlStyle.SetBackgroundColorFocusStyle(this); ControlStyle.SetFrameStyle(this.PanelUserPref); ControlStyle.SetFrameHeaderStyle(this.ToolStripValidate); }
public ClientUC(DatabaseManager DBManager_O) { InitializeComponent(); mInitializingData_b = false; // Add btn tool tool strip list view this.DBListViewClient.ListTitle = "Sélection client"; this.DBListViewClient.AddToolStripBtn(this.ToolStripBtnAddClient); ToolStripUCClientTools.Visible = false; this.DBListViewComjobRecap.ListTitle = "Jobs du client"; ToolStripUCClientTools.Renderer = new BorderlessToolStripRenderer(); mDBManager_O = DBManager_O; List <String> TableField_ST = new List <String>(); List <String> ColumnHeaderName_ST = new List <String>(); List <int> ColumnHeaderDefaultSize_i = new List <int>(); List <HorizontalAlignment> TextAlign_O = new List <HorizontalAlignment>(); TableField_ST.Add("NumClientInterne"); TableField_ST.Add("ClientNom"); TableField_ST.Add("NrTVA"); TableField_ST.Add("ClientID"); ColumnHeaderName_ST.Add("N° de client"); ColumnHeaderName_ST.Add("Nom"); ColumnHeaderName_ST.Add("N° TVA"); ColumnHeaderDefaultSize_i.Add(100); ColumnHeaderDefaultSize_i.Add(300); ColumnHeaderDefaultSize_i.Add(150); TextAlign_O.Add(HorizontalAlignment.Left); TextAlign_O.Add(HorizontalAlignment.Left); TextAlign_O.Add(HorizontalAlignment.Left); DBListViewClient.Initialize(mDBManager_O, "Client", TableField_ST, 3, ColumnHeaderName_ST, ColumnHeaderDefaultSize_i, TextAlign_O); DBListViewClient.SelectionChanged += new DBListView.SelectionChangedHandler(this.ClientClick); DBComboxTypeSoc.FillList(mDBManager_O, "TypeSoc", "TypeSocID", "TypeSocLib"); DBComboxCPFact.FillList(mDBManager_O, "CodePostal", "CodePostalID", "CodePostal"); DBComboxCPLivr.FillList(mDBManager_O, "CodePostal", "CodePostalID", "CodePostal"); DBComboxCPLibFact.FillList(mDBManager_O, "CodePostal", "CodePostalID", "Localite"); DBComboxCPLibLivr.FillList(mDBManager_O, "CodePostal", "CodePostalID", "Localite"); // Define comjob recap list view List <String> TableFieldJobRecap_ST = new List <String>(); List <String> ColumnHeaderNameJobRecap_ST = new List <String>(); List <int> ColumnHeaderDefaultSizeJobRecap_i = new List <int>(); List <HorizontalAlignment> TextAlignJobRecap_O = new List <HorizontalAlignment>(); // Define column DB fields TableFieldJobRecap_ST.Add("NumRefInterne"); TableFieldJobRecap_ST.Add("LibelleCmd"); TableFieldJobRecap_ST.Add("NumCmdClient"); TableFieldJobRecap_ST.Add("NumOrdre"); TableFieldJobRecap_ST.Add("JobLib"); TableFieldJobRecap_ST.Add("Qte"); TableFieldJobRecap_ST.Add("NumPlan"); TableFieldJobRecap_ST.Add("DelaiPromis"); TableFieldJobRecap_ST.Add("JobStatusLib"); TableFieldJobRecap_ST.Add("DateEncod"); // Unshown elements TableFieldJobRecap_ST.Add("ComJobID"); // Define column headers text ColumnHeaderNameJobRecap_ST.Add("Num cmd int"); ColumnHeaderNameJobRecap_ST.Add("Libellé cmd"); ColumnHeaderNameJobRecap_ST.Add("Num cmd client"); ColumnHeaderNameJobRecap_ST.Add("# job"); ColumnHeaderNameJobRecap_ST.Add("Job libellé"); ColumnHeaderNameJobRecap_ST.Add("Qte"); ColumnHeaderNameJobRecap_ST.Add("Num plan"); ColumnHeaderNameJobRecap_ST.Add("Délai"); ColumnHeaderNameJobRecap_ST.Add("Statut"); ColumnHeaderNameJobRecap_ST.Add("Date encodage"); // size ColumnHeaderDefaultSizeJobRecap_i.Add(100); ColumnHeaderDefaultSizeJobRecap_i.Add(100); ColumnHeaderDefaultSizeJobRecap_i.Add(150); ColumnHeaderDefaultSizeJobRecap_i.Add(50); ColumnHeaderDefaultSizeJobRecap_i.Add(600); ColumnHeaderDefaultSizeJobRecap_i.Add(50); ColumnHeaderDefaultSizeJobRecap_i.Add(100); ColumnHeaderDefaultSizeJobRecap_i.Add(100); ColumnHeaderDefaultSizeJobRecap_i.Add(100); ColumnHeaderDefaultSizeJobRecap_i.Add(100); // alignment for (int i = 0; i < ColumnHeaderNameJobRecap_ST.Count; i++) { if (i == 3 || i == 5) { TextAlignJobRecap_O.Add(HorizontalAlignment.Center); } else { TextAlignJobRecap_O.Add(HorizontalAlignment.Left); } } DBListViewComjobRecap.Initialize(mDBManager_O, "ComJobSelectPop", TableFieldJobRecap_ST, 10, ColumnHeaderNameJobRecap_ST, ColumnHeaderDefaultSizeJobRecap_i, TextAlignJobRecap_O, null, null, false); SetEditState(false); TxtClientNumber.Width = Math.Max(50, TxtClientNumber.Width); TxtClientName.Width = ToolStripClientHeader.Width - toolStripLabel1.Width - TxtClientNumber.Width - toolStripLabel3.Width - 5; ToolStripClientEditFooter.Renderer = new BorderlessToolStripRenderer(); ToolStripClientHeader.Renderer = new BorderlessToolStripRenderer(); ControlStyle.SetBackgroundStyle(this); ControlStyle.SetBackgroundStyle(this.ToolStripUCClientTools); ControlStyle.SetFrameHeaderStyle(this.PanelClientList); ControlStyle.SetFrameHeaderStyle(this.PanelCheckHeader); ControlStyle.SetFrameHeaderStyle(this.PanelJobRecap); ControlStyle.SetFrameHeaderStyle(this.splitContainer2.Panel1); ControlStyle.SetFrameStyle(this.PanelCheckContent); ControlStyle.SetFrameStyle(this.ToolStripClientEditFooter); DBListViewClient.ForeColor = Color.Black; DBListViewClient.AllowMultipleSelecion = false; DBListViewComjobRecap.AllowMultipleSelecion = false; }