示例#1
0
        private void Ricerca(int wo_id)
        {
            //PanelRicerca.Collapsed=true;
            DatapanelCompleta.Collapsed = false;

            S_Controls.Collections.S_ControlsCollection CollezioneControlli = new S_Controls.Collections.S_ControlsCollection();

            Classi.ManProgrammata.Completamento _Compl = new TheSite.Classi.ManProgrammata.Completamento();

            DataSet _MyDs = _Compl.GetSingleData(wo_id).Copy();

            this.DataGridRicerca.DataSource = _MyDs.Tables[0];
            this.DataGridRicerca.DataBind();
            this.GridTitle1.NumeroRecords = _MyDs.Tables[0].Rows.Count.ToString();

            if (_MyDs.Tables[0].Rows.Count > 0)
            {
                DataRow _DR = _MyDs.Tables[0].Rows[0];

                //Imposto il Codice WO
                txtsRichiesta.Text = _DR["ID"].ToString();
                //Imposta la Ditta
                if (_DR["idditta"] != null)
                {
                    cmbsDitta.SelectedValue = _DR["idditta"].ToString();
                }
                BindAddettiDitta(RicercaModulo1.BlId, Int32.Parse(cmbsDitta.SelectedValue));
                //Imposto il Codice Edificio
                RicercaModulo1.TxtCodice.Text = _DR["Edificio"].ToString();
                RicercaModulo1.Ricarica();
                //Imposto L'addetto
                Addetti1.NomeCompleto = _DR["Addetto"].ToString();
                //Carico la lista degli addetti
                BindAddetti(_DR["Edificio"].ToString());
                //Imposto le Combo degli Anni
                DateTime _Data = DateTime.Parse(_DR["DataPianificata"].ToString());
                cmbsAnnoA.SelectedValue  = _Data.Year.ToString();
                cmbsAnnoDa.SelectedValue = _Data.Year.ToString();
                cmbsMeseA.SelectedValue  = _Data.Month.ToString().PadLeft(2, Convert.ToChar("0"));
                cmbsMeseDa.SelectedValue = _Data.Month.ToString().PadLeft(2, Convert.ToChar("0"));
                //Imposto le combo degli addetti
                cmbsAddettoCompl.SelectedValue = _DR["id_addetto"].ToString();
                cmbsAddettoMod.SelectedValue   = _DR["id_addetto"].ToString();
                DatapanelCompleta.Visible      = true;
            }
            else
            {
                DatapanelCompleta.Visible = false;
            }
        }