if (e.ColumnIndex == 5 && e.RowIndex >= 0) { this.grdAppPools.CommitEdit(DataGridViewDataErrorContexts.Commit); //Creation of Application Pool #region CreateAppPool if ((bool)this.grdAppPools.CurrentCell.Value == true) { try { Common.WriteLog("Application Pools Creation Process Started in the Server " + ServerName, LogPath); IIS_Service_Mngr objmngr = new IIS_Service_Mngr(); string strOutputMsg = string.Empty; //create Application Pool with parameters (poolname,Enable32bit,Mode(integrated/classic),runtimeVersion(2.0/4.0) if (objmngr.CreateAppPool(grdAppPools.Rows[e.RowIndex].Cells[1].Value.ToString(), Boolean.Parse(grdAppPools.Rows[e.RowIndex].Cells[4].Value.ToString()), grdAppPools.Rows[e.RowIndex].Cells[2].Value.ToString(), grdAppPools.Rows[e.RowIndex].Cells[3].Value.ToString(), ServerName, ref strOutputMsg)) { grdAppPools.Rows[e.RowIndex].Cells[5].Value = 1; //Select check box state with in the Apppool gridview grdAppPools.Rows[e.RowIndex].Cells[6].Value = "Installed"; //Update Application Pool Status in Xml File Configured in app.config #region Update Application Pool Status in Xml File Configured in app.config Common.UpdateXmlSchema_Config(ApplicationPool_XmlFilePath, "ApplicationPool", "Installed", e.RowIndex); #endregion } else { grdAppPools.Rows[e.RowIndex].Cells[5].Value = 1; //Select check box state with in the Apppool gridview grdAppPools.Rows[e.RowIndex].Cells[6].Value = "Failed"; //Update Application Pool Status in Xml File Configured in app.config #region Update Application Pool Status in Xml File Configured in app.config Common.UpdateXmlSchema_Config(ApplicationPool_XmlFilePath, "ApplicationPool", "Failed",e.RowIndex); #endregion } dtAppPools.AcceptChanges(); grdAppPools.DataSource = dtAppPools; if (!string.IsNullOrEmpty(strOutputMsg)) { MessageBox.Show(strOutputMsg); } Common.WriteLog("Application Pools Creation Process Completed in the Server " + ServerName, LogPath); } catch (Exception ex) { Common.WriteLog("Application Pool Creation Process Failed in the Method " + MethodInfo.GetCurrentMethod() + " with Exception " + ex.Message + "with inner Exception " + ex.InnerException + "at " + ex.StackTrace.ToString() + "in the Server " + ServerName + Environment.NewLine, LogPath); } } #endregion
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)