コード例 #1
0
        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;
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        private System.Data.DataTable GetData()
        {
            var data = new CompetencyDataModel();
            var dt   = CompetencyDataManager.Search(data, SessionVariables.RequestProfile);

            return(dt);
        }
コード例 #5
0
        private DataTable GetData(string name)
        {
            var data = new CompetencyDataModel();

            data.Name = name;
            var dt = CompetencyDataManager.Search(data, SessionVariables.RequestProfile);

            return(dt);
        }
コード例 #6
0
        protected override DataTable GetEntityData(int?entityKey)
        {
            var competencydata = new CompetencyDataModel();

            competencydata.CompetencyId = entityKey;
            var results = CompetencyDataManager.Search(competencydata, SessionVariables.RequestProfile);

            return(results);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        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();
        }
コード例 #9
0
        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;
                }
            }
        }
コード例 #10
0
        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;
                }
            }
        }
コード例 #11
0
        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);
        }
コード例 #12
0
 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);
     }
 }
コード例 #13
0
        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);
            }
        }
コード例 #14
0
        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);
        }
コード例 #15
0
        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");
            }
        }
コード例 #16
0
        private DataTable GetCompetencyList()
        {
            var dt = CompetencyDataManager.GetList(SessionVariables.RequestProfile);

            return(dt);
        }
コード例 #17
0
 private void ReBindEditableGrid()
 {
     var data         = new CompetencyDataModel();
     var dtCompetency = CompetencyDataManager.Search(data, SessionVariables.RequestProfile);
 }
コード例 #18
0
        protected override DataTable GetData()
        {
            var dt = CompetencyDataManager.Search(oSearchFilter.SearchParameters, SessionVariables.RequestProfile);

            return(dt);
        }