protected override void ShowData(int ClientXProjectId) { oDetailButtonPanel.SetId = SetId; var data = new ClientXProjectDataModel(); data.ClientXProjectId = ClientXProjectId; var dt = ClientXProjectDataManager.GetDetails(data, SessionVariables.RequestProfile); if (dt.Rows.Count == 1) { var row = dt.Rows[0]; lblClientXProjectId.Text = Convert.ToString(row[ClientXProjectDataModel.DataColumns.ClientXProjectId]); lblClient.Text = Convert.ToString(row[ClientXProjectDataModel.DataColumns.Client]); lblProject.Text = Convert.ToString(row[ClientXProjectDataModel.DataColumns.Project]); oUpdateInfo.LoadText(dt.Rows[0]); oHistoryList.Setup((int)SystemEntity.ClientXProject, ClientXProjectId, "ClientXProject"); dynAuditHistory.Visible = PerferenceUtility.GetUserPreferenceByKeyAsBoolean(ApplicationCommon.HistoryGridVisibilityKey, "ClientXProject"); } else { Clear(); } }
private void UpdatedFKDepenedencies(int oldId, int newId) { try { var ClientXProjectdt = ClientXProjectDataManager.GetByProject(oldId, SessionVariables.RequestProfile.AuditId); var ProjectIds = new int[ClientXProjectdt.Rows.Count]; for (var i = 0; i < ClientXProjectdt.Rows.Count; i++) { ProjectIds[i] = int.Parse(ClientXProjectdt.Rows[i][ClientXProjectDataModel.DataColumns.ProjectId].ToString()); } if (ProjectIds.Length > 0) { ClientXProjectDataManager.DeleteByProject(oldId, SessionVariables.RequestProfile.AuditId); ClientXProjectDataManager.CreateByProject(newId, ProjectIds, SessionVariables.RequestProfile); } var projectxneeddt = ClientXProjectDataManager.GetByProject(oldId, SessionVariables.RequestProfile.AuditId); var needIds = new int[ClientXProjectdt.Rows.Count]; for (var i = 0; i < projectxneeddt.Rows.Count; i++) { needIds[i] = int.Parse(projectxneeddt.Rows[i][ProjectXNeedDataModel.DataColumns.NeedId].ToString()); } if (needIds.Length > 0) { ProjectXNeedDataManager.DeleteByProject(oldId, SessionVariables.RequestProfile); ProjectXNeedDataManager.CreateByProject(newId, needIds, SessionVariables.RequestProfile); } } catch (Exception ex) { Response.Write(ex.Message); } }
private DataTable GetData(string name) { var data = new ClientXProjectDataModel(); var dt = ClientXProjectDataManager.Search(data, SessionVariables.RequestProfile); return(dt); }
private void SaveByClient(int ClientId, List <int> ProjectIds) { var id = Convert.ToInt32(drpClient.SelectedValue); ClientXProjectDataManager.DeleteByClient(id, SessionVariables.RequestProfile.AuditId); ClientXProjectDataManager.CreateByClient(id, ProjectIds.ToArray(), SessionVariables.RequestProfile); }
private DataTable GetAssociatedProjects(int ClientId) { var id = Convert.ToInt32(drpClient.SelectedValue); var dt = ClientXProjectDataManager.GetByClient(id, SessionVariables.RequestProfile.AuditId); return(dt); }
private DataTable GetClientData(int projectId) { var dt = ClientXProjectDataManager.GetByProject(projectId, SessionVariables.RequestProfile.AuditId); var clientList = ClientDataManager.GetEntityDetails(ClientDataModel.Empty, SessionVariables.RequestProfile, 0); var resultList = new List <ClientDataModel>(); foreach (DataRow row in dt.Rows) { var tmpClientId = Convert.ToInt32(row[ClientDataModel.DataColumns.ClientId]); resultList.AddRange(clientList.Where(item => item.ClientId == tmpClientId)); } return(resultList.ToDataTable()); }
private DataTable GetProjectData(int clientId) { var dt = ClientXProjectDataManager.GetByClient(clientId, SessionVariables.RequestProfile.AuditId); var projectdt = ProjectDataManager.GetList(SessionVariables.RequestProfile); var resultdt = projectdt.Clone(); foreach (DataRow row in dt.Rows) { var rows = projectdt.Select("ProjectId = " + row[ProjectDataModel.DataColumns.ProjectId]); resultdt.ImportRow(rows[0]); } return(resultdt); }
public override int?Save(string action) { var data = new ClientXProjectDataModel(); data.ClientXProjectId = ClientXProjectId; data.ClientId = ClientId; data.ProjectId = ProjectId; if (action == "Insert") { ClientXProjectDataManager.Create(data, SessionVariables.RequestProfile); } else { ClientXProjectDataManager.Update(data, SessionVariables.RequestProfile); } // not correct ... when doing insert, we didn't get/change the value of ClientID ? return(data.ClientXProjectId); }
protected void btnDelete_Click(object sender, EventArgs e) { try { var deleteIndexList = DeleteIds.Split(','); foreach (string index in deleteIndexList) { var data = new ClientXProjectDataModel(); data.ClientXProjectId = int.Parse(index); ClientXProjectDataManager.Delete(data, SessionVariables.RequestProfile); } AuditHistoryDataManager.DeleteDataBySystemEntity(DeleteIds, (int)SystemEntity.ClientXProject, SessionVariables.RequestProfile); Response.Redirect(Page.GetRouteUrl("ClientXProjectEntityRoute", new { Action = "Default", SetId = true }), false); } catch (Exception ex) { Response.Write(ex.Message); } }
public void LoadData(int ClientXProjectId, bool showId) { var data = new ClientXProjectDataModel(); data.ClientXProjectId = ClientXProjectId; var oClientXProjectTable = ClientXProjectDataManager.GetDetails(data, SessionVariables.RequestProfile); if (oClientXProjectTable.Rows.Count == 1) { var row = oClientXProjectTable.Rows[0]; if (!showId) { txtClientXProjectId.Text = Convert.ToString(row[ClientXProjectDataModel.DataColumns.ClientXProjectId]); dynAuditHistory.Visible = true; // only show Audit History in case of Update page, not for Clone. oHistoryList.Setup((int)SystemEntity.ClientXProject, ClientXProjectId, "ClientXProject"); dynAuditHistory.Visible = PerferenceUtility.GetUserPreferenceByKeyAsBoolean(ApplicationCommon.HistoryGridVisibilityKey, "ClientXProject"); } else { txtClientXProjectId.Text = String.Empty; } txtClientId.Text = Convert.ToString(row[ClientXProjectDataModel.DataColumns.ClientId]); txtProjectId.Text = Convert.ToString(row[ClientXProjectDataModel.DataColumns.ProjectId]); drpProjectList.SelectedValue = Convert.ToString(row[ClientXProjectDataModel.DataColumns.ProjectId]); drpClientList.SelectedValue = Convert.ToString(row[ClientXProjectDataModel.DataColumns.ClientId]); oUpdateInfo.LoadText(oClientXProjectTable.Rows[0]); } else { txtClientXProjectId.Text = String.Empty; txtProjectId.Text = String.Empty; txtClientId.Text = String.Empty; } }
protected override DataTable GetData() { var dt = ClientXProjectDataManager.Search(oSearchFilter.SearchParameters, SessionVariables.RequestProfile); return(dt); }
private void SaveClientXProject(int clientId, List <int> projectIds) { ClientXProjectDataManager.DeleteByClient(clientId, SessionVariables.RequestProfile.AuditId); ClientXProjectDataManager.CreateByClient(clientId, projectIds.ToArray(), SessionVariables.RequestProfile); }
private DataTable GetAssociatedProjects(int clientId) { var dt = ClientXProjectDataManager.GetByClient(clientId, SessionVariables.RequestProfile.AuditId); return(dt); }