public void Initialize(DatabaseManager DBManager_O) { mDBManager_O = DBManager_O; this.DBListViewCom.ListTitle = "Commandes"; this.DBListViewJob.ListTitle = "Jobs"; List <String> TableFieldCom_ST = new List <String>(); List <String> ColumnHeaderNameCom_ST = new List <String>(); List <int> ColumnHeaderDefaultSizeCom_i = new List <int>(); List <HorizontalAlignment> TextAlignCom_O = new List <HorizontalAlignment>(); // Fill com info TableFieldCom_ST.Add("NumRefInterne"); TableFieldCom_ST.Add("ComDate"); TableFieldCom_ST.Add("LibelleCmd"); TableFieldCom_ST.Add("NumCmdClient"); TableFieldCom_ST.Add("ClientNom"); TableFieldCom_ST.Add("ComID"); ColumnHeaderNameCom_ST.Add("Num cmd interne"); ColumnHeaderNameCom_ST.Add("Date"); ColumnHeaderNameCom_ST.Add("Libellé commande"); ColumnHeaderNameCom_ST.Add("Num cmd client"); ColumnHeaderNameCom_ST.Add("Client"); ColumnHeaderDefaultSizeCom_i.Add(90); ColumnHeaderDefaultSizeCom_i.Add(80); ColumnHeaderDefaultSizeCom_i.Add(150); ColumnHeaderDefaultSizeCom_i.Add(100); ColumnHeaderDefaultSizeCom_i.Add(200); TextAlignCom_O.Add(HorizontalAlignment.Left); TextAlignCom_O.Add(HorizontalAlignment.Left); TextAlignCom_O.Add(HorizontalAlignment.Left); TextAlignCom_O.Add(HorizontalAlignment.Left); TextAlignCom_O.Add(HorizontalAlignment.Left); DBListViewCom.Initialize(mDBManager_O, "ComSelectPop", TableFieldCom_ST, 5, ColumnHeaderNameCom_ST, ColumnHeaderDefaultSizeCom_i, TextAlignCom_O, null, "NumRefInterne DESC"); List <String> TableFieldJob_ST = new List <String>(); List <String> ColumnHeaderNameJob_ST = new List <String>(); List <int> ColumnHeaderDefaultSizeJob_i = new List <int>(); List <HorizontalAlignment> TextAlignJob_O = new List <HorizontalAlignment>(); // Fill job info TableFieldJob_ST.Add("NumOrdre"); TableFieldJob_ST.Add("JobLib"); TableFieldJob_ST.Add("Qte"); TableFieldJob_ST.Add("JobStatusLib"); TableFieldJob_ST.Add("DelaiPromis"); TableFieldJob_ST.Add("NumPlan"); TableFieldJob_ST.Add("DateEncod"); TableFieldJob_ST.Add("ComJobID"); ColumnHeaderNameJob_ST.Add("Job #"); ColumnHeaderNameJob_ST.Add("Libellé"); ColumnHeaderNameJob_ST.Add("Qte"); ColumnHeaderNameJob_ST.Add("Statut"); ColumnHeaderNameJob_ST.Add("Délai promis"); ColumnHeaderNameJob_ST.Add("N° plan"); ColumnHeaderNameJob_ST.Add("Date d'encodage"); ColumnHeaderDefaultSizeJob_i.Add(40); ColumnHeaderDefaultSizeJob_i.Add(300); ColumnHeaderDefaultSizeJob_i.Add(40); ColumnHeaderDefaultSizeJob_i.Add(80); ColumnHeaderDefaultSizeJob_i.Add(80); ColumnHeaderDefaultSizeJob_i.Add(100); ColumnHeaderDefaultSizeJob_i.Add(90); TextAlignJob_O.Add(HorizontalAlignment.Left); TextAlignJob_O.Add(HorizontalAlignment.Left); TextAlignJob_O.Add(HorizontalAlignment.Left); TextAlignJob_O.Add(HorizontalAlignment.Left); TextAlignJob_O.Add(HorizontalAlignment.Left); TextAlignJob_O.Add(HorizontalAlignment.Left); TextAlignJob_O.Add(HorizontalAlignment.Left); DBListViewJob.Initialize(mDBManager_O, "ComJobSelectPop", TableFieldJob_ST, 7, ColumnHeaderNameJob_ST, ColumnHeaderDefaultSizeJob_i, TextAlignJob_O, null, null, false); // Record on selection changed event for DBListViewCom DBListViewCom.SelectionChanged += new DBListView.SelectionChangedHandler(ComSelectionChanged); ControlStyle.SetFrameHeaderStyle(this); }
public ProviderUC(DatabaseManager DBManager_O) { InitializeComponent(); mInitializingData_b = false; // Add btn tool tool strip list view this.DBListViewProvider.ListTitle = "Sélection fournisseur"; this.DBListViewProvider.AddToolStripBtn(this.ToolStripBtnAddProvider); ToolStripUCProviderTools.Visible = false; this.DBListViewBuyRecap.ListTitle = "Achats chez le fournisseur"; ToolStripUCProviderTools.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("NumFournInterne"); TableField_ST.Add("FournNom"); TableField_ST.Add("NrTVA"); TableField_ST.Add("FournID"); ColumnHeaderName_ST.Add("N° de fournisseur"); 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); DBListViewProvider.Initialize(mDBManager_O, "Fourn", TableField_ST, 3, ColumnHeaderName_ST, ColumnHeaderDefaultSize_i, TextAlign_O); DBListViewProvider.SelectionChanged += new DBListView.SelectionChangedHandler(this.ProviderClick); DBComboxTypeSoc.FillList(mDBManager_O, "TypeSoc", "TypeSocID", "TypeSocLib"); DBComboxCPFact.FillList(mDBManager_O, "CodePostal", "CodePostalID", "CodePostal"); DBComboxCPLibFact.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>(); // 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); } } DBListViewBuyRecap.Initialize(mDBManager_O, "ComJobAchatSelectPop", TableFieldJobRecap_ST, 10, ColumnHeaderNameJobRecap_ST, ColumnHeaderDefaultSizeJobRecap_i, TextAlignJobRecap_O, null, null, false); Fields_O = new List <Control>(); Fields_O.Add(DBComboxTypeSoc); Fields_O.Add(DBComboxCPFact); Fields_O.Add(DBComboxCPLibFact); Fields_O.Add(TxtTel); Fields_O.Add(TxtFax); Fields_O.Add(TxtAdressFact); Fields_O.Add(TxtContactMail); Fields_O.Add(TxtContactTel); Fields_O.Add(TxtContactName); Fields_O.Add(TxtTVA); Fields_O.Add(TxtMail); Fields_O.Add(TxtRem); SetEditState(false); TxtProviderNumber.Width = Math.Max(50, TxtProviderNumber.Width); TxtProviderName.Width = ToolStripProviderHeader.Width - toolStripLabel1.Width - TxtProviderNumber.Width - toolStripLabel3.Width - 5; ToolStripProviderEditFooter.Renderer = new BorderlessToolStripRenderer(); ToolStripProviderHeader.Renderer = new BorderlessToolStripRenderer(); ControlStyle.SetBackgroundStyle(this); ControlStyle.SetBackgroundStyle(this.ToolStripUCProviderTools); ControlStyle.SetFrameHeaderStyle(this.PanelProviderList); ControlStyle.SetFrameHeaderStyle(this.PanelCheckHeader); ControlStyle.SetFrameHeaderStyle(this.PanelJobRecap); ControlStyle.SetFrameHeaderStyle(this.splitContainer2.Panel1); ControlStyle.SetFrameStyle(this.PanelCheckContent); ControlStyle.SetFrameStyle(this.ToolStripProviderEditFooter); DBListViewProvider.ForeColor = Color.Black; }
/// <summary> /// Constructor /// </summary> public FormChecking(DatabaseManager DBManager_O, UInt32 UserID_UL) { InitializeComponent(); // Init Database Manager mDBManager_O = DBManager_O; mDocManager_O = new DocumentManager(mDBManager_O); mUserID_UL = UserID_UL; DbListViewComJobs.AddToolStripBtn(ToolStripBtnAddChecking); DbListViewComJobs.AddToolStripBtn(ToolStripBtnCloseJob); DbListViewComJobs.AddToolStripBtn(ToolStripBtnAll); FormCheckingToolStrip.Visible = false; // Set drag bar parent window an title this.FormDragBar.SetParentWindow(this); this.FormDragBar.SetTitle("MMSoft - Pointages"); // Initialize db list view com job DbListViewComJobs.ListTitle = "Sélection des jobs"; // Define column DB fields mComJobTableField_ST = new List <String>(); mComJobTableField_ST.Add("NumRefInterne"); mComJobTableField_ST.Add("LibelleCmd"); mComJobTableField_ST.Add("NumCmdClient"); mComJobTableField_ST.Add("ClientNom"); mComJobTableField_ST.Add("NumOrdre"); mComJobTableField_ST.Add("JobLib"); mComJobTableField_ST.Add("Qte"); mComJobTableField_ST.Add("NumPlan"); mComJobTableField_ST.Add("DelaiPromis"); mComJobTableField_ST.Add("JobStatusLib"); //mComJobTableField_ST.Add("DateEncod"); // Unshown elements mComJobTableField_ST.Add("ComJobID"); // Define column headers text mComJobColumnHeaderName_ST = new List <string>(); mComJobColumnHeaderName_ST.Add("Num cmd int"); mComJobColumnHeaderName_ST.Add("Libellé cmd"); mComJobColumnHeaderName_ST.Add("Num cmd client"); mComJobColumnHeaderName_ST.Add("Nom client"); mComJobColumnHeaderName_ST.Add("# job"); mComJobColumnHeaderName_ST.Add("Job libellé"); mComJobColumnHeaderName_ST.Add("Qte"); mComJobColumnHeaderName_ST.Add("Num plan"); mComJobColumnHeaderName_ST.Add("Délai"); mComJobColumnHeaderName_ST.Add("Statut"); //mComJobColumnHeaderName_ST.Add("Date encodage"); // Define column headers objects mComJobTextAlign_O = new List <HorizontalAlignment>(); for (int i = 0; i < mComJobColumnHeaderName_ST.Count; i++) { if (i == 4 || i == 6) { mComJobTextAlign_O.Add(HorizontalAlignment.Center); } else { mComJobTextAlign_O.Add(HorizontalAlignment.Left); } } mComJobColumnHeaderDefaultSize_i = new List <int>(); mComJobColumnHeaderDefaultSize_i.Add(100); mComJobColumnHeaderDefaultSize_i.Add(100); mComJobColumnHeaderDefaultSize_i.Add(150); mComJobColumnHeaderDefaultSize_i.Add(150); mComJobColumnHeaderDefaultSize_i.Add(50); mComJobColumnHeaderDefaultSize_i.Add(600); mComJobColumnHeaderDefaultSize_i.Add(50); mComJobColumnHeaderDefaultSize_i.Add(100); mComJobColumnHeaderDefaultSize_i.Add(100); mComJobColumnHeaderDefaultSize_i.Add(100); mComJobColumnHeaderDefaultSize_i.Add(100); DbListViewComJobs.Initialize(mDBManager_O, "PersComJobSelectPop", mComJobTableField_ST, 10, mComJobColumnHeaderName_ST, mComJobColumnHeaderDefaultSize_i, mComJobTextAlign_O, "JobStatusID < 3 AND PersID=" + mUserID_UL, null); DbListViewComJobs.ItemDoubleClicked += new DBListView.ItemDoubleClickedHandler(ComJobDoubleClick); // Initialize day checking viewer DayCheckingViewerCtrl.Initialize(mDBManager_O, DateTime.Today, mUserID_UL, false); DayCheckingViewerCtrl.RefreshPersPointage(); this.splitContainer1.SplitterDistance = this.Height / 3; // Set menu items renderer MainMenuStrip.RenderMode = ToolStripRenderMode.Professional; MainMenuStrip.Renderer = new CustomMenuItemRenderer(); //Display user name if (mDBManager_O.mConnected_b) { LblUsername.Text = mDBManager_O.GetTableField("Pers", "PersNom", "PersID=" + mUserID_UL); } LblConnectionStatus.Text = mDBManager_O.mDBInstanceName_ST; // Set control style ControlStyle.SetBackgroundStyle(this.splitContainer1); ControlStyle.SetFrameHeaderStyle(this.splitContainer1.Panel1); ControlStyle.SetFrameHeaderStyle(this.splitContainer1.Panel2); ControlStyle.SetBackgroundStyle(MainMenuStrip); ControlStyle.SetBackgroundStyle(this.StatusStripFormChecking); RefreshPersPointage(); }