Exemple #1
0
        public void LoadData(int MilestoneXFeatureId, bool showId)
        {
            var data = new MilestoneXFeatureDataModel();

            data.MilestoneXFeatureId = MilestoneXFeatureId;
            var oMilestoneXFeatureTable = MilestoneXFeatureDataManager.GetDetails(data, SessionVariables.RequestProfile);

            if (oMilestoneXFeatureTable.Rows.Count == 1)
            {
                var row = oMilestoneXFeatureTable.Rows[0];

                if (!showId)
                {
                    txtMilestoneXFeatureId.Text = Convert.ToString(row[MilestoneXFeatureDataModel.DataColumns.MilestoneXFeatureId]);

                    dynAuditHistory.Visible = true;

                    // only show Audit History in case of Update page, not for Clone.
                    oHistoryList.Setup((int)SystemEntity.MilestoneXFeature, MilestoneXFeatureId, "MilestoneXFeature");
                    dynAuditHistory.Visible = PerferenceUtility.GetUserPreferenceByKeyAsBoolean(ApplicationCommon.HistoryGridVisibilityKey, "MilestoneXFeature");
                }
                else
                {
                    txtMilestoneXFeatureId.Text = String.Empty;
                }
                txtFeatureId.Text               = Convert.ToString(row[MilestoneXFeatureDataModel.DataColumns.FeatureId]);
                txtMilestoneId.Text             = Convert.ToString(row[MilestoneXFeatureDataModel.DataColumns.MilestoneId]);
                txtMilestoneFeatureStateId.Text = Convert.ToString(row[MilestoneXFeatureDataModel.DataColumns.MilestoneFeatureStateId]);
                txtMemo.Text = Convert.ToString(row[MilestoneXFeatureDataModel.DataColumns.Memo]);

                drpMilestoneFeatureStateList.SelectedValue = Convert.ToString(row[MilestoneXFeatureDataModel.DataColumns.MilestoneFeatureStateId]);
                drpMilestoneList.SelectedValue             = Convert.ToString(row[MilestoneXFeatureDataModel.DataColumns.MilestoneId]);
                drpFeatureList.SelectedValue = Convert.ToString(row[MilestoneXFeatureDataModel.DataColumns.FeatureId]);

                oUpdateInfo.LoadText(oMilestoneXFeatureTable.Rows[0]);
            }
            else
            {
                txtMilestoneXFeatureId.Text = String.Empty;
                txtMilestoneId.Text         = String.Empty;
                txtMemo.Text = String.Empty;
                txtMilestoneFeatureStateId.Text = String.Empty;
                txtFeatureId.Text = String.Empty;
            }
        }
Exemple #2
0
        protected override DataTable GetData()
        {
            try
            {
                var SuperKey = ApplicationCommon.GetSuperKey();
                var SetId    = ApplicationCommon.GetSetId();

                var selectedrows          = new DataTable();
                var milestoneXFeaturedata = new MilestoneXFeatureDataModel();

                selectedrows = MilestoneXFeatureDataManager.GetDetails(milestoneXFeaturedata, SessionVariables.RequestProfile).Clone();

                if (!string.IsNullOrEmpty(SuperKey))
                {
                    var systemEntityTypeId = (int)PrimaryEntity;
                    var lstEntityKeys      = ApplicationCommon.GetSuperKeyDetails(systemEntityTypeId, SuperKey);

                    foreach (var entityKey in lstEntityKeys)
                    {
                        milestoneXFeaturedata.MilestoneXFeatureId = entityKey;
                        var result = MilestoneXFeatureDataManager.GetDetails(milestoneXFeaturedata, SessionVariables.RequestProfile);
                        selectedrows.ImportRow(result.Rows[0]);
                    }
                }
                else
                {
                    milestoneXFeaturedata.MilestoneXFeatureId = SetId;
                    var result = MilestoneXFeatureDataManager.GetDetails(milestoneXFeaturedata, SessionVariables.RequestProfile);
                    selectedrows.ImportRow(result.Rows[0]);
                }
                return(selectedrows);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
            return(null);
        }