Example #1
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            lblMessaggi.Text = "";
            FunId            = Int32.Parse(Request["FunId"]);

            if (Request["ItemId"] != null)
            {
                itemId = Int32.Parse(Request["ItemId"]);
            }
            if (!Page.IsPostBack)
            {
                DataSet _MyDs = new DataSet();
                Classi.ClassiAnagrafiche.Addetti _Addetti = new TheSite.Classi.ClassiAnagrafiche.Addetti();
                _MyDs = _Addetti.GetSingleData(itemId);

                if (_MyDs.Tables[0].Rows.Count == 1)
                {
                    DataRow _Dr = _MyDs.Tables[0].Rows[0];
                    this.txtsCognome.Text = (string)_Dr["COGNOME"];

                    if (_Dr["NOME"] != DBNull.Value)
                    {
                        this.txtsNome.Text = (string)_Dr["NOME"];
                    }

                    this.lblOperazione.Text      = "Piano Ferie Addetto: " + this.txtsCognome.Text + " " + this.txtsNome.Text;
                    this.lblFirstAndLast.Visible = true;
                    lblFirstAndLast.Text         = _Addetti.GetFirstAndLastUser(_Dr);


                    this.BindDataGrid();
                }
                ViewState["UrlReferrer"] = Request.UrlReferrer.ToString();
                if (Context.Handler is TheSite.Gestione.Addetti)
                {
                    _fp = (TheSite.Gestione.Addetti)Context.Handler;
                    this.ViewState.Add("mioContenitore", _fp._Contenitore);
                }
            }
        }
Example #2
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            CalendarPicker1.Datazione.DBParameterName = "p_data_nascita";
            CalendarPicker1.Datazione.DBDirection     = ParameterDirection.Input;
            CalendarPicker1.Datazione.DBDataType      = CustomDBType.VarChar;
            CalendarPicker1.Datazione.DBIndex         = 2;
            CalendarPicker1.Datazione.DBSize          = 8;
            CalendarPicker1.Datazione.DBDefaultValue  = "";
            check_caselle_testo();


            FunId = Int32.Parse(Request["FunId"]);


            if (Request["ItemId"] != null)
            {
                itemId = Int32.Parse(Request["ItemId"]);
            }
            if (!Page.IsPostBack)
            {
                BindPriorita();
                BindProvince();
                BindProvince1();
                BindDitte();
                BindLivello();
                if (itemId != 0)
                {
                    DataSet _MyDs = new DataSet();
                    Classi.ClassiAnagrafiche.Addetti _Addetti = new TheSite.Classi.ClassiAnagrafiche.Addetti();
                    _MyDs = _Addetti.GetSingleData(itemId);

                    if (_MyDs.Tables[0].Rows.Count == 1)
                    {
                        DataRow _Dr = _MyDs.Tables[0].Rows[0];
                        this.txtscognome.Text = (string)_Dr["COGNOME"];

                        if (_Dr["NOME"] != DBNull.Value)
                        {
                            this.txtsnome.Text = (string)_Dr["NOME"];
                        }

                        if (_Dr["DATA_NASCITA"] != DBNull.Value)
                        {
                            this.CalendarPicker1.Datazione.Text = System.DateTime.Parse(_Dr["DATA_NASCITA"].ToString()).ToShortDateString();
                        }

                        if (_Dr["PROV_NASC_ID"] != DBNull.Value)
                        {
                            this.cmbsprov_nasc.SelectedValue = _Dr["PROV_NASC_ID"].ToString();
                        }

                        BindComuni();


                        if (_Dr["PROV_RES_ID"] != DBNull.Value)
                        {
                            this.cmbsprov_res.SelectedValue = _Dr["PROV_RES_ID"].ToString();
                        }
                        BindComuni1();

                        if (_Dr["COM_NASC_ID"] != DBNull.Value)
                        {
                            this.cmbscom_nasc.SelectedValue = _Dr["COM_NASC_ID"].ToString();
                        }

                        if (_Dr["COM_RES_ID"] != DBNull.Value)
                        {
                            this.cmbscom_res.SelectedValue = _Dr["COM_RES_ID"].ToString();
                        }

                        if (_Dr["INDIRIZZO"] != DBNull.Value)
                        {
                            this.txtsindirizzo.Text = (string)_Dr["INDIRIZZO"].ToString();
                        }

                        if (_Dr["TELEFONO"] != DBNull.Value)
                        {
                            this.txtstelefono.Text = (string)_Dr["TELEFONO"].ToString();
                        }

                        if (_Dr["CELLULARE"] != DBNull.Value)
                        {
                            this.txtscellulare.Text = (string)_Dr["CELLULARE"].ToString();
                        }

                        if (_Dr["DITTA_ID"] != DBNull.Value)
                        {
                            this.cmbsditta_id.SelectedValue = _Dr["DITTA_ID"].ToString();
                        }

                        if (_Dr["PRIORITA"] != DBNull.Value)
                        {
                            this.cmbspriorita.SelectedValue = _Dr["PRIORITA"].ToString();
                        }

                        if (_Dr["ZONA"] != DBNull.Value)
                        {
                            this.txtszona.Text = (string)_Dr["ZONA"].ToString();
                        }

                        if (_Dr["livello"] != DBNull.Value)
                        {
                            this.cmbsLivello.SelectedValue = _Dr["livello"].ToString();
                        }



                        this.lblOperazione.Text      = "Modifica Addetto: " + this.txtscognome.Text + " " + this.txtsnome.Text;
                        this.lblFirstAndLast.Visible = true;
                        this.btnsElimina.Attributes.Add("onclick", "return confirm('Si vuole effettuare la cancellazione?')");
                        lblFirstAndLast.Text = _Addetti.GetFirstAndLastUser(_Dr);
                    }
                }
                else
                {
                    this.lblOperazione.Text = "Inserimento Addetto";
                    BindComuni();
                    BindComuni1();
                    this.lblFirstAndLast.Visible = false;
                    this.btnsElimina.Visible     = false;
                }
                AggiornaListbox();
                if (Request["TipoOper"] == "read")
                {
                    AbilitaControlli(false);
                    this.lblOperazione.Text = "Visualizzazione Addetto: " + this.txtscognome.Text + " " + this.txtsnome.Text;
                }
                ViewState["UrlReferrer"] = Request.UrlReferrer.ToString();
                if (Context.Handler is TheSite.Gestione.Addetti)
                {
                    _fp = (TheSite.Gestione.Addetti)Context.Handler;
                    this.ViewState.Add("mioContenitore", _fp._Contenitore);
                }
            }
        }