private void FillDominoServerGridfromSession()
 {
     try
     {
         DataTable DSTaskSettingsDataTable = new DataTable();
         if (Session["DominoServer"] != null && Session["DominoServer"] != "")
         {
             DSTaskSettingsDataTable = (DataTable)Session["DominoServer"];//VSWebBL.ConfiguratorBL.DominoPropertiesBL.Ins.GetAllData();
         }
         if (DSTaskSettingsDataTable.Rows.Count > 0)
         {
             DominoServerGridView.DataSource = DSTaskSettingsDataTable;
             DominoServerGridView.DataBind();
         }
     }
     catch (Exception ex)
     {
         //6/27/2014 NS added for VSPLUS-634
         Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
         throw ex;
     }
     finally { }
 }
        protected void DominoServerGridView_SelectionChanged(object sender, EventArgs e)
        {
            if (DominoServerGridView.Selection.Count > 0)
            {
                System.Collections.Generic.List <object> Type = DominoServerGridView.GetSelectedFieldValues("ID");

                if (Type.Count > 0)
                {
                    string ID = Type[0].ToString();
                    Session["Key"] = ID;
                    //Mukund: VSPLUS-844, Page redirect on callback
                    try
                    {
                        DevExpress.Web.ASPxWebControl.RedirectOnCallback("DominoProperties.aspx?Key=" + Session["Key"]);
                        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;
                    }
                }
            }
        }
        //protected void Page_Init(object sender, EventArgs e)
        //{

        //    //FillDominoServerGrid();
        //}
        /// <summary>
        /// Fill grid DominoServerGridView
        /// </summary>
        /// <param name="ServerKey"></param>
        private void FillDominoServerGrid()
        {
            try
            {
                DataTable DSTaskSettingsDataTable = new DataTable();
                if (Session["UserID"] != null)
                {
                    Userid = Convert.ToInt32(Session["UserID"]);
                }
                //DSTaskSettingsDataTable = VSWebBL.ConfiguratorBL.DominoPropertiesBL.Ins.GetAllData();
                DSTaskSettingsDataTable = VSWebBL.ConfiguratorBL.DominoPropertiesBL.Ins.GetAllDataforuserrestrictions(Userid);

                if (DSTaskSettingsDataTable.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 resser in resServers.Rows)
                        {
                            foreach (DataRow dominorow in DSTaskSettingsDataTable.Rows)
                            {
                                if (resser["serverid"].ToString() == dominorow["ID"].ToString())
                                {
                                    ServerID.Add(DSTaskSettingsDataTable.Rows.IndexOf(dominorow));
                                }
                                if (resser["locationID"].ToString() == dominorow["locationid"].ToString())
                                {
                                    LocationID.Add(Convert.ToInt32(dominorow["locationid"].ToString()));
                                    //LocationID.Add(DSTaskSettingsDataTable.Rows.IndexOf(dominorow));
                                }
                            }
                        }
                        foreach (int Id in ServerID)
                        {
                            DSTaskSettingsDataTable.Rows[Id].Delete();
                        }
                        DSTaskSettingsDataTable.AcceptChanges();

                        //foreach (int Lid in LocationID)
                        //{
                        //    DSTaskSettingsDataTable.Rows[Lid].Delete();
                        //}
                        foreach (int lid in LocationID)
                        {
                            DataRow[] row = DSTaskSettingsDataTable.Select("locationid=" + lid + "");
                            for (int i = 0; i < row.Count(); i++)
                            {
                                DSTaskSettingsDataTable.Rows.Remove(row[i]);
                                DSTaskSettingsDataTable.AcceptChanges();
                            }
                        }
                        DSTaskSettingsDataTable.AcceptChanges();
                    }
                    Session["DominoServer"]         = DSTaskSettingsDataTable;
                    DominoServerGridView.DataSource = DSTaskSettingsDataTable;
                    DominoServerGridView.DataBind();
                }
            }
            catch (Exception ex)
            {
                //6/27/2014 NS added for VSPLUS-634
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                throw ex;
            }
            finally { }
        }