/// Al clic viene salvata la griglia preferita /// </summary> protected void BtnSavePrefGrid_Click(object sender, EventArgs e) { InfoUtente infoUtente = UserManager.getInfoUtente(this); string idGrid = Request.Form["rbl_pref"]; bool standard = false; if (!string.IsNullOrEmpty(idGrid)) { if (idGrid.Equals("-1")) { //Ho impostato la griglia standard, quindi mi limito a cancellare la vecchia griglia preferita per questa tipologia GridManager.RemovePreferredTypeGrid(infoUtente, GridManager.SelectedGrid.GridType); GridManager.SelectedGrid = GridManager.getUserGrid(GridManager.SelectedGrid.GridType); } else { List <GridBaseInfo> tempList = new List <GridBaseInfo>(this.ListGrid); GridBaseInfo tempGrid = (GridBaseInfo)tempList.Where(g => g.GridId.Equals(idGrid)).FirstOrDefault(); GridManager.AddPreferredGrid(tempGrid.GridId, infoUtente, GridManager.SelectedGrid.GridType); GridManager.SelectedGrid = GridManager.getUserGrid(GridManager.SelectedGrid.GridType); } ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "chiudi", "close_and_save();", true); } }
protected void ChangeSelectedGrid(object sender, EventArgs e) { List <GridBaseInfo> tempList = new List <GridBaseInfo>(this.listGrid); GridBaseInfo tempGrid = (GridBaseInfo)tempList.Where(g => g.GridId.Equals(this.ddl_ric_griglie.SelectedValue)).FirstOrDefault(); if (tempGrid.UserGrid) { this.rblVisibilita.Items[0].Selected = true; this.rblVisibilita.Items[1].Selected = false; this.bDeleteExtender.Enabled = false; this.bDeleteExtender.ConfirmOnFormSubmit = false; this.bDeleteExtender.Enabled = false; } else { this.rblVisibilita.Items[0].Selected = false; this.rblVisibilita.Items[1].Selected = true; this.bDeleteExtender.Enabled = true; } this.modify_g.Visible = true; this.txt_name_mod.Text = tempGrid.GridName; this.upChangeGridName.Update(); this.pnl_visibility.Update(); this.UpdatePanelConfirm.Update(); }
/* public void SetFocus() * { * ClientScript.RegisterStartupScript(this.GetType(), "focus", "setFocus();", true); * }*/ protected void DeleteGrid(object sender, EventArgs e) { ImageButton image = (ImageButton)sender; TableCell cell = (TableCell)image.Parent; DataGridItem dgItem = (DataGridItem)cell.Parent; Label a = (Label)dgItem.FindControl("SYSTEM_ID"); GridBaseInfo tempBase = new GridBaseInfo(); foreach (GridBaseInfo gri in this.ListGrid) { if (gri.GridId.Equals(a.Text)) { tempBase = gri; break; } } GridManager.RemoveGrid(tempBase); if (tempBase.IsPreferred) { GridManager.SelectedGrid = GridManager.getUserGrid(GridManager.SelectedGrid.GridType); } this.ListGrid = GridManager.GetGridsBaseInfo(this.infoUtente, GridManager.SelectedGrid.GridType, true); this.grvPreferred.DataSource = this.ListGrid; this.grvPreferred.CurrentPageIndex = 0; this.grvPreferred.DataBind(); this.box_preferred_grids.Update(); }
protected void ChangeSelectedGrid(object sender, EventArgs e) { try { List <GridBaseInfo> tempList = new List <GridBaseInfo>(this.listGrid); GridBaseInfo tempGrid = (GridBaseInfo)tempList.Where(g => g.GridId.Equals(this.ddl_ric_griglie.SelectedValue)).FirstOrDefault(); if (tempGrid.UserGrid) { this.rblVisibilita.Items[0].Selected = true; this.rblVisibilita.Items[1].Selected = false; } else { this.rblVisibilita.Items[0].Selected = false; this.rblVisibilita.Items[1].Selected = true; //this.bDeleteExtender.Enabled = true; } this.modify_g.Visible = true; this.txt_name_mod.Text = tempGrid.GridName; this.upChangeGridName.Update(); this.pnl_visibility.Update(); } catch (System.Exception ex) { UIManager.AdministrationManager.DiagnosticError(ex); return; } }
private void InitializeValue() { this.ListGrid = null; this.GridDelete = null; this.GetInitData(); string result = string.Empty; }
protected bool GetDeleteGridID(GridBaseInfo temp) { bool result = true; if (temp.GridId.Equals("-1")) { result = false; } return(result); }
protected bool GetRoleGridID(GridBaseInfo temp) { bool result = false; if (temp.RoleGrid) { result = true; } return(result); }
protected String GetGridPreferred(GridBaseInfo temp) { string result = string.Empty; if (temp.IsPreferred) { result = "checked"; } return(result); }
protected void DeleteGrid(object sender, EventArgs e) { try { this.GridDelete = null; InfoUtente infoutente = UserManager.GetInfoUser(); Ruolo ruolo = RoleManager.GetRoleInSession(); string clientID = ((CustomImageButton)sender).ClientID; clientID = clientID.Split('_').Last(); string id = ((Label)GridPreferred.Rows[int.Parse(clientID)].FindControl("SYSTEM_ID")).Text; GridBaseInfo tempBase = new GridBaseInfo(); foreach (GridBaseInfo gri in this.ListGrid) { if (gri.GridId.Equals(id)) { tempBase = gri; break; } } if (!tempBase.RoleGrid) { if (GridManager.RemoveGrid(tempBase, infoutente)) { if (tempBase.IsPreferred) { SelectedGrid = GridManager.getUserGrid(SelectedGrid.GridType, infoutente, ruolo); } this.ListGrid = GridManager.GetGridsBaseInfo(infoutente, SelectedGrid.GridType, true); this.GridPreferred.DataSource = this.ListGrid; //this.GridPreferred.CurrentPageIndex = 0; this.GridPreferred.DataBind(); this.UpnlGrid.Update(); } } else { string msg = "ConfirmDeleteRoleGrid"; string language = UIManager.UserManager.GetUserLanguage(); string msgTitleCnfirm = Utils.Languages.GetLabelFromCode("msgTitleCnfirm", language); this.GridDelete = tempBase; ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxConfirmModal", "ajaxConfirmModal('" + msg.Replace("'", @"\'") + "', 'HiddenConfirmDelete', '" + msgTitleCnfirm + "');", true); this.UpHiddenFields.Update(); } } catch (System.Exception ex) { UIManager.AdministrationManager.DiagnosticError(ex); return; } }
protected String GetImageRoleGridID(GridBaseInfo temp) { if (temp.RoleGrid) { return("../images/ricerca/check_grid.gif"); } else { return("../images/ricerca/no_check_grid.gif"); } }
protected String GetImageRoleGridID(GridBaseInfo temp) { if (temp.RoleGrid) { return("../Images/Icons/flag_ok.png"); } else { return("../Images/Icons/no_check_grid.gif"); } }
protected void ChangeMode(object sender, EventArgs e) { try { RadioButtonList obj = (RadioButtonList)sender; this.rblVisibilita.Items[0].Selected = true; this.rblVisibilita.Items[1].Selected = false; this.pnl_scelta.Visible = false; this.nuova_g.Visible = true; this.modify_g.Visible = false; if (obj.SelectedItem.Value.Equals("mod")) { this.pnl_scelta.Visible = true; this.nuova_g.Visible = false; InfoUtente infoUtente = UserManager.GetInfoUser(); this.ddl_ric_griglie.Items.Clear(); GridBaseInfo tempGrid = null; if (this.listGrid != null) { foreach (GridBaseInfo gb in this.listGrid) { if (!gb.IsSearchGrid && !gb.GridId.Equals("-1")) { ListItem it = new ListItem(gb.GridName, gb.GridId); this.ddl_ric_griglie.Items.Add(it); if (gb.IsPreferred) { tempGrid = gb; this.ddl_ric_griglie.SelectedValue = gb.GridId; } } } } if (tempGrid != null && !tempGrid.UserGrid) { //this.bDeleteExtender.Enabled = true; } this.modify_g.Visible = true; this.txt_name_mod.Text = this.ddl_ric_griglie.SelectedItem.Text; this.pnl_visibility.Update(); } this.upChangeGridName.Update(); this.upChangeGrid.Update(); } catch (System.Exception ex) { UIManager.AdministrationManager.DiagnosticError(ex); return; } }
protected String GetGridName(GridBaseInfo temp) { return(temp.GridName); }
protected String GetGridID(GridBaseInfo temp) { return(temp.GridId); }
protected void ChangeMode(object sender, EventArgs e) { RadioButtonList obj = (RadioButtonList)sender; if (obj.SelectedItem.Value.Equals("mod")) { this.pnl_scelta.Visible = true; this.nuova_g.Visible = false; InfoUtente infoUtente = UserManager.getInfoUtente(this); this.ddl_ric_griglie.Items.Clear(); GridBaseInfo tempGrid = null; if (this.listGrid != null && this.listGrid.Length > 0) { foreach (GridBaseInfo gb in this.listGrid) { if (!gb.IsSearchGrid && !gb.GridId.Equals("-1")) { ListItem it = new ListItem(gb.GridName, gb.GridId); this.ddl_ric_griglie.Items.Add(it); if (gb.IsPreferred) { tempGrid = gb; this.ddl_ric_griglie.SelectedValue = gb.GridId; } } } } if (tempGrid != null) { if (tempGrid.UserGrid) { this.rblVisibilita.Items[0].Selected = true; this.bDeleteExtender.Enabled = false; this.rblVisibilita.Items[1].Selected = false; } else { this.rblVisibilita.Items[1].Selected = true; this.bDeleteExtender.Enabled = true; this.rblVisibilita.Items[0].Selected = false; } } else { this.rblVisibilita.Items[0].Selected = true; this.bDeleteExtender.Enabled = false; this.rblVisibilita.Items[1].Selected = false; } this.modify_g.Visible = true; this.txt_name_mod.Text = this.ddl_ric_griglie.SelectedItem.Text; this.upChangeGridName.Update(); this.pnl_visibility.Update(); } else { this.pnl_scelta.Visible = false; this.nuova_g.Visible = true; this.rblVisibilita.Items[0].Selected = true; this.rblVisibilita.Items[1].Selected = false; this.modify_g.Visible = false; this.bDeleteExtender.Enabled = false; this.upChangeGridName.Update(); } this.upChangeGrid.Update(); this.UpdatePanelConfirm.Update(); }
protected bool GetGridPreferred(GridBaseInfo temp) { return(temp.IsPreferred); }