private static string Save(ApplicationMonitoredEventProcessingStateDataModel data, RequestProfile requestProfile, string action) { var sql = "EXEC "; switch (action) { case "Create": sql += "dbo.ApplicationMonitoredEventProcessingStateInsert " + " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId) + ", " + ToSQLParameter(BaseDataModel.BaseDataColumns.ApplicationId, requestProfile.ApplicationId); break; case "Update": sql += "dbo.ApplicationMonitoredEventProcessingStateUpdate " + " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId); break; default: break; } sql = sql + ", " + ToSQLParameter(data, ApplicationMonitoredEventProcessingStateDataModel.DataColumns.ApplicationMonitoredEventProcessingStateId) + ", " + ToSQLParameter(data, ApplicationMonitoredEventProcessingStateDataModel.DataColumns.Code) + ", " + ToSQLParameter(data, StandardDataModel.StandardDataColumns.Description); return(sql); }
protected override DataTable UpdateData() { var UpdatedData = new DataTable(); var data = new ApplicationMonitoredEventProcessingStateDataModel(); UpdatedData = Framework.Components.EventMonitoring.ApplicationMonitoredEventProcessingStateDataManager.Search(data, SessionVariables.RequestProfile).Clone(); for (var i = 0; i < SelectedData.Rows.Count; i++) { data.ApplicationMonitoredEventProcessingStateId = Convert.ToInt32(SelectedData.Rows[i][ApplicationMonitoredEventProcessingStateDataModel.DataColumns.ApplicationMonitoredEventProcessingStateId].ToString()); data.Code = !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(ApplicationMonitoredEventProcessingStateDataModel.DataColumns.Code)) ? CheckAndGetRepeaterTextBoxValue(ApplicationMonitoredEventProcessingStateDataModel.DataColumns.Code) : SelectedData.Rows[i][ApplicationMonitoredEventProcessingStateDataModel.DataColumns.Code].ToString(); data.Description = !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(ApplicationMonitoredEventProcessingStateDataModel.DataColumns.Description)) ? CheckAndGetRepeaterTextBoxValue(ApplicationMonitoredEventProcessingStateDataModel.DataColumns.Description) : SelectedData.Rows[i][ApplicationMonitoredEventProcessingStateDataModel.DataColumns.Description].ToString(); Framework.Components.EventMonitoring.ApplicationMonitoredEventProcessingStateDataManager.Update(data, SessionVariables.RequestProfile); data = new ApplicationMonitoredEventProcessingStateDataModel(); data.ApplicationMonitoredEventProcessingStateId = Convert.ToInt32(SelectedData.Rows[i][ApplicationMonitoredEventProcessingStateDataModel.DataColumns.ApplicationMonitoredEventProcessingStateId].ToString()); var dt = Framework.Components.EventMonitoring.ApplicationMonitoredEventProcessingStateDataManager.Search(data, SessionVariables.RequestProfile); if (dt.Rows.Count == 1) { UpdatedData.ImportRow(dt.Rows[0]); } } return(UpdatedData); }
public static string ToSQLParameter(ApplicationMonitoredEventProcessingStateDataModel data, string dataColumnName) { var returnValue = "NULL"; switch (dataColumnName) { case ApplicationMonitoredEventProcessingStateDataModel.DataColumns.ApplicationMonitoredEventProcessingStateId: if (data.ApplicationMonitoredEventProcessingStateId != null) { returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NUMBER, ApplicationMonitoredEventProcessingStateDataModel.DataColumns.ApplicationMonitoredEventProcessingStateId, data.ApplicationMonitoredEventProcessingStateId); } else { returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, ApplicationMonitoredEventProcessingStateDataModel.DataColumns.ApplicationMonitoredEventProcessingStateId); } break; case ApplicationMonitoredEventProcessingStateDataModel.DataColumns.Code: if (!string.IsNullOrEmpty(data.Code)) { returnValue = string.Format(SQL_TEMPLATE_PARAMETER_STRING_OR_DATE, ApplicationMonitoredEventProcessingStateDataModel.DataColumns.Code, data.Code.Trim()); } else { returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, ApplicationMonitoredEventProcessingStateDataModel.DataColumns.Code); } break; default: returnValue = StandardDataManager.ToSQLParameter(data, dataColumnName); break; } return(returnValue); }
protected override void ShowData(int applicationMonitoredEventProcessingStateId) { base.ShowData(applicationMonitoredEventProcessingStateId); oDetailButtonPanel.SetId = SetId; Clear(); var data = new ApplicationMonitoredEventProcessingStateDataModel(); data.ApplicationMonitoredEventProcessingStateId = applicationMonitoredEventProcessingStateId; var items = Framework.Components.EventMonitoring.ApplicationMonitoredEventProcessingStateDataManager.GetEntityDetails(data, SessionVariables.RequestProfile); // should only have single match if (items.Count == 1) { var item = items[0]; lblApplicationMonitoredEventProcessingStateId.Text = item.ApplicationMonitoredEventProcessingStateId.ToString(); lblCode.Text = item.Code.ToString(); lblDescription.Text = item.Description.ToString(); oUpdateInfo.LoadText(item.UpdatedDate, item.UpdatedBy, item.LastAction); oHistoryList.Setup(PrimaryEntity, applicationMonitoredEventProcessingStateId, "ApplicationMonitoredEventProcessingState"); } }
public static DataTable GetDetails(ApplicationMonitoredEventProcessingStateDataModel data, RequestProfile requestProfile) { var list = GetEntityDetails(data, requestProfile); var table = list.ToDataTable(); return(table); }
private System.Data.DataTable GetData() { // TODO: on all export pages var data = new ApplicationMonitoredEventProcessingStateDataModel(); var dt = Framework.Components.EventMonitoring.ApplicationMonitoredEventProcessingStateDataManager.Search(data, SessionVariables.RequestProfile); return(dt); }
private DataTable GetData(string code) { var data = new ApplicationMonitoredEventProcessingStateDataModel(); data.Code = code; var dt = Framework.Components.EventMonitoring.ApplicationMonitoredEventProcessingStateDataManager.Search(data, SessionVariables.RequestProfile); return(dt); }
protected override DataTable GetEntityData(int?entityKey) { var applicationMonitoredEventProcessingStatedata = new ApplicationMonitoredEventProcessingStateDataModel(); applicationMonitoredEventProcessingStatedata.ApplicationMonitoredEventProcessingStateId = entityKey; var results = Framework.Components.EventMonitoring.ApplicationMonitoredEventProcessingStateDataManager.Search(applicationMonitoredEventProcessingStatedata, SessionVariables.RequestProfile); return(results); }
private static DataSet GetChildren(ApplicationMonitoredEventProcessingStateDataModel data, RequestProfile requestProfile) { var sql = "EXEC dbo.ApplicationMonitoredEventProcessingStateChildrenGet " + " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId) + ", " + ToSQLParameter(data, ApplicationMonitoredEventProcessingStateDataModel.DataColumns.ApplicationMonitoredEventProcessingStateId); var oDT = new DataAccess.DBDataSet("Get Children", sql, DataStoreKey); return(oDT.DBDataset); }
protected override void Clear() { base.Clear(); var data = new ApplicationMonitoredEventProcessingStateDataModel(); ApplicationMonitoredEventProcessingStateId = data.ApplicationMonitoredEventProcessingStateId; Code = data.Code; Description = data.Description; }
protected override void Update(Dictionary <string, string> values) { var data = new ApplicationMonitoredEventProcessingStateDataModel(); // copies properties from values dictionary object to data object PropertyMapper.CopyProperties(data, values); Framework.Components.EventMonitoring.ApplicationMonitoredEventProcessingStateDataManager.Update(data, SessionVariables.RequestProfile); base.Update(values); }
public static DataTable DoesExist(ApplicationMonitoredEventProcessingStateDataModel data, RequestProfile requestProfile) { var sql = "EXEC dbo.ApplicationMonitoredEventProcessingStateSearch " + " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId) + ", " + ToSQLParameter(BaseDataModel.BaseDataColumns.ApplicationId, requestProfile.ApplicationId) + ", " + ToSQLParameter(data, ApplicationMonitoredEventProcessingStateDataModel.DataColumns.ApplicationMonitoredEventProcessingStateId); var oDT = new DataAccess.DBDataTable("ApplicationMonitoredEventProcessingState.DoesExist", sql, DataStoreKey); return(oDT.DBTable); }
public static void Delete(ApplicationMonitoredEventProcessingStateDataModel dataQuery, RequestProfile requestProfile) { const string sql = @"dbo.ApplicationMonitoredEventProcessingStateDelete "; var parameters = new { AuditId = requestProfile.AuditId , ApplicationMonitoredEventProcessingStateId = dataQuery.ApplicationMonitoredEventProcessingStateId }; using (var dataAccess = new DataAccessBase(DataStoreKey)) { dataAccess.Connection.Execute(sql, parameters, commandType: CommandType.StoredProcedure); } }
public static bool IsDeletable(ApplicationMonitoredEventProcessingStateDataModel data, RequestProfile requestProfile) { var isDeletable = true; var ds = GetChildren(data, requestProfile); if (ds != null && ds.Tables.Count > 0) { foreach (DataTable dt in ds.Tables) { if (dt.Rows.Count > 0) { isDeletable = false; break; } } } return(isDeletable); }
protected void btnDelete_Click(object sender, EventArgs e) { try { string[] deleteIndexList = DeleteIds.Split(','); foreach (string index in deleteIndexList) { var data = new ApplicationMonitoredEventProcessingStateDataModel(); data.ApplicationMonitoredEventProcessingStateId = int.Parse(index); Framework.Components.EventMonitoring.ApplicationMonitoredEventProcessingStateDataManager.Delete(data, SessionVariables.RequestProfile); } DeleteAndRedirect(); } catch (Exception ex) { Response.Write(ex.Message); } }
public override int?Save(string action) { var data = new ApplicationMonitoredEventProcessingStateDataModel(); data.ApplicationMonitoredEventProcessingStateId = ApplicationMonitoredEventProcessingStateId; data.Code = Code; data.Description = Description; if (action == "Insert") { Framework.Components.EventMonitoring.ApplicationMonitoredEventProcessingStateDataManager.Create(data, SessionVariables.RequestProfile); } else { Framework.Components.EventMonitoring.ApplicationMonitoredEventProcessingStateDataManager.Update(data, SessionVariables.RequestProfile); } // not correct ... when doing insert, we didn't get/change the value of ReleaseLogID ? return(ApplicationMonitoredEventProcessingStateId); }
public void LoadData(int applicationMonitoredEventProcessingStateId, bool showId) { // clear UI Clear(); // set up parameters var data = new ApplicationMonitoredEventProcessingStateDataModel(); data.ApplicationMonitoredEventProcessingStateId = applicationMonitoredEventProcessingStateId; // get data var items = Framework.Components.EventMonitoring.ApplicationMonitoredEventProcessingStateDataManager.GetEntityDetails(data, SessionVariables.RequestProfile); // should only have single match -- should log exception. if (items.Count != 1) { return; } var item = items[0]; ApplicationMonitoredEventProcessingStateId = item.ApplicationMonitoredEventProcessingStateId; Code = item.Code; Description = item.Description; if (!showId) { txtApplicationMonitoredEventProcessingStateId.Text = item.ApplicationMonitoredEventProcessingStateId.ToString(); //PlaceHolderAuditHistory.Visible = true; // only show Audit History in case of Update page, not for Clone. oHistoryList.Setup(base.PrimaryEntity, applicationMonitoredEventProcessingStateId, PrimaryEntityKey); } else { txtApplicationMonitoredEventProcessingStateId.Text = String.Empty; } oUpdateInfo.LoadText(item.UpdatedDate, item.UpdatedBy, item.LastAction); }
protected override DataTable GetData() { try { SuperKey = ApplicationCommon.GetSuperKey(); SetId = ApplicationCommon.GetSetId(); var selectedrows = new DataTable(); var applicationMonitoredEventProcessingStatedata = new ApplicationMonitoredEventProcessingStateDataModel(); selectedrows = Framework.Components.EventMonitoring.ApplicationMonitoredEventProcessingStateDataManager.GetDetails(applicationMonitoredEventProcessingStatedata, SessionVariables.RequestProfile).Clone(); if (!string.IsNullOrEmpty(SuperKey)) { var systemEntityTypeId = (int)PrimaryEntity; var lstEntityKeys = ApplicationCommon.GetSuperKeyDetails(systemEntityTypeId, SuperKey); foreach (var entityKey in lstEntityKeys) { applicationMonitoredEventProcessingStatedata.ApplicationMonitoredEventProcessingStateId = entityKey; var result = Framework.Components.EventMonitoring.ApplicationMonitoredEventProcessingStateDataManager.GetDetails(applicationMonitoredEventProcessingStatedata, SessionVariables.RequestProfile); selectedrows.ImportRow(result.Rows[0]); } } else { applicationMonitoredEventProcessingStatedata.ApplicationMonitoredEventProcessingStateId = SetId; var result = Framework.Components.EventMonitoring.ApplicationMonitoredEventProcessingStateDataManager.GetDetails(applicationMonitoredEventProcessingStatedata, SessionVariables.RequestProfile); selectedrows.ImportRow(result.Rows[0]); } return(selectedrows); } catch (Exception ex) { Response.Write(ex.Message); } return(null); }
public static void Update(ApplicationMonitoredEventProcessingStateDataModel data, RequestProfile requestProfile) { var sql = Save(data, requestProfile, "Update"); DataAccess.DBDML.RunSQL("ApplicationMonitoredEventProcessingState.Update", sql, DataStoreKey); }
public static List <ApplicationMonitoredEventProcessingStateDataModel> GetEntityDetails(ApplicationMonitoredEventProcessingStateDataModel dataQuery, RequestProfile requestProfile, int returnAuditInfo = BaseDataManager.ReturnAuditInfoOnDetails) { const string sql = @"dbo.ApplicationMonitoredEventProcessingStateSearch "; var parameters = new { AuditId = requestProfile.AuditId , ApplicationMonitoredEventProcessingStateId = dataQuery.ApplicationMonitoredEventProcessingStateId , ReturnAuditInfo = returnAuditInfo , ApplicationMode = requestProfile.ApplicationModeId , ApplicationId = requestProfile.ApplicationId , Code = dataQuery.Code }; List <ApplicationMonitoredEventProcessingStateDataModel> result; using (var dataAccess = new DataAccessBase(DataStoreKey)) { result = dataAccess.Connection.Query <ApplicationMonitoredEventProcessingStateDataModel>(sql, parameters, commandType: CommandType.StoredProcedure).ToList(); } return(result); }
public static ApplicationMonitoredEventProcessingStateDataModel GetDetails(ApplicationMonitoredEventProcessingStateDataModel data, RequestProfile requestProfile) { var list = GetEntityDetails(data, requestProfile, 1); return(list.FirstOrDefault()); }