protected override void ShowData(int developerRoleId) { base.ShowData(developerRoleId); oDetailButtonPanel.SetId = SetId; Clear(); var data = new DeveloperRoleDataModel(); data.DeveloperRoleId = developerRoleId; var items = TaskTimeTracker.Components.Module.ApplicationDevelopment.DeveloperRoleDataManager.GetEntityDetails(data, SessionVariables.RequestProfile); if (items.Count == 1) { var item = items[0]; lblApplication.Text = item.Application; SetData(item); oUpdateInfo.LoadText(item.UpdatedDate, item.UpdatedBy, item.LastAction); oHistoryList.Setup(PrimaryEntity, developerRoleId, "DeveloperRole"); } }
public static int Create(DeveloperRoleDataModel data, RequestProfile requestProfile) { var sql = CreateOrUpdate(data, requestProfile, "Create"); var Id = DBDML.RunScalarSQL("DeveloperRole.Insert", sql, DataStoreKey); return(Convert.ToInt32(Id)); }
public override int?Save(string action) { var data = new DeveloperRoleDataModel(); data.DeveloperRoleId = SystemKeyId; data.Name = Name; data.Description = Description; data.SortOrder = SortOrder; data.ApplicationId = ApplicationId; if (action == "Insert") { var dtDeveloperRole = TaskTimeTracker.Components.Module.ApplicationDevelopment.DeveloperRoleDataManager.DoesExist(data, SessionVariables.RequestProfile); if (dtDeveloperRole.Rows.Count == 0) { TaskTimeTracker.Components.Module.ApplicationDevelopment.DeveloperRoleDataManager.Create(data, SessionVariables.RequestProfile); } else { throw new Exception("Record with given ID already exists."); } } else { TaskTimeTracker.Components.Module.ApplicationDevelopment.DeveloperRoleDataManager.Update(data, SessionVariables.RequestProfile); } return(data.DeveloperRoleId); }
public void LoadData(int DeveloperRoleId, bool showId) { Clear(); var data = new DeveloperRoleDataModel(); data.DeveloperRoleId = DeveloperRoleId; var items = TaskTimeTracker.Components.Module.ApplicationDevelopment.DeveloperRoleDataManager.GetEntityDetails(data, SessionVariables.RequestProfile); if (items.Count != 1) { return; } var item = items[0]; ApplicationId = item.ApplicationId; SetData(item); if (!showId) { SystemKeyId = item.DeveloperRoleId; oHistoryList.Setup(PrimaryEntity, DeveloperRoleId, PrimaryEntityKey); } else { CoreSystemKey.Text = String.Empty; } }
private static string CreateOrUpdate(DeveloperRoleDataModel data, RequestProfile requestProfile, string action) { var sql = "EXEC "; switch (action) { case "Create": sql += "dbo.DeveloperRoleInsert " + " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId) + ", " + ToSQLParameter(data, DeveloperRoleDataModel.BaseDataColumns.ApplicationId); break; case "Update": sql += "dbo.DeveloperRoleUpdate " + " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId) + ", " + ToSQLParameter(data, DeveloperRoleDataModel.BaseDataColumns.ApplicationId); break; default: break; } sql = sql + ", " + ToSQLParameter(data, DeveloperRoleDataModel.DataColumns.DeveloperRoleId) + ", " + ToSQLParameter(data, DeveloperRoleDataModel.StandardDataColumns.Name) + ", " + ToSQLParameter(data, DeveloperRoleDataModel.StandardDataColumns.Description) + ", " + ToSQLParameter(data, DeveloperRoleDataModel.StandardDataColumns.SortOrder); return(sql); }
public static DataTable Search(DeveloperRoleDataModel data, RequestProfile requestProfile) { var list = GetEntityDetails(data, requestProfile, 0); var table = list.ToDataTable(); return(table); }
protected override void Clear() { base.Clear(); var data = new DeveloperRoleDataModel(); SetData(data); }
protected override DataTable GetEntityData(int?entityKey) { var developerRoledata = new DeveloperRoleDataModel(); developerRoledata.DeveloperRoleId = entityKey; var results = TaskTimeTracker.Components.Module.ApplicationDevelopment.DeveloperRoleDataManager.Search(developerRoledata, SessionVariables.RequestProfile); return(results); }
private System.Data.DataTable GetData() { // TODO: on all export pages var data = new DeveloperRoleDataModel(); var dt = TaskTimeTracker.Components.Module.ApplicationDevelopment.DeveloperRoleDataManager.Search(data, SessionVariables.RequestProfile); return(dt); }
public static DataSet DeleteChildren(DeveloperRoleDataModel data, RequestProfile requestProfile) { var sql = "EXEC dbo.DeveloperRoleChildrenDelete " + " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId) + ", " + ToSQLParameter(data, DeveloperRoleDataModel.DataColumns.DeveloperRoleId); var oDT = new DBDataSet("DeveloperRole.DeleteChildren", sql, DataStoreKey); return(oDT.DBDataset); }
public static bool DoesExist(DeveloperRoleDataModel data, RequestProfile requestProfile) { var doesExistRequest = new DeveloperRoleDataModel(); doesExistRequest.Name = data.Name; var list = GetEntityDetails(doesExistRequest, requestProfile, 0); return(list.Count > 0); }
protected override void Update(Dictionary <string, string> values) { var data = new DeveloperRoleDataModel(); // copies properties from values dictionary object to data object PropertyMapper.CopyProperties(data, values); TaskTimeTracker.Components.Module.ApplicationDevelopment.DeveloperRoleDataManager.Update(data, SessionVariables.RequestProfile); base.Update(values); }
private DataTable GetData(string name) { var data = new DeveloperRoleDataModel(); data.Name = name; var dt = TaskTimeTracker.Components.Module.ApplicationDevelopment.DeveloperRoleDataManager.Search(data, SessionVariables.RequestProfile); return(dt); }
private void UpdateData(ArrayList values) { var data = new DeveloperRoleDataModel(); data.DeveloperRoleId = int.Parse(values[0].ToString()); data.Name = values[1].ToString(); data.Description = values[2].ToString(); data.SortOrder = int.Parse(values[3].ToString()); TaskTimeTracker.Components.Module.ApplicationDevelopment.DeveloperRoleDataManager.Update(data, SessionVariables.RequestProfile); ReBindEditableGrid(); }
public static bool IsDeletable(DeveloperRoleDataModel data, RequestProfile requestProfile) { var isDeletable = true; var ds = GetChildren(data, requestProfile); if (ds != null && ds.Tables.Count > 0) { if (ds.Tables.Cast <DataTable>().Any(dt => dt.Rows.Count > 0)) { isDeletable = false; } } return(isDeletable); }
public static string ToSQLParameter(DeveloperRoleDataModel data, string dataColumnName) { var returnValue = "NULL"; switch (dataColumnName) { case DeveloperRoleDataModel.DataColumns.DeveloperRoleId: if (data.DeveloperRoleId != null) { returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NUMBER, DeveloperRoleDataModel.DataColumns.DeveloperRoleId, data.DeveloperRoleId); } else { returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, DeveloperRoleDataModel.DataColumns.DeveloperRoleId); } break; case DeveloperRoleDataModel.BaseDataColumns.ApplicationId: if (data.ApplicationId != null) { returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NUMBER, DeveloperRoleDataModel.BaseDataColumns.ApplicationId, data.ApplicationId); } else { returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, DeveloperRoleDataModel.BaseDataColumns.ApplicationId); } break; case DeveloperRoleDataModel.DataColumns.Application: if (!string.IsNullOrEmpty(data.Application)) { returnValue = string.Format(SQL_TEMPLATE_PARAMETER_STRING_OR_DATE, DeveloperRoleDataModel.DataColumns.Application, data.Application.Trim()); } else { returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, DeveloperRoleDataModel.DataColumns.Application); } break; default: returnValue = StandardDataManager.ToSQLParameter(data, dataColumnName); break; } return(returnValue); }
public static void Delete(DeveloperRoleDataModel dataQuery, RequestProfile requestProfile) { const string sql = @"dbo.DeveloperRoleDelete "; var parameters = new { AuditId = requestProfile.AuditId , DeveloperRoleId = dataQuery.DeveloperRoleId }; using (var dataAccess = new DataAccessBase(DataStoreKey)) { dataAccess.Connection.Execute(sql, parameters, commandType: CommandType.StoredProcedure); } }
protected void btnDelete_Click(object sender, EventArgs e) { try { var notDeletableIds = new List <int>(); string[] deleteIndexList = DeleteIds.Split(','); foreach (string index in deleteIndexList) { var data = new DeveloperRoleDataModel(); data.DeveloperRoleId = int.Parse(index); if (!TaskTimeTracker.Components.Module.ApplicationDevelopment.DeveloperRoleDataManager.IsDeletable(data, SessionVariables.RequestProfile)) { notDeletableIds.Add(Convert.ToInt32(data.DeveloperRoleId)); } } if (notDeletableIds.Count == 0) { foreach (string index in deleteIndexList) { var data = new DeveloperRoleDataModel(); data.DeveloperRoleId = int.Parse(index); TaskTimeTracker.Components.Module.ApplicationDevelopment.DeveloperRoleDataManager.Delete(data, SessionVariables.RequestProfile); } Framework.Components.Audit.AuditHistoryDataManager.DeleteDataBySystemEntity(DeleteIds, (int)Framework.Components.DataAccess.SystemEntity.DeveloperRole, SessionVariables.RequestProfile); Response.Redirect(Page.GetRouteUrl("DeveloperRoleEntityRoute", new { Action = "Default", SetId = true }), false); } else { var msg = String.Empty; foreach (var id in notDeletableIds) { if (!string.IsNullOrEmpty(msg)) { msg += ", <br/>"; } msg += "DeveloperRoleId: " + id + " has detail records"; } Response.Write(msg); } } catch (Exception ex) { Response.Write(ex.Message); } }
protected override DataTable GetData() { try { SuperKey = ApplicationCommon.GetSuperKey(); SetId = ApplicationCommon.GetSetId(); var selectedrows = new DataTable(); var developerRoledata = new DeveloperRoleDataModel(); selectedrows = TaskTimeTracker.Components.Module.ApplicationDevelopment.DeveloperRoleDataManager.GetDetails(developerRoledata, SessionVariables.RequestProfile).Clone(); if (!string.IsNullOrEmpty(SuperKey)) { var systemEntityTypeId = (int)PrimaryEntity; var lstEntityKeys = ApplicationCommon.GetSuperKeyDetails(systemEntityTypeId, SuperKey); foreach (var entityKey in lstEntityKeys) { developerRoledata.DeveloperRoleId = entityKey; var result = TaskTimeTracker.Components.Module.ApplicationDevelopment.DeveloperRoleDataManager.GetDetails(developerRoledata, SessionVariables.RequestProfile); selectedrows.ImportRow(result.Rows[0]); } } else { developerRoledata.DeveloperRoleId = SetId; var result = TaskTimeTracker.Components.Module.ApplicationDevelopment.DeveloperRoleDataManager.GetDetails(developerRoledata, SessionVariables.RequestProfile); selectedrows.ImportRow(result.Rows[0]); } return(selectedrows); } catch (Exception ex) { Response.Write(ex.Message); } return(null); }
public static List <DeveloperRoleDataModel> GetEntityDetails(DeveloperRoleDataModel dataQuery, RequestProfile requestProfile, int returnAuditInfo = BaseDataManager.ReturnAuditInfoOnDetails) { const string sql = @"dbo.DeveloperRoleSearch "; var parameters = new { AuditId = requestProfile.AuditId , DeveloperRoleId = dataQuery.DeveloperRoleId , ReturnAuditInfo = returnAuditInfo , Name = dataQuery.Name , ApplicationMode = requestProfile.ApplicationModeId }; List <DeveloperRoleDataModel> result; using (var dataAccess = new DataAccessBase(DataStoreKey)) { result = dataAccess.Connection.Query <DeveloperRoleDataModel>(sql, parameters, commandType: CommandType.StoredProcedure).ToList(); } return(result); }
protected override DataTable UpdateData() { var UpdatedData = new DataTable(); var data = new DeveloperRoleDataModel(); UpdatedData = TaskTimeTracker.Components.Module.ApplicationDevelopment.DeveloperRoleDataManager.Search(data, SessionVariables.RequestProfile).Clone(); for (var i = 0; i < SelectedData.Rows.Count; i++) { data.DeveloperRoleId = Convert.ToInt32(SelectedData.Rows[i][DeveloperRoleDataModel.DataColumns.DeveloperRoleId].ToString()); data.Name = !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.Name)) ? CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.Description) : SelectedData.Rows[i][StandardDataModel.StandardDataColumns.Description].ToString(); data.Description = !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.Description)) ? CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.Description) : SelectedData.Rows[i][StandardDataModel.StandardDataColumns.Description].ToString(); data.SortOrder = !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.SortOrder)) ? int.Parse(CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.SortOrder).ToString()) : int.Parse(SelectedData.Rows[i][StandardDataModel.StandardDataColumns.SortOrder].ToString()); TaskTimeTracker.Components.Module.ApplicationDevelopment.DeveloperRoleDataManager.Update(data, SessionVariables.RequestProfile); data = new DeveloperRoleDataModel(); data.DeveloperRoleId = Convert.ToInt32(SelectedData.Rows[i][DeveloperRoleDataModel.DataColumns.DeveloperRoleId].ToString()); var dt = TaskTimeTracker.Components.Module.ApplicationDevelopment.DeveloperRoleDataManager.Search(data, SessionVariables.RequestProfile); if (dt.Rows.Count == 1) { UpdatedData.ImportRow(dt.Rows[0]); } } return(UpdatedData); }
private void ReBindEditableGrid() { var data = new DeveloperRoleDataModel(); var dtDeveloperRole = TaskTimeTracker.Components.Module.ApplicationDevelopment.DeveloperRoleDataManager.Search(data, SessionVariables.RequestProfile); }
public static void Update(DeveloperRoleDataModel data, RequestProfile requestProfile) { var sql = CreateOrUpdate(data, requestProfile, "Update"); DBDML.RunSQL("DeveloperRole.Update", sql, DataStoreKey); }
public void SetData(DeveloperRoleDataModel data) { SystemKeyId = data.DeveloperRoleId; base.SetData(data); }
public void SetData(DeveloperRoleDataModel item) { SystemKeyId = item.DeveloperRoleId; base.SetData(item); }
public static DeveloperRoleDataModel GetDetails(DeveloperRoleDataModel data, RequestProfile requestProfile) { var list = GetEntityDetails(data, requestProfile); return(list.FirstOrDefault()); }