Пример #1
0
        private void msg_Elimina_GetMessageBoxResponse(object sender, Utilities.MessageBox.MessageBoxEventHandler e)
        {
            if (e.ButtonPressed == Utilities.MessageBox.MessageBoxEventHandler.Button.Ok)
            {
                int       elSelezionato = dgContatori.SelectedIndex;
                Contatore contatore     = new Contatore();
                contatore.SYSTEM_ID = dgContatori.Items[elSelezionato].Cells[0].Text;

                ProfilazioneDocManager.DeleteValueContatoreDoc(this, contatore);

                contatori = ProfilazioneDocManager.GetValuesContatoriDoc(this, oggettoCustom);
                caricaDgContatori();
                impostaVisualizzazione();
            }

            dgContatori.SelectedIndex = -1;
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["IdOggCustom"] != null && Request.QueryString["IdTemplate"] != null)
            {
                idOggetto  = Request.QueryString["IdOggCustom"];
                idTemplate = Request.QueryString["IdTemplate"];
                if (!string.IsNullOrEmpty(idOggetto) && !string.IsNullOrEmpty(idTemplate))
                {
                    oggettoCustom   = ProfilazioneDocManager.getOggettoById(idOggetto, this);
                    lbl_titolo.Text = oggettoCustom.DESCRIZIONE;
                    contatori       = ProfilazioneDocManager.GetValuesContatoriDoc(this, oggettoCustom);
                    msg_Elimina.GetMessageBoxResponse += new Utilities.MessageBox.Message(this.msg_Elimina_GetMessageBoxResponse);
                }
            }

            if (!IsPostBack)
            {
                caricaDgContatori();
                impostaVisualizzazione();
            }
        }
Пример #3
0
        protected void btn_addContatore_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            switch (oggettoCustom.TIPO_CONTATORE)
            {
            case "T":
                if (dgContatori.Items.Count == 0)
                {
                    Contatore contatore = new Contatore();
                    contatore.ID_AOO       = "0";
                    contatore.ID_RF        = "0";
                    contatore.ANNO         = System.DateTime.Now.Year.ToString();
                    contatore.ID_OGG       = idOggetto;
                    contatore.ID_TIPOLOGIA = idTemplate;
                    contatore.ABILITATO    = "1";
                    contatore.VALORE       = "0";
                    contatore.VALORE_SC    = "0";

                    ProfilazioneDocManager.InsertValuesContatoreDoc(this, contatore);

                    contatori = ProfilazioneDocManager.GetValuesContatoriDoc(this, oggettoCustom);
                    caricaDgContatori();
                    impostaVisualizzazione();
                }
                break;

            case "A":
                if (!string.IsNullOrEmpty(((System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txt_systemIdAoo")).Value))
                {
                    Contatore contatore = new Contatore();
                    contatore.ID_AOO       = ((System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txt_systemIdAoo")).Value;
                    contatore.ID_RF        = "0";
                    contatore.ANNO         = System.DateTime.Now.Year.ToString();
                    contatore.ID_OGG       = idOggetto;
                    contatore.ID_TIPOLOGIA = idTemplate;
                    contatore.ABILITATO    = "1";
                    contatore.VALORE       = "0";
                    contatore.VALORE_SC    = "0";

                    ProfilazioneDocManager.InsertValuesContatoreDoc(this, contatore);

                    contatori = ProfilazioneDocManager.GetValuesContatoriDoc(this, oggettoCustom);
                    caricaDgContatori();
                    impostaVisualizzazione();
                }
                break;

            case "R":
                if (!string.IsNullOrEmpty(((System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txt_systemIdRF")).Value))
                {
                    Contatore contatore = new Contatore();
                    contatore.ID_RF        = ((System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txt_systemIdRF")).Value;
                    contatore.ID_AOO       = "0";
                    contatore.ANNO         = System.DateTime.Now.Year.ToString();
                    contatore.ID_OGG       = idOggetto;
                    contatore.ID_TIPOLOGIA = idTemplate;
                    contatore.ABILITATO    = "1";
                    contatore.VALORE       = "0";
                    contatore.VALORE_SC    = "0";

                    ProfilazioneDocManager.InsertValuesContatoreDoc(this, contatore);

                    contatori = ProfilazioneDocManager.GetValuesContatoriDoc(this, oggettoCustom);
                    caricaDgContatori();
                    impostaVisualizzazione();
                }
                break;
            }
        }