public void LoadData(int competencyId, bool showId) { Clear(); var data = new CompetencyDataModel(); data.CompetencyId = competencyId; var items = CompetencyDataManager.GetEntityDetails(data, SessionVariables.RequestProfile); if (items.Count != 1) { return; } var item = items[0]; SetData(item); if (!showId) { SystemKeyId = item.CompetencyId; oHistoryList.Setup(PrimaryEntity, competencyId, PrimaryEntityKey); } else { CoreSystemKey.Text = String.Empty; } }
protected override DataTable UpdateData() { var UpdatedData = new DataTable(); var data = new CompetencyDataModel(); UpdatedData = CompetencyDataManager.Search(data, SessionVariables.RequestProfile).Clone(); for (var i = 0; i < SelectedData.Rows.Count; i++) { data.CompetencyId = Convert.ToInt32(SelectedData.Rows[i][CompetencyDataModel.DataColumns.CompetencyId].ToString()); data.Name = SelectedData.Rows[i][StandardDataModel.StandardDataColumns.Name].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()); CompetencyDataManager.Update(data, SessionVariables.RequestProfile); data = new CompetencyDataModel(); data.CompetencyId = Convert.ToInt32(SelectedData.Rows[i][CompetencyDataModel.DataColumns.CompetencyId].ToString()); var dt = CompetencyDataManager.Search(data, SessionVariables.RequestProfile); if (dt.Rows.Count == 1) { UpdatedData.ImportRow(dt.Rows[0]); } } return(UpdatedData); }
public override int?Save(string action) { var data = new CompetencyDataModel(); data.CompetencyId = SystemKeyId; data.Name = Name; data.Description = Description; data.SortOrder = SortOrder; if (action == "Insert") { var dtCompetency = CompetencyDataManager.DoesExist(data, SessionVariables.RequestProfile); if (dtCompetency.Rows.Count == 0) { CompetencyDataManager.Create(data, SessionVariables.RequestProfile); } else { throw new Exception("Record with given ID already exists."); } } else { CompetencyDataManager.Update(data, SessionVariables.RequestProfile); } return(data.CompetencyId); }
private System.Data.DataTable GetData() { var data = new CompetencyDataModel(); var dt = CompetencyDataManager.Search(data, SessionVariables.RequestProfile); return(dt); }
private DataTable GetData(string name) { var data = new CompetencyDataModel(); data.Name = name; var dt = CompetencyDataManager.Search(data, SessionVariables.RequestProfile); return(dt); }
protected override DataTable GetEntityData(int?entityKey) { var competencydata = new CompetencyDataModel(); competencydata.CompetencyId = entityKey; var results = CompetencyDataManager.Search(competencydata, SessionVariables.RequestProfile); return(results); }
protected override void Update(Dictionary <string, string> values) { var data = new CompetencyDataModel(); // copies properties from values dictionary object to data object PropertyMapper.CopyProperties(data, values); CompetencyDataManager.Update(data, SessionVariables.RequestProfile); base.Update(values); }
private void UpdateData(ArrayList values) { var data = new CompetencyDataModel(); data.CompetencyId = int.Parse(values[0].ToString()); data.Name = values[1].ToString(); data.Description = values[2].ToString(); data.SortOrder = int.Parse(values[3].ToString()); CompetencyDataManager.Update(data, SessionVariables.RequestProfile); ReBindEditableGrid(); }
private void SetupDropdown() { var isTesting = SessionVariables.IsTesting; var CompetencyData = CompetencyDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(CompetencyData, drpCompetencyList, StandardDataModel.StandardDataColumns.Name, CompetencyDataModel.DataColumns.CompetencyId); var taskData = TaskTimeTracker.Components.BusinessLayer.Task.TaskDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(taskData, drpTaskList, StandardDataModel.StandardDataColumns.Name, TaskDataModel.DataColumns.TaskId); if (isTesting) { drpCompetencyList.AutoPostBack = true; drpTaskList.AutoPostBack = true; if (drpCompetencyList.Items.Count > 0) { if (!string.IsNullOrEmpty(txtCompetencyId.Text.Trim())) { drpCompetencyList.SelectedValue = txtCompetencyId.Text; } else { txtCompetencyId.Text = drpCompetencyList.SelectedItem.Value; } } if (drpTaskList.Items.Count > 0) { if (!string.IsNullOrEmpty(txtTaskId.Text.Trim())) { drpTaskList.SelectedValue = txtTaskId.Text; } else { txtTaskId.Text = drpTaskList.SelectedItem.Value; } } txtCompetencyId.Visible = true; txtTaskId.Visible = true; } else { if (!string.IsNullOrEmpty(txtCompetencyId.Text.Trim())) { drpCompetencyList.SelectedValue = txtCompetencyId.Text; } if (!string.IsNullOrEmpty(txtTaskId.Text.Trim())) { drpTaskList.SelectedValue = txtTaskId.Text; } } }
private void SetupDropdown() { var isTesting = SessionVariables.IsTesting; var taskPriorityTypeData = CompetencyDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(taskPriorityTypeData, drpCompetencyList, StandardDataModel.StandardDataColumns.Name, CompetencyDataModel.DataColumns.CompetencyId); var taskData = SkillDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(taskData, drpSkillList, StandardDataModel.StandardDataColumns.Name, SkillDataModel.DataColumns.SkillId); if (isTesting) { drpSkillList.AutoPostBack = true; drpCompetencyList.AutoPostBack = true; if (drpCompetencyList.Items.Count > 0) { if (!string.IsNullOrEmpty(txtCompetencyId.Text.Trim())) { drpCompetencyList.SelectedValue = txtCompetencyId.Text; } else { txtCompetencyId.Text = drpCompetencyList.SelectedItem.Value; } } if (drpSkillList.Items.Count > 0) { if (!string.IsNullOrEmpty(txtSkillId.Text.Trim())) { drpSkillList.SelectedValue = txtSkillId.Text; } else { txtSkillId.Text = drpSkillList.SelectedItem.Value; } } txtCompetencyId.Visible = true; txtSkillId.Visible = true; } else { if (!string.IsNullOrEmpty(txtCompetencyId.Text.Trim())) { drpCompetencyList.SelectedValue = txtCompetencyId.Text; } if (!string.IsNullOrEmpty(txtSkillId.Text.Trim())) { drpSkillList.SelectedValue = txtSkillId.Text; } } }
private DataTable GetCompetencyData(int taskId) { var dt = TaskXCompetencyDataManager.GetByTask(taskId, SessionVariables.RequestProfile.AuditId); var compdt = CompetencyDataManager.GetList(SessionVariables.RequestProfile); var resultdt = compdt.Clone(); foreach (DataRow row in dt.Rows) { var rows = compdt.Select("CompetencyId = " + row[CompetencyDataModel.DataColumns.CompetencyId]); resultdt.ImportRow(rows[0]); } return(resultdt); }
protected void btnDelete_Click(object sender, EventArgs e) { try { string[] deleteIndexList = DeleteIds.Split(','); foreach (string index in deleteIndexList) { var data = new CompetencyDataModel(); data.CompetencyId = int.Parse(index); CompetencyDataManager.Delete(data, SessionVariables.RequestProfile); DeleteAndRedirect(); } } catch (Exception ex) { Response.Write(ex.Message); } }
public override void LoadDropDownListSources(string fieldName, DropDownList dropDownListControl) { base.LoadDropDownListSources(fieldName, dropDownListControl); if (fieldName.Equals("CompetencyId")) { var competencydata = CompetencyDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(competencydata, dropDownListControl, StandardDataModel.StandardDataColumns.Name, CompetencyDataModel.DataColumns.CompetencyId); } if (fieldName.Equals("SkillId")) { var skilldata = SkillDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(skilldata, dropDownListControl, StandardDataModel.StandardDataColumns.Name, SkillDataModel.DataColumns.SkillId); } }
protected override DataTable GetData() { try { SuperKey = ApplicationCommon.GetSuperKey(); SetId = ApplicationCommon.GetSetId(); var selectedrows = new DataTable(); var competencydata = new CompetencyDataModel(); selectedrows = CompetencyDataManager.GetDetails(competencydata, SessionVariables.RequestProfile).Clone(); if (!string.IsNullOrEmpty(SuperKey)) { var systemEntityTypeId = (int)PrimaryEntity; var lstEntityKeys = ApplicationCommon.GetSuperKeyDetails(systemEntityTypeId, SuperKey); foreach (var entityKey in lstEntityKeys) { competencydata.CompetencyId = entityKey; var result = CompetencyDataManager.GetDetails(competencydata, SessionVariables.RequestProfile); selectedrows.ImportRow(result.Rows[0]); } } else { competencydata.CompetencyId = SetId; var result = CompetencyDataManager.GetDetails(competencydata, SessionVariables.RequestProfile); selectedrows.ImportRow(result.Rows[0]); } return(selectedrows); } catch (Exception ex) { Response.Write(ex.Message); } return(null); }
protected override void ShowData(int competencyId) { base.ShowData(competencyId); oDetailButtonPanel.SetId = SetId; Clear(); var data = new CompetencyDataModel(); data.CompetencyId = competencyId; var items = CompetencyDataManager.GetEntityDetails(data, SessionVariables.RequestProfile); if (items.Count == 1) { var item = items[0]; SetData(item); oHistoryList.Setup(PrimaryEntity, competencyId, "Competency"); } }
private DataTable GetCompetencyList() { var dt = CompetencyDataManager.GetList(SessionVariables.RequestProfile); return(dt); }
private void ReBindEditableGrid() { var data = new CompetencyDataModel(); var dtCompetency = CompetencyDataManager.Search(data, SessionVariables.RequestProfile); }
protected override DataTable GetData() { var dt = CompetencyDataManager.Search(oSearchFilter.SearchParameters, SessionVariables.RequestProfile); return(dt); }