Esempio n. 1
0
        protected override void ShowData(int projectTimeLineId)
        {
            base.ShowData(projectTimeLineId);

            oDetailButtonPanel.SetId = SetId;

            Clear();

            var data = new ProjectTimeLineDataModel();

            data.ProjectTimeLineId = projectTimeLineId;

            var entityList = ProjectTimeLineDataManager.GetEntityDetails(data, SessionVariables.RequestProfile);

            if (entityList.Count == 1)
            {
                foreach (var entityItem in entityList)
                {
                    lblProjectTimeLineId.Text = entityItem.ProjectTimeLineId.ToString();
                    lblProjectId.Text         = entityItem.Project.ToString();
                    lblStartDate.Text         = entityItem.StartDate.ToString();
                    lblEndDate.Text           = entityItem.EndDate.ToString();

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

                    oHistoryList.Setup((int)Framework.Components.DataAccess.SystemEntity.ProjectTimeLine, projectTimeLineId, "ProjectTimeLine");
                    dynAuditHistory.Visible = PerferenceUtility.GetUserPreferenceByKeyAsBoolean(ApplicationCommon.HistoryGridVisibilityKey, "ProjectTimeLine");
                }
            }
        }
Esempio n. 2
0
        protected override DataTable UpdateData()
        {
            var UpdatedData = new DataTable();
            var data        = new ProjectTimeLineDataModel();

            UpdatedData = ProjectTimeLineDataManager.Search(data, SessionVariables.RequestProfile).Clone();
            for (var i = 0; i < SelectedData.Rows.Count; i++)
            {
                data.ProjectTimeLineId =
                    Convert.ToInt32(SelectedData.Rows[i][ProjectTimeLineDataModel.DataColumns.ProjectTimeLineId].ToString());
                data.ProjectId = Convert.ToInt32(SelectedData.Rows[i][ProjectTimeLineDataModel.DataColumns.ProjectId].ToString());

                data.StartDate =
                    !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(ProjectTimeLineDataModel.DataColumns.StartDate))
                    ? DateTime.Parse(CheckAndGetRepeaterTextBoxValue(ProjectTimeLineDataModel.DataColumns.StartDate).ToString())
                    : DateTime.Parse(SelectedData.Rows[i][ProjectTimeLineDataModel.DataColumns.StartDate].ToString());

                data.EndDate =
                    !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(ProjectTimeLineDataModel.DataColumns.EndDate))
                    ? DateTime.Parse(CheckAndGetRepeaterTextBoxValue(ProjectTimeLineDataModel.DataColumns.EndDate).ToString())
                    : DateTime.Parse(SelectedData.Rows[i][ProjectTimeLineDataModel.DataColumns.EndDate].ToString());

                ProjectTimeLineDataManager.Update(data, SessionVariables.RequestProfile);
                data = new ProjectTimeLineDataModel();
                data.ProjectTimeLineId = Convert.ToInt32(SelectedData.Rows[i][ProjectTimeLineDataModel.DataColumns.ProjectTimeLineId].ToString());
                var dt = ProjectTimeLineDataManager.Search(data, SessionVariables.RequestProfile);

                if (dt.Rows.Count == 1)
                {
                    UpdatedData.ImportRow(dt.Rows[0]);
                }
            }

            return(UpdatedData);
        }
Esempio n. 3
0
        public override int?Save(string action)
        {
            var data = new ProjectTimeLineDataModel();

            data.ProjectTimeLineId = ProjectTimeLineId;
            data.ProjectId         = ProjectId;
            data.StartDate         = StartDate;
            data.EndDate           = EndDate;

            if (action == "Insert")
            {
                var dtProjectTimeLine = ProjectTimeLineDataManager.DoesExist(data, SessionVariables.RequestProfile);

                if (dtProjectTimeLine.Rows.Count == 0)
                {
                    ProjectTimeLineDataManager.Create(data, SessionVariables.RequestProfile);
                }
                else
                {
                    throw new Exception("Record with given ID already exists.");
                }
            }
            else
            {
                ProjectTimeLineDataManager.Update(data, SessionVariables.RequestProfile);
            }

            // not correct ... when doing insert, we didn't get/change the value of CountryID ?
            return(ProjectTimeLineId);
        }
Esempio n. 4
0
        protected override DataTable GetEntityData(int?entityKey)
        {
            var projectTimeLinedata = new ProjectTimeLineDataModel();

            projectTimeLinedata.ProjectTimeLineId = entityKey;
            var results = ProjectTimeLineDataManager.Search(projectTimeLinedata, SessionVariables.RequestProfile);

            return(results);
        }
Esempio n. 5
0
        private System.Data.DataTable GetData()
        {
            // TODO: on all export pages
            var data = new ProjectTimeLineDataModel();

            var dt = ProjectTimeLineDataManager.Search(data, SessionVariables.RequestProfile);

            return(dt);
        }
Esempio n. 6
0
        protected override void Update(Dictionary <string, string> values)
        {
            var data = new ProjectTimeLineDataModel();

            // copies properties from values dictionary object to data object
            PropertyMapper.CopyProperties(data, values);

            ProjectTimeLineDataManager.Update(data, SessionVariables.RequestProfile);
            base.Update(values);
        }
Esempio n. 7
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                string[] deleteIndexList = DeleteIds.Split(',');
                foreach (string index in deleteIndexList)
                {
                    var data = new ProjectTimeLineDataModel();
                    data.ProjectTimeLineId = int.Parse(index);
                    ProjectTimeLineDataManager.Delete(data, SessionVariables.RequestProfile.AuditId);
                }

                DeleteAndRedirect();
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
Esempio n. 8
0
        public void LoadData(int projectTimeLineId, bool showId)
        {
            // clear UI

            Clear();

            var dataQuery = new ProjectTimeLineDataModel();

            dataQuery.ProjectTimeLineId = projectTimeLineId;

            var items = ProjectTimeLineDataManager.GetEntityDetails(dataQuery, SessionVariables.RequestProfile);

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

            var item = items[0];

            ProjectTimeLineId = item.ProjectTimeLineId;
            ProjectId         = item.ProjectId;
            StartDate         = item.StartDate;
            EndDate           = item.EndDate;

            if (!showId)
            {
                txtProjectTimeLineId.Text = item.ProjectTimeLineId.ToString();

                // only show Audit History in case of Update page, not for Clone.
                oHistoryList.Setup((int)Framework.Components.DataAccess.SystemEntity.ProjectTimeLine, projectTimeLineId, "ProjectTimeLine");
            }
            else
            {
                txtProjectTimeLineId.Text = String.Empty;
            }

            oUpdateInfo.LoadText(item.UpdatedDate, item.UpdatedBy, item.LastAction);
        }
Esempio n. 9
0
        protected override DataTable GetData()
        {
            try
            {
                SuperKey = ApplicationCommon.GetSuperKey();
                SetId    = ApplicationCommon.GetSetId();

                var selectedrows        = new DataTable();
                var projectTimeLinedata = new ProjectTimeLineDataModel();

                selectedrows = ProjectTimeLineDataManager.GetDetails(projectTimeLinedata, SessionVariables.RequestProfile).Clone();
                if (!string.IsNullOrEmpty(SuperKey))
                {
                    var systemEntityTypeId = (int)PrimaryEntity;
                    var lstEntityKeys      = ApplicationCommon.GetSuperKeyDetails(systemEntityTypeId, SuperKey);

                    foreach (var entityKey in lstEntityKeys)
                    {
                        projectTimeLinedata.ProjectTimeLineId = entityKey;
                        var result = ProjectTimeLineDataManager.GetDetails(projectTimeLinedata, SessionVariables.RequestProfile);
                        selectedrows.ImportRow(result.Rows[0]);
                    }
                }
                else
                {
                    projectTimeLinedata.ProjectTimeLineId = SetId;
                    var result = ProjectTimeLineDataManager.GetDetails(projectTimeLinedata, SessionVariables.RequestProfile);
                    selectedrows.ImportRow(result.Rows[0]);
                }
                return(selectedrows);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
            return(null);
        }
Esempio n. 10
0
        protected override DataTable GetData()
        {
            var dt = ProjectTimeLineDataManager.Search(oSearchFilter.SearchParameters, SessionVariables.RequestProfile);

            return(dt);
        }