示例#1
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            //this.btnSalva.Attributes.Add("onclick","controllaValori();");

            PageTitle1.Title = "Completamento Controlli Periodici";
            _ClManCorrettiva = new TheSite.Classi.ManCorrettiva.ClManCorrettiva();
            FunId            = Int32.Parse(Request["FunId"]);

            btImgDeleteCons.Visible = false;
            LkCons.Visible          = false;

            if (Request["ItemID"] != null)
            {
                itemId = Int32.Parse(Request["ItemID"]);
            }

            if (!Page.IsPostBack)
            {
                LoadFrequenze();
                if (itemId != 0)

                {                //Classi.ClassiAnagrafiche.Ditte _Ditte = new TheSite.Classi.ClassiAnagrafiche.Ditte();
                    Classi.GestioneCP.SfogliaRdlOdl _GCP = new TheSite.Classi.GestioneCP.SfogliaRdlOdl(HttpContext.Current.User.ToString());

                    DataSet _MyDs = _GCP.GETWRCP(itemId).Copy();

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

                        //					id_wr_cp, id_wo_cp, descrizione,
                        //					data_inizio_prevista, data_completamento_fine,
                        //					id_bl, id_eq, id_freq


                        this.LbCPnr.Text = _Dr["id_wr_cp"].ToString();
                        //descrizione CP
                        this.txtsCP.Text = _Dr["descrizione"].ToString();
                        //this.lblFreq.Text=_Dr["frequenza"].ToString();

                        this.Dropdownlist1.SelectedValue = _Dr["cl"].ToString();

                        //Data Inizio Lavori
                        if (_Dr["data_inizio_prevista"] != DBNull.Value)
                        {
                            CalendarPicker1.Datazione.Text = _Dr["data_inizio_prevista"].ToString();
                        }

                        //Data  Fine Lavori
                        if (_Dr["data_completamento_fine"] != DBNull.Value)
                        {
                            CalendarPicker3.Datazione.Text = _Dr["data_completamento_fine"].ToString();
                        }
                        //Data  Fine Lavori

                        if (_Dr["note_completamento"] != DBNull.Value)
                        {
                            this.txtsNoteCompletamento.Text = (string)_Dr["note_completamento"];
                        }
                        //LoadEdificio();
                        //if (_Dr["id_bl"]!= DBNull.Value)
                        if (_Dr["bl_id"] != DBNull.Value)
                        {
                            this.RicercaModulo1.TxtCodice.Text = _Dr["bl_id"].ToString();
                        }

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

                        if (_Dr["nomefilecp"] != DBNull.Value)
                        {
                            LkCons.Text = _Dr["nomefilecp"].ToString();
                            btImgDeleteCons.CommandArgument = _Dr["id_wr_cp"].ToString();
                            btImgDeleteCons.Visible         = true;
                            LkCons.Visible = true;
                            string destDir = "../Doc_DB/cp/" + _Dr["nomefilecp"].ToString();
                            LkCons.NavigateUrl = destDir;
                        }
                        else
                        {
                            btImgDeleteCons.Visible = false;
                            LkCons.Visible          = false;
                        }


                        //LoadApparato();
                        //if (_Dr["id_eq"]!= DBNull.Value && !_Dr["id_eq"].Equals("0"))

                        //					LoadStatoLavoro();
                        //					cmbsstatolavoro.SelectedValue=_Dr["id_stato_richiesta"].ToString();
                        //					if (cmbsstatolavoro.SelectedValue=="4")
                        //						cmbsstatolavoro.Enabled=false;
                    }
                }
                else
                {
                    btnCancella.Visible        = false;
                    LbCPnr.Text                = "";
                    txtsCP.Text                = "";
                    txtsNoteCompletamento.Text = "";
                    //LoadEdificio();
                    LoadFrequenze();
                    //string s_Messagggio = "- Nessun Apparato -";
                    //this.cmbs_Apparato.Items.Add(Classi.GestoreDropDownList.ItemMessaggio(s_Messagggio,  String.Empty));
                }


                ViewState["UrlReferrer"] = Request.UrlReferrer.ToString();
                if (Context.Handler is TheSite.GestioneControlliPeriodici.CP)
                {
                    _fp = (TheSite.GestioneControlliPeriodici.CP)Context.Handler;
                    this.ViewState.Add("mioContenitore", _fp._Contenitore);
                }
            }
        }
示例#2
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            PageTitle1.Title        = "Completamento Controlli Periodici";
            _ClManCorrettiva        = new TheSite.Classi.ManCorrettiva.ClManCorrettiva();
            FunId                   = Int32.Parse(Request["FunId"]);
            cmbsstatolavoro.Enabled = true;
            if (Request["ItemID"] != null)
            {
                itemId = Int32.Parse(Request["ItemID"]);
            }

            if (!Page.IsPostBack)
            {
                //Classi.ClassiAnagrafiche.Ditte _Ditte = new TheSite.Classi.ClassiAnagrafiche.Ditte();


                Classi.GestioneCP.SfogliaRdlOdl _GCP = new TheSite.Classi.GestioneCP.SfogliaRdlOdl(HttpContext.Current.User.ToString());

                DataSet _MyDs = _GCP.GETWRCP(itemId).Copy();

                if (_MyDs.Tables[0].Rows.Count == 1)
                {
                    DataRow _Dr = _MyDs.Tables[0].Rows[0];

                    this.lblOdl.Text = _Dr["id_wo_cp"].ToString();
                    this.LblRdl.Text = _Dr["id_wr_cp"].ToString();
                    //descrizione CP
                    this.txtsCP.Text  = _Dr["cp"].ToString();
                    this.lblFreq.Text = _Dr["frequenza"].ToString();

                    //Data Prevista Inizio Lavori
                    if (_Dr["data_inizio_prevista"] != DBNull.Value)
                    {
                        CalendarPicker1.Datazione.Text = _Dr["data_inizio_prevista"].ToString();
                    }
                    //Data Prevista Fine Lavori
                    if (_Dr["data_fine_prevista"] != DBNull.Value)
                    {
                        CalendarPicker2.Datazione.Text = _Dr["data_fine_prevista"].ToString();
                    }
                    LoadAddettiDitta(_Dr["bl_id"].ToString(), Int32.Parse(_Dr["ditta_id"].ToString()), Int32.Parse(_Dr["id_servizio"].ToString()));
                    if (_Dr["addetto_id"] != DBNull.Value)
                    {
                        this.cmbsAddetto.SelectedValue = _Dr["addetto_id"].ToString();
                    }
                    //Data  Inizio Lavori
                    if (_Dr["data_completamento_inizio"] != DBNull.Value)
                    {
                        CalendarPicker3.Datazione.Text = _Dr["data_completamento_inizio"].ToString();
                    }
                    //Data  Fine Lavori
                    if (_Dr["data_completamento_fine"] != DBNull.Value)
                    {
                        CalendarPicker4.Datazione.Text = _Dr["data_completamento_fine"].ToString();
                    }
                    if (_Dr["note_completamento"] != DBNull.Value)
                    {
                        this.txtsNoteCompletamento.Text = (string)_Dr["note_completamento"];
                    }
                    LoadStatoLavoro();
                    cmbsstatolavoro.SelectedValue = _Dr["id_stato_richiesta"].ToString();
                    if (cmbsstatolavoro.SelectedValue == "4")
                    {
                        cmbsstatolavoro.Enabled = false;
                    }
                }



                ViewState["UrlReferrer"] = Request.UrlReferrer.ToString();
                if (Context.Handler is TheSite.GestioneControlliPeriodici.sfogliaCP)
                {
                    _fp = (TheSite.GestioneControlliPeriodici.sfogliaCP)Context.Handler;
                    this.ViewState.Add("mioContenitore", _fp._Contenitore);
                }
            }
        }