Beispiel #1
0
        private void btnsSalva_Click(object sender, System.EventArgs e)
        {
            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.PmpFrequenza _PmpFrequenza = new TheSite.Classi.ClassiAnagrafiche.PmpFrequenza();
                    i_RowsAffected = _PmpFrequenza.Add(_SCollection);
                    _PmpFrequenza.DeleteFreqStag(i_RowsAffected);
                    if (cmbsTipoCadenza.SelectedValue == "1")
                    {
                        SaveStag(i_RowsAffected);
                    }
                }
                else
                {
                    Classi.ClassiAnagrafiche.PmpFrequenza _PmpFrequenza = new TheSite.Classi.ClassiAnagrafiche.PmpFrequenza();
                    i_RowsAffected = _PmpFrequenza.Update(_SCollection, itemId);
                    _PmpFrequenza.DeleteFreqStag(i_RowsAffected);
                    if (cmbsTipoCadenza.SelectedValue == "1")
                    {
                        SaveStag(i_RowsAffected);
                    }
                }

                if (i_RowsAffected == -11)
                {
                    Classi.SiteJavaScript.msgBox(this.Page, "Tipo Frequenza già presente.");
                }
                else
                {
                    //Response.Redirect((String) ViewState["UrlReferrer"]);
                    Server.Transfer("PmpFrequenza.aspx");
                }
            }
            catch (Exception ex)
            {
                string s_Err = ex.Message.ToString().ToUpper();
                PanelMess.ShowError(s_Err, true);
            }
        }
Beispiel #2
0
 private void btnsElimina_Click(object sender, System.EventArgs e)
 {
     try
     {
         int i_RowsAffected = 0;
         S_Controls.Collections.S_ControlsCollection _SCollection = new S_Controls.Collections.S_ControlsCollection();
         _SCollection.AddItems(this.PanelEdit.Controls);
         Classi.ClassiAnagrafiche.PmpFrequenza _PmpFrequenza = new TheSite.Classi.ClassiAnagrafiche.PmpFrequenza();
         _PmpFrequenza.DeleteFreqStag(itemId);
         i_RowsAffected = _PmpFrequenza.Delete(_SCollection, itemId);
         if (i_RowsAffected == -1)
         {
             //Response.Redirect((String) ViewState["UrlReferrer"]);
             Server.Transfer("PmpFrequenza.aspx");
         }
     }
     catch (Exception ex)
     {
         string s_Err = ex.Message.ToString().ToUpper();
         PanelMess.ShowError(s_Err, true);
     }
 }