Ejemplo n.º 1
0
        private DataTable GetData(string name)
        {
            var data = new DataModel.CompetencyTimeTracker.Skill.CompetencyXSkillDataModel();
            var dt   = TaskTimeTracker.Components.Module.Competency.CompetencyXSkillDataManager.Search(data, SessionVariables.RequestProfile);

            return(dt);
        }
Ejemplo n.º 2
0
        protected override DataTable UpdateData()
        {
            var UpdatedData = new DataTable();
            var data        = new DataModel.CompetencyTimeTracker.Skill.CompetencyXSkillDataModel();

            UpdatedData = TaskTimeTracker.Components.Module.Competency.CompetencyXSkillDataManager.Search(data, SessionVariables.RequestProfile).Clone();
            for (var i = 0; i < SelectedData.Rows.Count; i++)
            {
                data.CompetencyXSkillId =
                    Convert.ToInt32(SelectedData.Rows[i][DataModel.CompetencyTimeTracker.Skill.CompetencyXSkillDataModel.DataColumns.CompetencyXSkillId].ToString());

                data.SkillId =
                    !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(DataModel.CompetencyTimeTracker.Skill.CompetencyXSkillDataModel.DataColumns.SkillId))
                                        ? int.Parse(CheckAndGetRepeaterTextBoxValue(DataModel.CompetencyTimeTracker.Skill.CompetencyXSkillDataModel.DataColumns.SkillId).ToString())
                                        : int.Parse(SelectedData.Rows[i][DataModel.CompetencyTimeTracker.Skill.CompetencyXSkillDataModel.DataColumns.SkillId].ToString());

                data.CompetencyId =
                    !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(DataModel.CompetencyTimeTracker.Skill.CompetencyXSkillDataModel.DataColumns.CompetencyId))
                                        ? int.Parse(CheckAndGetRepeaterTextBoxValue(DataModel.CompetencyTimeTracker.Skill.CompetencyXSkillDataModel.DataColumns.CompetencyId).ToString())
                                        : int.Parse(SelectedData.Rows[i][DataModel.CompetencyTimeTracker.Skill.CompetencyXSkillDataModel.DataColumns.CompetencyId].ToString());

                TaskTimeTracker.Components.Module.Competency.CompetencyXSkillDataManager.Update(data, SessionVariables.RequestProfile);
                data = new DataModel.CompetencyTimeTracker.Skill.CompetencyXSkillDataModel();
                data.CompetencyXSkillId = Convert.ToInt32(SelectedData.Rows[i][DataModel.CompetencyTimeTracker.Skill.CompetencyXSkillDataModel.DataColumns.CompetencyXSkillId].ToString());
                var dt = TaskTimeTracker.Components.Module.Competency.CompetencyXSkillDataManager.Search(data, SessionVariables.RequestProfile);

                if (dt.Rows.Count == 1)
                {
                    UpdatedData.ImportRow(dt.Rows[0]);
                }
            }
            return(UpdatedData);
        }
Ejemplo n.º 3
0
        public override int?Save(string action)
        {
            var data = new DataModel.CompetencyTimeTracker.Skill.CompetencyXSkillDataModel();

            data.CompetencyXSkillId = CompetencyXSkillId;
            data.CompetencyId       = CompetencyId;
            data.SkillId            = SkillId;

            if (action == "Insert")
            {
                var dtCompetencyXSkill = TaskTimeTracker.Components.Module.Competency.CompetencyXSkillDataManager.DoesExist(data, SessionVariables.RequestProfile);

                if (dtCompetencyXSkill.Rows.Count == 0)
                {
                    TaskTimeTracker.Components.Module.Competency.CompetencyXSkillDataManager.Create(data, SessionVariables.RequestProfile);
                }
                else
                {
                    throw new Exception("Record with given ID already exists.");
                }
            }
            else
            {
                TaskTimeTracker.Components.Module.Competency.CompetencyXSkillDataManager.Update(data, SessionVariables.RequestProfile);
            }

            return(data.CompetencyXSkillId);
        }
Ejemplo n.º 4
0
        protected override void ShowData(int competencyXSkillId)
        {
            base.ShowData(competencyXSkillId);

            oDetailButtonPanel.SetId = SetId;

            Clear();

            var data = new DataModel.CompetencyTimeTracker.Skill.CompetencyXSkillDataModel();

            data.CompetencyXSkillId = competencyXSkillId;

            var entityList = TaskTimeTracker.Components.Module.Competency.CompetencyXSkillDataManager.GetEntityDetails(data, SessionVariables.RequestProfile);

            if (entityList.Count == 1)
            {
                foreach (var entityItem in entityList)
                {
                    lblCompetencyXSkillId.Text = entityItem.CompetencyXSkillId.ToString();
                    lblCompetency.Text         = entityItem.Competency;
                    lblSkill.Text = entityItem.Skill;

                    oUpdateInfo.LoadText(entityItem.UpdatedDate, entityItem.UpdatedBy, entityItem.LastAction);

                    oHistoryList.Setup((int)Framework.Components.DataAccess.SystemEntity.CompetencyXSkill, competencyXSkillId, "CompetencyXSkill");
                    dynAuditHistory.Visible = PerferenceUtility.GetUserPreferenceByKeyAsBoolean(ApplicationCommon.HistoryGridVisibilityKey, "CompetencyXSkill");
                }
            }
        }
Ejemplo n.º 5
0
        protected override DataTable GetEntityData(int?entityKey)
        {
            var competencyXSkilldata = new DataModel.CompetencyTimeTracker.Skill.CompetencyXSkillDataModel();

            competencyXSkilldata.CompetencyXSkillId = entityKey;
            var results = TaskTimeTracker.Components.Module.Competency.CompetencyXSkillDataManager.Search(competencyXSkilldata, SessionVariables.RequestProfile);

            return(results);
        }
Ejemplo n.º 6
0
        private System.Data.DataTable GetData()
        {
            // TODO: on all export pages
            var data = new DataModel.CompetencyTimeTracker.Skill.CompetencyXSkillDataModel();

            var dt = TaskTimeTracker.Components.Module.Competency.CompetencyXSkillDataManager.Search(data, SessionVariables.RequestProfile);

            return(dt);
        }
Ejemplo n.º 7
0
        protected override void Update(Dictionary <string, string> values)
        {
            var data = new DataModel.CompetencyTimeTracker.Skill.CompetencyXSkillDataModel();

            data.CompetencyXSkillId = int.Parse(values[DataModel.CompetencyTimeTracker.Skill.CompetencyXSkillDataModel.DataColumns.CompetencyXSkillId].ToString());
            data.SkillId            = int.Parse(values[DataModel.CompetencyTimeTracker.Skill.CompetencyXSkillDataModel.DataColumns.SkillId].ToString());
            data.CompetencyId       = int.Parse(values[DataModel.CompetencyTimeTracker.Skill.CompetencyXSkillDataModel.DataColumns.CompetencyId].ToString());

            TaskTimeTracker.Components.Module.Competency.CompetencyXSkillDataManager.Update(data, SessionVariables.RequestProfile);
            base.Update(values);
        }
Ejemplo n.º 8
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                string[] deleteIndexList = DeleteIds.Split(',');
                foreach (string index in deleteIndexList)
                {
                    var data = new DataModel.CompetencyTimeTracker.Skill.CompetencyXSkillDataModel();
                    data.CompetencyXSkillId = int.Parse(index);
                    TaskTimeTracker.Components.Module.Competency.CompetencyXSkillDataManager.Delete(data, SessionVariables.RequestProfile);
                }

                DeleteAndRedirect();
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
Ejemplo n.º 9
0
        protected override DataTable GetData()
        {
            try
            {
                SuperKey = ApplicationCommon.GetSuperKey();
                SetId    = ApplicationCommon.GetSetId();

                var selectedrows         = new DataTable();
                var competencyXSkilldata = new DataModel.CompetencyTimeTracker.Skill.CompetencyXSkillDataModel();

                selectedrows = TaskTimeTracker.Components.Module.Competency.CompetencyXSkillDataManager.GetDetails(competencyXSkilldata, SessionVariables.RequestProfile).Clone();
                if (!string.IsNullOrEmpty(SuperKey))
                {
                    var systemEntityTypeId = (int)PrimaryEntity;
                    var lstEntityKeys      = ApplicationCommon.GetSuperKeyDetails(systemEntityTypeId, SuperKey);

                    foreach (var entityKey in lstEntityKeys)
                    {
                        competencyXSkilldata.CompetencyXSkillId = entityKey;
                        var result = TaskTimeTracker.Components.Module.Competency.CompetencyXSkillDataManager.GetDetails(competencyXSkilldata, SessionVariables.RequestProfile);
                        selectedrows.ImportRow(result.Rows[0]);
                    }
                }
                else
                {
                    competencyXSkilldata.CompetencyXSkillId = SetId;
                    var result = TaskTimeTracker.Components.Module.Competency.CompetencyXSkillDataManager.GetDetails(competencyXSkilldata, SessionVariables.RequestProfile);
                    selectedrows.ImportRow(result.Rows[0]);
                }
                return(selectedrows);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
            return(null);
        }
Ejemplo n.º 10
0
        public void LoadData(int competencyXSkillId, bool showId)
        {
            var data = new DataModel.CompetencyTimeTracker.Skill.CompetencyXSkillDataModel();

            data.CompetencyXSkillId = competencyXSkillId;

            var oCompetencyXSkillTable = TaskTimeTracker.Components.Module.Competency.CompetencyXSkillDataManager.GetEntityDetails(data, SessionVariables.RequestProfile);

            if (oCompetencyXSkillTable.Count != 1)
            {
                return;
            }

            var item = oCompetencyXSkillTable[0];

            if (!showId)
            {
                CompetencyXSkillId      = item.CompetencyXSkillId;
                CompetencyId            = item.CompetencyId;
                SkillId                 = item.SkillId;
                dynAuditHistory.Visible = true;

                // only show Audit History in case of Update page, not for Clone.
                oHistoryList.Setup(PrimaryEntity, competencyXSkillId, PrimaryEntityKey);
                dynAuditHistory.Visible = PerferenceUtility.GetUserPreferenceByKeyAsBoolean(ApplicationCommon.HistoryGridVisibilityKey, "ProjectTimeLine");
            }

            else
            {
                txtCompetencyXSkillId.Text = String.Empty;
            }

            //drpSkillList.SelectedValue      = Convert.ToString(row[TaskTimeTracker.Components.Module.Competency.CompetencyXSkillDataManager.DataColumns.SkillId]);
            //drpCompetencyList.SelectedValue = Convert.ToString(row[TaskTimeTracker.Components.Module.Competency.CompetencyXSkillDataManager.DataColumns.CompetencyId]);

            //oUpdateInfo.LoadText(oCompetencyXSkillTable.Rows[0]);
        }