예제 #1
0
        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;
        }
예제 #2
0
        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;
        }