public void fillgridbySession() { DataTable d = new DataTable(); try { if ((Session["BlackBerryServers"] != null) && (Session["BlackBerryServers"] != "")) { d = (DataTable)Session["BlackBerryServers"]; if (d.Rows.Count > 0) { BlackBerryGridView.DataSource = d; BlackBerryGridView.DataBind(); } } } catch (Exception ex) { //6/27/2014 NS added for VSPLUS-634 Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); throw ex; } }
protected void BlackBerryGridView_SelectionChanged(object sender, EventArgs e) { if (BlackBerryGridView.Selection.Count > 0) { System.Collections.Generic.List <object> Type = BlackBerryGridView.GetSelectedFieldValues("SID"); if (Type.Count > 0) { string ID = Type[0].ToString(); //Mukund: VSPLUS-844, Page redirect on callback try { DevExpress.Web.ASPxWebControl.RedirectOnCallback("BlackBerryEntertpriseServer.aspx?Key=" + ID + ""); Context.ApplicationInstance.CompleteRequest();//Mukund, 05Aug14, VSPLUS-844:Page redirect on callback } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); //throw ex; } } } }
public void fillgrid() { // DataTable dt = VSWebBL.ConfiguratorBL.BlackBerryServersBL.Ins.fillgrid(); try { if (Session["UserID"] != null) { UserID = Convert.ToInt32(Session["UserID"]); } DataTable dt = VSWebBL.ConfiguratorBL.BlackBerryServersBL.Ins.getfillgridbyUser(UserID); if (dt.Rows.Count > 0) { if (Session["RestrictedServers"] != "" && Session["RestrictedServers"] != null) { List <int> ServerID = new List <int>(); List <int> LocationID = new List <int>(); DataTable resServers = (DataTable)Session["RestrictedServers"]; foreach (DataRow dominorow in dt.Rows) { foreach (DataRow resser in resServers.Rows) { if (resser["serverid"].ToString() == dominorow["SID"].ToString()) { ServerID.Add(dt.Rows.IndexOf(dominorow)); } if (resser["locationID"].ToString() == dominorow["LocationID"].ToString()) { LocationID.Add(Convert.ToInt32(dominorow["LocationID"].ToString())); //LocationID.Add(dt.Rows.IndexOf(dominorow)); } } } foreach (int Id in ServerID) { dt.Rows[Id].Delete(); } dt.AcceptChanges(); //foreach (int Lid in LocationID) //{ // dt.Rows[Lid].Delete(); //} foreach (int lid in LocationID) { DataRow[] row = dt.Select("LocationID=" + lid + ""); for (int i = 0; i < row.Count(); i++) { dt.Rows.Remove(row[i]); dt.AcceptChanges(); } } dt.AcceptChanges(); } Session["BlackBerryServers"] = dt; BlackBerryGridView.DataSource = dt; BlackBerryGridView.DataBind(); } } catch (Exception ex) { //6/27/2014 NS added for VSPLUS-634 Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); throw ex; } }