Пример #1
0
        private void InitListeSites()
        {
            DateTime?dt = CTimosInventoryRegistre.DateDonneesTimos;

            if (dt != null)
            {
                m_lblDateData.Text = I.T("Last data sync : @1|20048", dt.Value.ToShortDateString() + " " +
                                         dt.Value.ToString("HH:mm"));
            }
            else
            {
                m_lblDateData.Text = "";
            }
            CMemoryDb db = CTimosInventoryDb.GetTimosDatas();
            CListeEntitesDeMemoryDb <CSite> lst = new CListeEntitesDeMemoryDb <CSite>(db);

            m_wndListeSites.BeginUpdate();
            m_wndListeSites.Items.Clear();
            lst.Filtre = new CFiltreMemoryDb(CSite.c_champIdSiteParent + " is null");
            lst.Sort   = CSite.c_champLibelle;
            foreach (CSite site in lst)
            {
                ListViewItem item = new ListViewItem(site.Libelle);
                item.Tag = site;
                m_wndListeSites.Items.Add(item);
            }
            m_wndListeSites.EndUpdate();
        }
Пример #2
0
 private void m_btnDebugData_Click(object sender, EventArgs e)
 {
     CFormViewData.ViewData(CTimosInventoryDb.GetTimosDatas());
 }
Пример #3
0
        //--------------------------------------------------------------
        private void CFormCreerEquipement_Load(object sender, EventArgs e)
        {
            m_lblSite.Text = m_releveEqpt.ReleveSite.Site.Libelle;
            if (m_releveEqpt.ReleveEquipementParent != null)
            {
                m_panelEqptParent.Visible = true;
                m_lblEqptParent.Text      = m_releveEqpt.ReleveEquipementParent.NumeroSerie + " " +
                                            m_releveEqpt.ReleveEquipementParent.TypeEquipement.Libelle + " (" +
                                            m_releveEqpt.ReleveEquipementParent.CoordonneeComplete + ")";
            }
            else
            {
                m_panelEqptParent.Visible = false;
            }

            m_txtSerial.Text = m_releveEqpt.NumeroSerie;
            m_selectTypeEquipement.Init(m_releveEqpt, true);
            m_panelCoordonnee.Init(m_releveEqpt, true);

            CListeEntitesDeMemoryDb <CChampCustom> lstChamps = new CListeEntitesDeMemoryDb <CChampCustom>(CTimosInventoryDb.GetTimosDatas());

            lstChamps.Filtre = CChampCustom.GetFiltreChampsForRole(CReleveEquipement.c_roleChampCustom);
            if (lstChamps.Count() == 0)
            {
                m_panelChampsCustom.Visible = false;
            }
            else
            {
                m_panelChampsCustom.Visible = true;
                foreach (CChampCustom champOrg in lstChamps)
                {
                    CChampCustom champ = new CChampCustom(CTimosInventoryDb.GetInventaireDatas());
                    if (!champ.ReadIfExist(champOrg.Id))
                    {
                        champ = champOrg.GetChampInMemoryDb(CTimosInventoryDb.GetInventaireDatas());
                    }

                    if (champ != null)
                    {
                        CControleForCustomFieldReleve ctrl = new CControleForCustomFieldReleve();
                        m_panelChampsCustom.Controls.Add(ctrl);
                        ctrl.Dock = DockStyle.Left;
                        ctrl.Init(champ);
                    }
                }
            }

            foreach (Control ctrl in m_panelChampsCustom.Controls)
            {
                CControleForCustomFieldReleve c = ctrl as CControleForCustomFieldReleve;
                if (c != null)
                {
                    c.InitChamps(m_releveEqpt);
                }
            }
        }