private DominoCustomStatValues CollectDataForDominoCustomStat() { try { //DominoStatistic DominoCustomStatValues DominoCustomObject = new DominoCustomStatValues(); DominoCustomObject.ServerName = DServerComboBox.Text; DominoCustomObject.StatName = DStatComboBox.Text; DominoCustomObject.ThresholdValue = float.Parse(ThresholdTextBox.Text); DominoCustomObject.TimesInARow = int.Parse(TimesInRowTextBox.Text); if (GreaterRadioButton.Checked == true) { DominoCustomObject.GreaterThanORLessThan = "Greater Than"; } else { DominoCustomObject.GreaterThanORLessThan = "Less than"; } DominoCustomObject.ConsoleCommand = ConsolecmdTextBox.Text; if (Mode == "Update") { DominoCustomObject.ID = ServerKey; } return(DominoCustomObject); } catch (Exception ex) { //6/27/2014 NS added for VSPLUS-634 Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); throw ex; } finally { } }
/// <summary> /// Get Data from DominoCustomStatValues based on Key /// </summary> /// <param name="DCSObject">DominoCustomStatValues object</param> /// <returns></returns> public DominoCustomStatValues GetData(DominoCustomStatValues DCSObject) { DataTable DominoCustomStatDataTable = new DataTable(); DominoCustomStatValues ReturnDCSObject = new DominoCustomStatValues(); try { string SqlQuery = "Select * from DominoCustomStatValues where ID=" + DCSObject.ID.ToString(); DominoCustomStatDataTable = objAdaptor.FetchData(SqlQuery); //populate & return data object ReturnDCSObject.ServerName = DominoCustomStatDataTable.Rows[0]["ServerName"].ToString(); ReturnDCSObject.StatName = DominoCustomStatDataTable.Rows[0]["StatName"].ToString(); if (DominoCustomStatDataTable.Rows[0]["ThresholdValue"].ToString() != "") { ReturnDCSObject.ThresholdValue = float.Parse(DominoCustomStatDataTable.Rows[0]["ThresholdValue"].ToString()); } ReturnDCSObject.GreaterThanORLessThan = DominoCustomStatDataTable.Rows[0]["GreaterThanORLessThan"].ToString(); ReturnDCSObject.ConsoleCommand = DominoCustomStatDataTable.Rows[0]["ConsoleCommand"].ToString(); if (DominoCustomStatDataTable.Rows[0]["TimesInARow"].ToString() != "") { ReturnDCSObject.TimesInARow = int.Parse(DominoCustomStatDataTable.Rows[0]["TimesInARow"].ToString()); } } catch (Exception ex) { throw ex; } finally { } return(ReturnDCSObject); }
private void FillData(int ID) { try { DominoCustomStatValues DominoCustomObject = new DominoCustomStatValues(); DominoCustomStatValues ReturnDCustObject = new DominoCustomStatValues(); DominoCustomObject.ID = ID; ReturnDCustObject = VSWebBL.ConfiguratorBL.DominoCustomStatBL.Ins.GetData(DominoCustomObject); //DominoStatistic fields DServerComboBox.Text = ReturnDCustObject.ServerName.ToString(); DStatComboBox.Text = ReturnDCustObject.StatName.ToString(); ThresholdTextBox.Text = ReturnDCustObject.ThresholdValue.ToString(); if (ReturnDCustObject.GreaterThanORLessThan == "Greater Than") { GreaterRadioButton.Checked = true; } else { LessRadioButton.Checked = true; } TimesInRowTextBox.Text = ReturnDCustObject.TimesInARow.ToString(); ConsolecmdTextBox.Text = ReturnDCustObject.ConsoleCommand.ToString(); } catch (Exception ex) { //6/27/2014 NS added for VSPLUS-634 Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); throw ex; } finally { } }
/// <summary> /// Call to Insert Data into DominoCustomStatValues /// </summary> /// <param name="DominoClusterObject">DominoCustomStatValues object</param> /// <returns></returns> public bool InsertData(DominoCustomStatValues DominoCustomstatObject) { try { return(VSWebDAL.ConfiguratorDAL.DominoCustomStatisticsDAL.Ins.InsertData(DominoCustomstatObject)); } catch (Exception ex) { throw ex; } }
/// <summary> /// Call DAL Delete Data /// </summary> /// <param name="DCSObject"></param> /// <returns></returns> public Object DeleteData(DominoCustomStatValues DCSObject) { try { return(VSWebDAL.ConfiguratorDAL.DominoCustomStatisticsDAL.Ins.DeleteData(DCSObject)); } catch (Exception ex) { throw ex; } }
protected void DominoCustomGridView_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { DominoCustomStatValues DCustomObject = new DominoCustomStatValues(); DCustomObject.ID = Convert.ToInt32(e.Keys[0]); //Delete row from DB Object ReturnValue = VSWebBL.ConfiguratorBL.DominoCustomStatBL.Ins.DeleteData(DCustomObject); //Update Grid after inserting new row, refresh grid as in page load ASPxGridView gridView = (ASPxGridView)sender; gridView.CancelEdit(); e.Cancel = true; FillDominoCustomStatGrid(); }
/// <summary> /// Call to Update Data of DominoCustomStatValues based on Key /// </summary> /// <param name="DominoCustomstatObject">DominoCustomStatValues object</param> /// <returns>Object</returns> public Object UpdateData(DominoCustomStatValues DominoCustomstatObject) { try { Object ReturnValue = ValidateDCSUpdate(DominoCustomstatObject); if (ReturnValue.ToString() == "") { return(VSWebDAL.ConfiguratorDAL.DominoCustomStatisticsDAL.Ins.UpdateData(DominoCustomstatObject)); } else { return(ReturnValue); } } catch (Exception ex) { throw ex; } }
//delete Data from DominoCluster Table public Object DeleteData(DominoCustomStatValues DCSObject) { Object Update; try { string SqlQuery = "Delete DominoCustomStatValues Where ID=" + DCSObject.ID; Update = objAdaptor.ExecuteNonQuery(SqlQuery); } catch { Update = false; } finally { } return(Update); }
public Object ValidateDCSUpdate(DominoCustomStatValues DominoCustomstatObject) { Object ReturnValue = ""; try { if (DominoCustomstatObject.ServerName == null || DominoCustomstatObject.ServerName == "") { return("ER#Please select the server name"); } if (DominoCustomstatObject.StatName == null || DominoCustomstatObject.StatName == " ") { return("ER#Please select the stat"); } } catch (Exception ex) { throw ex; } finally { } return(""); }
/// <summary> /// Insert data into DominoCustomStatValues table /// </summary> /// <param name="DCSObject">DominoCustomStatValues object</param> /// <returns></returns> public bool InsertData(DominoCustomStatValues DCSObject) { bool Insert = false; try { string SqlQuery = "INSERT INTO DominoCustomStatValues(ServerName,StatName,ThresholdValue,GreaterThanORLessThan,TimesInARow,ConsoleCommand)" + " VALUES ('" + DCSObject.ServerName + "','" + DCSObject.StatName + "'," + DCSObject.ThresholdValue + ",'" + DCSObject.GreaterThanORLessThan + "'," + DCSObject.TimesInARow + ",'" + DCSObject.ConsoleCommand + "')"; Insert = objAdaptor.ExecuteNonQuery(SqlQuery); } catch { Insert = false; } finally { } return(Insert); }
/// <summary> /// Get all Data from DominoCustomStatValues /// </summary> /// <returns></returns> public DataTable GetAllData() { DataTable DominoCustomStatDataTable = new DataTable(); DominoCustomStatValues ReturnDSObject = new DominoCustomStatValues(); try { string SqlQuery = "SELECT ID,ServerName,StatName,ThresholdValue,GreaterThanORLessThan,TimesInARow,ConsoleCommand" + " FROM DominoCustomStatValues"; DominoCustomStatDataTable = objAdaptor.FetchData(SqlQuery); } catch (Exception ex) { throw ex; } finally { } return(DominoCustomStatDataTable); }
/// <summary> /// Insert data into DominoCustomStatValues table /// </summary> /// <param name="DCSObject">DominoCustomStatValues object</param> /// <returns></returns> public Object UpdateData(DominoCustomStatValues DCSObject) { Object Update; try { string SqlQuery = "UPDATE DominoCustomStatValues SET ServerName='" + DCSObject.ServerName + "',StatName='" + DCSObject.StatName + "', ThresholdValue=" + DCSObject.ThresholdValue + ",GreaterThanORLessThan='" + DCSObject.GreaterThanORLessThan + "' ,TimesInARow= " + DCSObject.TimesInARow + " ,ConsoleCommand='" + DCSObject.ConsoleCommand + "' WHERE ID = '" + DCSObject.ID + "'"; Update = objAdaptor.ExecuteNonQuery(SqlQuery); } catch { Update = false; } finally { } return(Update); }