/// <summary> /// Muestra el formulario para la edición de un elemento existente. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected override void ShowEditForm(object sender, UbiquicityEventArg e) { int id = Convert.ToInt32(e.TheObject); Session["Ubiquicity_itemId"] = id; MapManager mapManager = new MapManager(); Map map = mapManager.Get(id); if (map == null && mapManager.HasErrors) { Alert.ShowUP("Error", mapManager.ErrorDescription); } else { //TODO - agregar controles de error CategoryManager newsCategoryManager = new CategoryManager(); List <Category> newsCategories = newsCategoryManager.Get(); UCFormMap.CleanForm(newsCategories); UCFormMap.FillForm(map); Session["Ubiquicity_action"] = EDIT; //Page.ClientScript.RegisterStartupScript(this.GetType(), "openModalEdit", "window.onload = function() { $('#modalMap').modal('show'); }", true); ScriptManager.RegisterStartupScript(upUCModalForm, upUCModalForm.GetType(), "openModalEdit", "$('#modalMap').modal('show');", true); upUCModalForm.Update(); } }
/// <summary> /// Muestra el formulairo para el alta de un nuevo mapa. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected override void ShowNewForm(object sender, UbiquicityEventArg e) { CategoryManager categoryManager = new CategoryManager(); List <Category> categories = categoryManager.Get(); UCFormMap.CleanForm(categories); Session["Ubiquicity_action"] = CREATE; //Page.ClientScript.RegisterStartupScript(this.GetType(), "openModalCreate", "window.onload = function() { $('#modalMap').modal('show'); }", true); ScriptManager.RegisterStartupScript(upUCModalForm, upUCModalForm.GetType(), "openModalCreate", "$('#modalMap').modal('show');", true); upUCModalForm.Update(); }