예제 #1
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     MENU menu = null;
     Guid padreSeleccionado = Guid.Empty;
     try
     {
         IMenus bdd = new BusinessLogic();
         if (Session["menuSeleccionado"] != null)
         {
             menu = Session["menuSeleccionado"] as MENU;
             menu = menu.MarkAsModified();
         }
         else
         {
             menu = new MENU();
             menu.IDMENU = Guid.NewGuid();
         }
         padreSeleccionado = new Guid(ddlPadreMenu.SelectedValue);
         if (padreSeleccionado != Guid.Empty)
         {
             menu.NIVELMENU = 1;
             menu.IDMENUPADRE = padreSeleccionado;
         }
         else
             menu.NIVELMENU = 0;
         menu.RUTA = txtRuta.Text;
         menu.DESCRIPCIONMENU = txtDescripcion.Text;
         bdd.SaveMenu(menu);
         Response.Redirect("~/ui/MantenimientoMenus.aspx");
     }
     catch (Exception ex)
     {
         lblError.Visible = true;
         lblError.Text = ex.Message;
     }
 }
예제 #2
0
파일: ROLMENU.cs 프로젝트: ramirobr/DQBase
        private void FixupMENU(MENU previousValue)
        {
            if (IsDeserializing)
            {
                return;
            }

            if (previousValue != null && previousValue.ROLMENU.Contains(this))
            {
                previousValue.ROLMENU.Remove(this);
            }

            if (MENU != null)
            {
                if (!MENU.ROLMENU.Contains(this))
                {
                    MENU.ROLMENU.Add(this);
                }

                IDMENU = MENU.IDMENU;
            }
            if (ChangeTracker.ChangeTrackingEnabled)
            {
                if (ChangeTracker.OriginalValues.ContainsKey("MENU")
                    && (ChangeTracker.OriginalValues["MENU"] == MENU))
                {
                    ChangeTracker.OriginalValues.Remove("MENU");
                }
                else
                {
                    ChangeTracker.RecordOriginalValue("MENU", previousValue);
                }
                if (MENU != null && !MENU.ChangeTracker.ChangeTrackingEnabled)
                {
                    MENU.StartTracking();
                }
            }
        }