コード例 #1
0
ファイル: EditEqstd.aspx.cs プロジェクト: dev191/le-fco
        private void btnsElimina_Click(object sender, System.EventArgs e)
        {
            try
            {
                Classi.ClassiAnagrafiche.Eqstd _Eqstd = new TheSite.Classi.ClassiAnagrafiche.Eqstd();

                this.txtseq_std.DBDefaultValue      = DBNull.Value;
                this.txtsdescrizione.DBDefaultValue = DBNull.Value;
                this.cmbservizio.DBDefaultValue     = "-1";

                int i_RowsAffected = 0;

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


                _SCollection.AddItems(this.PanelEdit.Controls);


                i_RowsAffected = _Eqstd.Delete(_SCollection, itemId);

                if (i_RowsAffected == -1)
                {
                    Server.Transfer("Eqstd.aspx");
                }
            }
            catch (Exception ex)
            {
                string s_Err = ex.Message.ToString().ToUpper();
                PanelMess.ShowError(s_Err, true);
            }
        }
コード例 #2
0
ファイル: Pmp.aspx.cs プロジェクト: dev191/le-fco
        private void BindEqstd(int id_serv)
        {
            this.cmbseq_std.Items.Clear();

            S_ControlsCollection _SColl = new S_ControlsCollection();

            S_Controls.Collections.S_Object s_Id = new S_Object();
            s_Id.ParameterName = "p_servizio_id";
            s_Id.DbType        = CustomDBType.Integer;
            s_Id.Direction     = ParameterDirection.Input;
            s_Id.Index         = 0;
            s_Id.Value         = id_serv;
            _SColl.Add(s_Id);

            TheSite.Classi.ClassiAnagrafiche.Eqstd _Eqstd = new TheSite.Classi.ClassiAnagrafiche.Eqstd();
            DataSet _MyDs = _Eqstd.GetSingleServ(_SColl).Copy();

            if (_MyDs.Tables[0].Rows.Count > 0)
            {
                this.cmbseq_std.DataSource = Classi.GestoreDropDownList.ItemBlankDataSource(
                    _MyDs.Tables[0], "eq_std", "id", "- Selezionare uno Standard -", "0");
                this.cmbseq_std.DataTextField  = "eq_std";
                this.cmbseq_std.DataValueField = "id";
                this.cmbseq_std.DataBind();
            }
            else
            {
                string s_Messagggio = "- Nessun Standard  -";
                this.cmbseq_std.Items.Add(Classi.GestoreDropDownList.ItemMessaggio(s_Messagggio, "-1"));
            }
        }
コード例 #3
0
ファイル: EditEqstd.aspx.cs プロジェクト: dev191/le-fco
        private void btnsSalva_Click(object sender, System.EventArgs e)
        {
            this.txtseq_std.DBDefaultValue      = DBNull.Value;
            this.txtsdescrizione.DBDefaultValue = DBNull.Value;
            this.cmbservizio.DBDefaultValue     = "-1";

            this.txtseq_std.Text      = this.txtseq_std.Text.Trim();
            this.txtsdescrizione.Text = this.txtsdescrizione.Text.Trim();

            int i_RowsAffected = 0;

            S_Controls.Collections.S_ControlsCollection _SCollection = new S_Controls.Collections.S_ControlsCollection();
            _SCollection.AddItems(this.PanelEdit.Controls);

            try
            {
                if (itemId == 0)
                {
                    Classi.ClassiAnagrafiche.Eqstd _Eqstd = new TheSite.Classi.ClassiAnagrafiche.Eqstd();
                    i_RowsAffected = _Eqstd.Add(_SCollection);
                }
                else
                {
                    Classi.ClassiAnagrafiche.Eqstd _Eqstd = new TheSite.Classi.ClassiAnagrafiche.Eqstd();
                    i_RowsAffected = _Eqstd.Update(_SCollection, itemId);
                }

                if (i_RowsAffected == -11)
                {
                    Classi.SiteJavaScript.msgBox(this.Page, "Lo Standard Apparecchiatura é stato già inserito");
                }
                else
                {
                    Server.Transfer("Eqstd.aspx");
                }
            }
            catch (Exception ex)
            {
                string s_Err = ex.Message.ToString().ToUpper();
                PanelMess.ShowError(s_Err, true);
            }
        }
コード例 #4
0
ファイル: EditEqstd.aspx.cs プロジェクト: dev191/le-fco
        private void Page_Load(object sender, System.EventArgs e)
        {
            FunId = Int32.Parse(Request["FunId"]);


            if (Request["ItemId"] != null)
            {
                itemId = Int32.Parse(Request["ItemId"]);
            }
            if (!Page.IsPostBack)
            {
                BindServizi();

                if (itemId != 0)
                {
                    DataSet _MyDs = new DataSet();
                    Classi.ClassiAnagrafiche.Eqstd _Eqstd = new TheSite.Classi.ClassiAnagrafiche.Eqstd();
                    _MyDs = _Eqstd.GetSingleData(itemId);

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

                        this.txtseq_std.Text = (string)_Dr["EQ_STD"];

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

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


                        this.lblOperazione.Text      = "Modifica Standard Apparecchiatura: " + this.txtsdescrizione.Text;
                        this.lblFirstAndLast.Visible = true;
                        this.btnsElimina.Attributes.Add("onclick", "return confirm('Si vuole effettuare la cancellazione?')");
                        lblFirstAndLast.Text = _Eqstd.GetFirstAndLastUser(_Dr);
                    }
                }
                else
                {
                    this.lblOperazione.Text = "Inserimento Standard Apparecchiatura";
                    //BindServizi();
                    this.lblFirstAndLast.Visible = false;
                    this.btnsElimina.Visible     = false;
                }
                if (Request["TipoOper"] == "read")
                {
                    AbilitaControlli(false);
                    this.lblOperazione.Text = "Visualizzazione Standard Apparecchiatura: " + this.txtsdescrizione.Text;
                }
                ViewState["UrlReferrer"] = Request.UrlReferrer.ToString();
                if (Context.Handler is TheSite.Gestione.Eqstd)
                {
                    _fp = (TheSite.Gestione.Eqstd)Context.Handler;
                    this.ViewState.Add("mioContenitore", _fp._Contenitore);
                }
            }
        }