Exemple #1
0
        private void UpdateJobStatus()
        {
            if (mDBManager_O != null && mDBManager_O.mConnected_b)
            {
                UInt32 StatusID_UL;

                if (UInt32.TryParse(mDBManager_O.GetTableField("ComJob", "ComStatusID", "ComJobID=" + mComJobID_UL), out StatusID_UL))
                {
                    for (int i = 0; i < ToolStripJobStates.Items.Count; i++)
                    {
                        if (ToolStripJobStates.Items[i].GetType() == typeof(ToolStripButton) ||
                            ToolStripJobStates.Items[i].GetType() == typeof(ToolStripLabel) ||
                            ToolStripJobStates.Items[i].GetType() == typeof(ToolStripControlHost) ||
                            ToolStripJobStates.Items[i].GetType() == typeof(ToolStripTextBox))
                        {
                            if (StatusID_UL > Convert.ToUInt32(ToolStripJobStates.Items[i].Tag))
                            {
                                ToolStripJobStates.Items[i].Enabled = false;
                            }
                            else
                            {
                                ToolStripJobStates.Items[i].Enabled = true;
                            }
                        }
                    }
                }
            }
        }
Exemple #2
0
        private void ToolStripBtnEdit_Click(object sender, EventArgs e)
        {
            UInt32 EtapeID_UL = DBListViewCheckings.GetSelectedItemID();

            if (mDataBaseManager_O != null && mDataBaseManager_O.mConnected_b)
            {
                UInt32 mJobID_UL = 0;
                if (UInt32.TryParse(mDataBaseManager_O.GetTableField("PointageSelectPop", "ComJobID", "ComJobEtapeID=" + EtapeID_UL), out mJobID_UL))
                {
                    String JobNumber_st    = mDataBaseManager_O.GetTableField("PointageSelectPop", "NumOrdre", "ComJobEtapeID=" + EtapeID_UL);
                    String JobRefNumber_st = mDataBaseManager_O.GetTableField("PointageSelectPop", "NumRefInterne", "ComJobEtapeID=" + EtapeID_UL);
                    String JobLib_st       = mDataBaseManager_O.GetTableField("PointageSelectPop", "JobLib", "ComJobEtapeID=" + EtapeID_UL);

                    FormCheckingEdition FormCheckingEdition_O = new FormCheckingEdition();
                    FormCheckingEdition_O.Initialize(mDataBaseManager_O, CustomDateTimePickerCtrl.Value, mPersID_UL, mJobID_UL, CheckingEditionMode.Edit, EtapeID_UL);
                    FormCheckingEdition_O.SetFrameTitle("Edition pointage sur job n° " + JobNumber_st + " dans " + JobRefNumber_st + " : " + JobLib_st);
                    FormCheckingEdition_O.ShowDialog();

                    RefreshPersPointage();
                }
                else
                {
                    MessageBox.Show("Erreur lors de l'édition de job : le job ne peut pas être trouvé.", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Exemple #3
0
        public void Initialize(DatabaseManager DBManager_O, UInt32 PersID_UL)
        {
            mDBManager_O = DBManager_O;
            mPersID_UL   = PersID_UL;
            String Where_ST = "PersID=" + mPersID_UL;

            if (mDBManager_O.mConnected_b)
            {
                TxtLogin.Text      = mDBManager_O.GetTableField("Pers", "UserLogin", Where_ST);
                TxtPwd.Text        = mDBManager_O.GetTableField("Pers", "Pwd", Where_ST);
                TxtConfirmPwd.Text = mDBManager_O.GetTableField("Pers", "Pwd", Where_ST);
                DBComboxPrefDep.FillList(DBManager_O, "TypeDep", "TypeDepID", "TypeDepLib");
                DBComboxPrefHall.FillList(DBManager_O, "Hall", "HallID", "HallName");

                // Get user prefered dep and hall
                UInt32 PrefDep_UL  = 0;
                UInt32 PrefHall_UL = 0;
                UInt32.TryParse(DBManager_O.GetTableField("Pers", "PrefDepID", Where_ST), out PrefDep_UL);
                UInt32.TryParse(DBManager_O.GetTableField("Pers", "PrefHallID", Where_ST), out PrefHall_UL);

                // If prefered dep and hall found, select it in dep combo box
                if (PrefDep_UL > 0)
                {
                    DBComboxPrefDep.SelectItemByID(PrefDep_UL);
                }
                if (PrefHall_UL > 0)
                {
                    DBComboxPrefHall.SelectItemByID(PrefHall_UL);
                }
            }
        }
Exemple #4
0
        private void ToolStripBtnEdit_Click(object sender, EventArgs e)
        {
            if (mDBManager_O != null && mDBManager_O.mConnected_b)
            {
                UInt32 mPersID_UL = 0;
                UInt32.TryParse(mDBManager_O.GetTableField("PointageSelectPop", "PersID", "ComJobEtapeID=" + mEtapeID_UL), out mPersID_UL);

                UInt32 mJobID_UL = 0;
                UInt32.TryParse(mDBManager_O.GetTableField("PointageSelectPop", "ComJobID", "ComJobEtapeID=" + mEtapeID_UL), out mJobID_UL);

                FormCheckingEdition FormCheckingEdition_O = new FormCheckingEdition();
                FormCheckingEdition_O.Initialize(mDBManager_O, Convert.ToDateTime(mDate_st), mPersID_UL, mJobID_UL, CheckingEditionMode.Edit, mEtapeID_UL);
                FormCheckingEdition_O.SetFrameTitle("Edition pointage sur job n° " + mDBManager_O.GetTableField("ComJob", "NumOrdre", "ComJobID=" + mJobID_UL) + " dans " + mNumRefInterne_st + " : " + mLibelle_st);
                FormCheckingEdition_O.ShowDialog();

                DayCheckingsModified();
            }
        }
Exemple #5
0
        private void ToolStripBtnAddCom_Click(object sender, EventArgs e)
        {
            if (mDBManager_O != null && mDBManager_O.mConnected_b)
            {
                FormAskClient FormAskClient_O = new FormAskClient(mDBManager_O);

                if (FormAskClient_O.ShowDialog() == DialogResult.OK)
                {
                    UInt32 ClientID_UL = FormAskClient_O.SelectedClient_UL;

                    if (ClientID_UL > 0)
                    {
                        // Generate com internal reference number as DATE/# of job in current day/client number
                        String RefNumber_st = DateTime.Today.ToString("yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture).Substring(2) + "/";
                        RefNumber_st += (char)(mDBManager_O.mStoredProcedureManager_O.STPROC_CountJobByClientID(ClientID_UL) + 65) + "/";
                        RefNumber_st += mDBManager_O.GetTableField("Client", "NumClientInterne", "ClientID=" + ClientID_UL);

                        UInt32 NewComID_UL = mDBManager_O.mStoredProcedureManager_O.STPROC_CreateClientCom(ClientID_UL, RefNumber_st);
                        ComJobSelector.GetComListView().Refresh();

                        if (NewComID_UL > 0)
                        {
                            ComJobSelector.GetComListView().SelectItemByID(NewComID_UL);
                        }
                    }
                }
            }
        }
Exemple #6
0
        public NECertifUC(DatabaseManager DBManager_O, DocumentManager DocumentManager_O, UInt32 SendNoteID_UL)
        {
            InitializeComponent();

            mDBManager_O       = DBManager_O;
            mSendNoteID_UL     = SendNoteID_UL;
            mDocumentManager_O = DocumentManager_O;

            // Set UC style
            ToolStripNeCertif.Renderer = new BorderlessToolStripRenderer();
            ControlStyle.SetFrameStyle(ToolStripNeCertif);

            // Initialize user control
            if (mDBManager_O != null && mDBManager_O.mConnected_b)
            {
                try
                {
                    DateTime Date_O = Convert.ToDateTime(mDBManager_O.GetTableField("NoteEnvoiAndCertif", "DateExpedition", "NoteEnvoiID=" + mSendNoteID_UL));
                    ToolStripLblDate.Text = Date_O.ToShortDateString();

                    // Hide certif button if do not exist
                    UInt32 CertifID_UL;
                    if (!UInt32.TryParse(mDBManager_O.GetTableField("NoteEnvoiAndCertif", "CertifID", "NoteEnvoiID=" + mSendNoteID_UL), out CertifID_UL))
                    {
                        ToolStripBtnCertif.Visible = false;
                    }
                    else if (CertifID_UL == 0)
                    {
                        ToolStripBtnCertif.Visible = false;
                    }
                }
                catch (FormatException e)
                {
                    ToolStripLblDate.Text = mDBManager_O.GetTableField("NoteEnvoiAndCertif", "DateExpedition", "NoteEnvoiID=" + mSendNoteID_UL);
                }
            }
        }
Exemple #7
0
        private void AddCheckingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (mDBManager_O != null && mDBManager_O.mConnected_b)
            {
                String JobOrder_ST     = mDBManager_O.GetTableField("ComJob", "NumOrdre", "ComJobID=" + DbListViewComJobs.GetSelectedItemID());
                String ComJobNumRef_ST = mDBManager_O.GetTableField("ComJobSelectPop", "NumRefInterne", "ComJobID=" + DbListViewComJobs.GetSelectedItemID());
                String JobLib_ST       = mDBManager_O.GetTableField("ComJob", "JobLib", "ComJobID=" + DbListViewComJobs.GetSelectedItemID());

                if (DbListViewComJobs.GetSelectedItemID() > 0)
                {
                    FormCheckingEdition FormCheckingEdition_O = new FormCheckingEdition();
                    FormCheckingEdition_O.Initialize(mDBManager_O, DayCheckingViewerCtrl.GetViewerDate(), mUserID_UL, DbListViewComJobs.GetSelectedItemID());
                    FormCheckingEdition_O.SetFrameTitle("Ajout pointage sur job n° " + JobOrder_ST + " dans " + ComJobNumRef_ST + " : " + JobLib_ST);
                    FormCheckingEdition_O.ShowDialog();

                    DbListViewComJobs.Refresh();
                    DayCheckingViewerCtrl.RefreshPersPointage(); // Check if easy to only add one check viewer in list instead of refresh everything
                }
                else
                {
                    MessageBox.Show("Veuillez sélectionner un job pour enregistrer un nouveau pointage.", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
Exemple #8
0
        public FormManager(DatabaseManager DBManager_O, UInt32 UserID_UL)
        {
            InitializeComponent();

            HomeImgList.Images.Add(Properties.Resources.Home);
            HomeImgList.Images.Add(Properties.Resources.HomeNewMsg);

            mDBManager_O  = DBManager_O;
            mDocManager_O = new DocumentManager(mDBManager_O);
            mUserID_UL    = UserID_UL;

            // Set drag bar parent window an title
            this.FormDragBar.SetParentWindow(this);
            this.FormDragBar.SetTitle("MMSoft - Gestion Manager");

            this.ModulesToolStrip.Renderer = new BorderlessToolStripRenderer();

            // 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;

            mCurrentUC_O          = null;
            mClientUC_O           = new ClientUC(mDBManager_O);
            mProviderUC_O         = new ProviderUC(mDBManager_O);
            mEmployeesUC_O        = new MembersUC(mDBManager_O, mDocManager_O);
            mComJobUC_O           = new ComJobUC(mDBManager_O, mDocManager_O);
            mHomeUC_O             = new HomeUC(mDBManager_O);
            mHomeUC_O.NewMessage += new HomeUC.NewMessageHandler(this.NewMessage);
            mJobStatesUC_O        = new JobsState(mDBManager_O);
            mJobCorrectionUC_O    = new JobsCorrectionUC(mDBManager_O);
            mStatsUC_O            = new StatsUC(mDBManager_O, mDocManager_O);

            //ControlStyle.SetBackgroundStyle(this);
            ControlStyle.SetBackgroundStyle(MainMenuStrip);
            ControlStyle.SetBackgroundStyle(ModulesToolStrip);
            ControlStyle.SetBackgroundStyle(ModuleContainerPanel);
            ControlStyle.SetBackgroundStyle(this.StatusStripFormChecking);

            ModuleChanged(ToolStripBtnHome, new EventArgs());
        }
Exemple #9
0
        public void LoadChecking()
        {
            String        SQLRequest_ST;
            SqlDataReader SqlDataReader_O;
            UInt32        PointageMachine_UL = 1;
            UInt32        TaskID_UL          = 0;
            UInt32        MachineID_UL       = 0;
            UInt32        HallID_UL          = 0;
            UInt32        DepID_UL           = 0;

            if (mDataBaseManager_O != null && mDataBaseManager_O.mConnected_b)
            {
                // Fill pointage info
                SQLRequest_ST   = "SELECT * FROM Pointage WHERE ComJobEtapeID=" + mComJobEtapeID_UL;
                SqlDataReader_O = mDataBaseManager_O.Select(SQLRequest_ST);

                while (SqlDataReader_O.Read())
                {
                    // Select Task
                    if (UInt32.TryParse(mDataBaseManager_O.GetTableField("ComJobEtape", "TypeTacheID", "ComJobEtapeID=" + mComJobEtapeID_UL), out TaskID_UL))
                    {
                        if (UInt32.TryParse(mDataBaseManager_O.GetTableField("TypeTache", "TypeDepID", "TypeTacheID=" + TaskID_UL), out DepID_UL))
                        {
                            DBComboxDep.SelectItemByID(DepID_UL);
                            DBComboxTask.SelectItemByID(TaskID_UL);
                        }
                    }
                    // Fill NbrH field
                    TxtNbrH.Text = SqlDataReader_O["NbrH"].ToString();
                    // Fill Rem field
                    TxtRem.Text = SqlDataReader_O["Rem"].ToString();
                }

                SqlDataReader_O.Close();

                // Fill pointage machine info
                SQLRequest_ST   = "SELECT * FROM PointageMachine WHERE ComJobEtapeID=" + mComJobEtapeID_UL;
                SqlDataReader_O = mDataBaseManager_O.Select(SQLRequest_ST);

                while (SqlDataReader_O.Read())
                {
                    if (PointageMachine_UL >= 1 && PointageMachine_UL <= 4)
                    {
                        UInt32.TryParse(SqlDataReader_O["PointageMachinelID"].ToString(), out mPointageMachineID_O[PointageMachine_UL - 1]);
                    }

                    if (PointageMachine_UL == 1)
                    {
                        if (UInt32.TryParse(SqlDataReader_O["MachineID"].ToString(), out MachineID_UL))
                        {
                            if (UInt32.TryParse(mDataBaseManager_O.GetTableField("Machine", "HallID", "MachineID=" + MachineID_UL), out HallID_UL))
                            {
                                DBComboxHall1.SelectItemByID(HallID_UL);
                                DBComboxMachine1.SelectItemByID(MachineID_UL);
                            }
                        }
                        TxtNbrhMach1.Text = SqlDataReader_O["NbrHMachine"].ToString();
                    }
                    else if (PointageMachine_UL == 2)
                    {
                        if (UInt32.TryParse(SqlDataReader_O["MachineID"].ToString(), out MachineID_UL))
                        {
                            if (UInt32.TryParse(mDataBaseManager_O.GetTableField("Machine", "HallID", "MachineID=" + MachineID_UL), out HallID_UL))
                            {
                                DBComboxHall2.SelectItemByID(HallID_UL);
                                DBComboxMachine2.SelectItemByID(MachineID_UL);
                            }
                        }
                        TxtNbrhMach2.Text = SqlDataReader_O["NbrHMachine"].ToString();
                    }
                    else if (PointageMachine_UL == 3)
                    {
                        if (UInt32.TryParse(SqlDataReader_O["MachineID"].ToString(), out MachineID_UL))
                        {
                            if (UInt32.TryParse(mDataBaseManager_O.GetTableField("Machine", "HallID", "MachineID=" + MachineID_UL), out HallID_UL))
                            {
                                DBComboxHall3.SelectItemByID(HallID_UL);
                                DBComboxMachine3.SelectItemByID(MachineID_UL);
                            }
                        }
                        TxtNbrhMach3.Text = SqlDataReader_O["NbrHMachine"].ToString();
                    }
                    else if (PointageMachine_UL == 4)
                    {
                        if (UInt32.TryParse(SqlDataReader_O["MachineID"].ToString(), out MachineID_UL))
                        {
                            if (UInt32.TryParse(mDataBaseManager_O.GetTableField("Machine", "HallID", "MachineID=" + MachineID_UL), out HallID_UL))
                            {
                                DBComboxHall4.SelectItemByID(HallID_UL);
                                DBComboxMachine4.SelectItemByID(MachineID_UL);
                            }
                        }
                        TxtNbrhMach4.Text = SqlDataReader_O["NbrHMachine"].ToString();
                    }

                    PointageMachine_UL++;
                }

                SqlDataReader_O.Close();
            }
        }
Exemple #10
0
        private void BtnSaveChanges_Click(object sender, EventArgs e)
        {
            if (mEditState_b)
            {
                UInt32 ClientID_UL = DBListViewClient.GetSelectedItemID();

                //Build update request
                if (mDBManager_O != null && mDBManager_O.mConnected_b)
                {
                    UInt32 TypeSocID_UL;
                    UInt32 CPFactID_UL, CPLivrID_UL;
                    UInt32 ClientNumber_UL;

                    if (UInt32.TryParse(TxtClientNumber.Text, out ClientNumber_UL))
                    {
                        // Check if client number already exists
                        String ClientWithSameNumber_ST   = mDBManager_O.GetTableField("Client", "ClientNom", "NumClientInterne='" + ClientNumber_UL + "'");
                        String ClientIDWithSameNumber_ST = mDBManager_O.GetTableField("Client", "ClientID", "NumClientInterne='" + ClientNumber_UL + "'");
                        UInt32 ClientIDWithSameNumber_UL = 0;
                        UInt32.TryParse(ClientIDWithSameNumber_ST, out ClientIDWithSameNumber_UL);
                        DialogResult DlgRes_O = DialogResult.Yes;

                        if (!String.IsNullOrEmpty(TxtClientNumber.Text) && !String.IsNullOrEmpty(ClientWithSameNumber_ST) && ClientID_UL != ClientIDWithSameNumber_UL)
                        {
                            DlgRes_O = MessageBox.Show("Le client " + ClientWithSameNumber_ST + " existe déjà sous le numéro " + ClientNumber_UL + ". Poursuivre quand même l'enregistrement ?", "Attention", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                        }

                        if (DlgRes_O == DialogResult.Yes)
                        {
                            DBComboxTypeSoc.GetSelectedItemID(out TypeSocID_UL);
                            DBComboxCPFact.GetSelectedItemID(out CPFactID_UL);
                            DBComboxCPLivr.GetSelectedItemID(out CPLivrID_UL);

                            List <String> Param_O  = new List <String>();
                            List <Object> Values_O = new List <Object>();

                            String SqlCommand_O = @"UPDATE Client SET ClientNom=@ClientNom, NumClientInterne=@NumClientInterne, TypeSocID=@TypeSocID, NrTVA=@NrTVA, Contact=@Contact, ContactTel=@ContactTel,
                                                           ContactEmail=@ContactEmail, AdresseFact=@AdresseFact, CodePostalFactID=@CodePostalFactID, AdresseLivraison=@AdresseLivraison, CodePostalLivraisonID=@CodePostalLivraisonID,
                                                            ClientTel=@ClientTel, ClientFax=@ClientFax, ClientMail=@ClientMail, ClientRem=@ClientRem, NoteEnvoi=@NoteEnvoi, Certif=@Certif, RappConf=@RappConf
                                                       WHERE ClientID=@ClientID";

                            Param_O.Add("@ClientNom"); Values_O.Add(TxtClientName.Text);
                            Param_O.Add("@NumClientInterne"); Values_O.Add((int)ClientNumber_UL);
                            Param_O.Add("@TypeSocID"); Values_O.Add((int)TypeSocID_UL);
                            Param_O.Add("@NrTVA"); Values_O.Add(TxtTVA.Text);
                            Param_O.Add("@Contact"); Values_O.Add(TxtContactName.Text);
                            Param_O.Add("@ContactTel"); Values_O.Add(TxtContactTel.Text);
                            Param_O.Add("@ContactEmail"); Values_O.Add(TxtContactMail.Text);
                            Param_O.Add("@AdresseFact"); Values_O.Add(TxtAdressFact.Text);
                            Param_O.Add("@CodePostalFactID"); Values_O.Add((int)CPFactID_UL);
                            Param_O.Add("@AdresseLivraison"); Values_O.Add(TxtAdressLivr.Text);
                            Param_O.Add("@CodePostalLivraisonID"); Values_O.Add((int)CPLivrID_UL);
                            Param_O.Add("@ClientTel"); Values_O.Add(TxtTel.Text);
                            Param_O.Add("@ClientFax"); Values_O.Add(TxtFax.Text);
                            Param_O.Add("@ClientMail"); Values_O.Add(TxtMail.Text);
                            Param_O.Add("@ClientRem"); Values_O.Add(TxtRem.Text);
                            Param_O.Add("@ClientID"); Values_O.Add((int)ClientID_UL);
                            Param_O.Add("@NoteEnvoi"); Values_O.Add(CheckBoxNE.Checked);
                            Param_O.Add("@Certif"); Values_O.Add(CheckBoxCertif.Checked);
                            Param_O.Add("@RappConf"); Values_O.Add(CheckBoxRappConf.Checked);

                            mDBManager_O.ExecuteRequest(SqlCommand_O, Param_O, Values_O);

                            SetEditState(false);
                            DBListViewClient.SetLockState(false);
                            DBListViewClient.Refresh();
                            DBListViewClient.SelectItemByID(ClientID_UL);
                        }
                    }
                    else
                    {
                        MessageBox.Show("Impossible d'enregistrer les modifications : le numéro de client entré n'est pas un nombre valide.", "Erreur !", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
Exemple #11
0
        private void BtnSaveChanges_Click(object sender, EventArgs e)
        {
            if (mEditState_b)
            {
                UInt32 ProviderID_UL = DBListViewProvider.GetSelectedItemID();

                //Build update request
                if (mDBManager_O != null && mDBManager_O.mConnected_b)
                {
                    UInt32 TypeSocID_UL;
                    UInt32 CPFactID_UL;

                    // Check if provider number already exists
                    String ProviderWithSameNumber_ST   = mDBManager_O.GetTableField("Fourn", "FournNom", "NumFournInterne='" + TxtProviderNumber.Text + "'");
                    String ProviderIDWithSameNumber_ST = mDBManager_O.GetTableField("Fourn", "FournID", "NumFournInterne='" + TxtProviderNumber.Text + "'");
                    UInt32 ProviderIDWithSameNumber_UL = 0;
                    UInt32.TryParse(ProviderIDWithSameNumber_ST, out ProviderIDWithSameNumber_UL);
                    DialogResult DlgRes_O = DialogResult.Yes;

                    if (!String.IsNullOrEmpty(TxtProviderNumber.Text) && !String.IsNullOrEmpty(ProviderWithSameNumber_ST) && ProviderID_UL != ProviderIDWithSameNumber_UL)
                    {
                        DlgRes_O = MessageBox.Show("Le fournisseur " + ProviderWithSameNumber_ST + " existe déjà sous le numéro " + TxtProviderNumber.Text + ". Poursuivre quand même l'enregistrement ?", "Attention", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                    }

                    if (DlgRes_O == DialogResult.Yes)
                    {
                        DBComboxTypeSoc.GetSelectedItemID(out TypeSocID_UL);
                        DBComboxCPFact.GetSelectedItemID(out CPFactID_UL);

                        List <String> Param_O  = new List <String>();
                        List <Object> Values_O = new List <Object>();

                        String SqlCommand_O = @"UPDATE Fourn SET FournNom=@FournNom, NumFournInterne=@NumFournInterne, TypeSocID=@TypeSocID, NrTVA=@NrTVA, Contact=@Contact, ContactTel=@ContactTel,
                                                           ContactEmail=@ContactEmail, Adresse=@Adresse, CodePostalID=@CodePostalID, FournTel=@FournTel, FournFax=@FournFax, FournMail=@FournMail,
                                                           FournRem=@FournRem
                                                       WHERE FournID=@FournID";

                        Param_O.Add("@FournNom");        Values_O.Add(TxtProviderName.Text);
                        Param_O.Add("@NumFournInterne"); Values_O.Add(TxtProviderNumber.Text);
                        Param_O.Add("@TypeSocID");       Values_O.Add((int)TypeSocID_UL);
                        Param_O.Add("@NrTVA");           Values_O.Add(TxtTVA.Text);
                        Param_O.Add("@Contact");         Values_O.Add(TxtContactName.Text);
                        Param_O.Add("@ContactTel");      Values_O.Add(TxtContactTel.Text);
                        Param_O.Add("@ContactEmail");    Values_O.Add(TxtContactMail.Text);
                        Param_O.Add("@Adresse");         Values_O.Add(TxtAdressFact.Text);
                        Param_O.Add("@CodePostalID");    Values_O.Add((int)CPFactID_UL);
                        Param_O.Add("@FournTel");        Values_O.Add(TxtTel.Text);
                        Param_O.Add("@FournFax");        Values_O.Add(TxtFax.Text);
                        Param_O.Add("@FournMail");       Values_O.Add(TxtMail.Text);
                        Param_O.Add("@FournRem");        Values_O.Add(TxtRem.Text);
                        Param_O.Add("@FournID");         Values_O.Add((int)ProviderID_UL);

                        mDBManager_O.ExecuteRequest(SqlCommand_O, Param_O, Values_O);

                        SetEditState(false);
                        DBListViewProvider.SetLockState(false);
                        DBListViewProvider.Refresh();
                        DBListViewProvider.SelectItemByID(ProviderID_UL);
                    }
                }
            }
        }
Exemple #12
0
        /// <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();
        }