Example #1
0
        protected override void ShowData(int applicationRouteParameterId)
        {
            base.ShowData(applicationRouteParameterId);

            oDetailButtonPanel.SetId = SetId;

            Clear();

            var data = new ApplicationRouteParameterDataModel();

            data.ApplicationRouteParameterId = applicationRouteParameterId;

            var items = Framework.Components.Core.ApplicationRouteParameterDataManager.GetEntityDetails(data, SessionVariables.RequestProfile);

            // should only have single match
            if (items.Count == 1)
            {
                var item = items[0];

                lblApplicationRouteParameterId.Text = item.ApplicationRouteParameterId.ToString();
                lblApplicationRoute.Text            = item.ApplicationRoute.ToString();
                lblParameterName.Text  = item.ParameterName;
                lblParameterValue.Text = item.ParameterValue;

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

                oHistoryList.Setup(PrimaryEntity, applicationRouteParameterId, "ApplicationRouteParameter");
            }
        }
Example #2
0
        public static DataTable DoesExist(DataModel.Framework.Core.ApplicationRouteParameterDataModel data, RequestProfile requestProfile)
        {
            var doesExistRequest = new ApplicationRouteParameterDataModel();

            doesExistRequest.ParameterName = data.ParameterName;

            return(Search(doesExistRequest, requestProfile));
        }
Example #3
0
        private DataTable GetData(string name)
        {
            var data = new ApplicationRouteParameterDataModel();

            data.ParameterName = name;
            var dt = Framework.Components.Core.ApplicationRouteParameterDataManager.Search(data, SessionVariables.RequestProfile);

            return(dt);
        }
Example #4
0
        protected override DataTable GetEntityData(int?entityKey)
        {
            var applicationRouteParameterdata = new ApplicationRouteParameterDataModel();

            applicationRouteParameterdata.ApplicationRouteParameterId = entityKey;
            var results = Framework.Components.Core.ApplicationRouteParameterDataManager.Search(applicationRouteParameterdata, SessionVariables.RequestProfile);

            return(results);
        }
Example #5
0
        protected override void Update(Dictionary <string, string> values)
        {
            var data = new ApplicationRouteParameterDataModel();

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

            Framework.Components.Core.ApplicationRouteParameterDataManager.Update(data, SessionVariables.RequestProfile);
            base.Update(values);
        }
Example #6
0
        public static bool DoesExist(DataModel.Framework.Core.ApplicationRouteParameterDataModel data, RequestProfile requestProfile)
        {
            var doesExistRequest = new ApplicationRouteParameterDataModel();

            doesExistRequest.ParameterName = data.ParameterName;

            var list = GetEntityDetails(doesExistRequest, requestProfile, 0);

            return(list.Count > 0);
        }
Example #7
0
        protected override void Clear()
        {
            base.Clear();

            var data = new ApplicationRouteParameterDataModel();

            ApplicationRouteParameterId = data.ApplicationRouteParameterId;
            ApplicationRouteId          = data.ApplicationRouteId;
            ParameterName  = data.ParameterName;
            ParameterValue = data.ParameterValue;
        }
Example #8
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                string[] deleteIndexList = DeleteIds.Split(',');
                foreach (string index in deleteIndexList)
                {
                    var data = new ApplicationRouteParameterDataModel();
                    data.ApplicationRouteParameterId = int.Parse(index);
                    Framework.Components.Core.ApplicationRouteParameterDataManager.Delete(data, SessionVariables.RequestProfile);
                }

                Framework.Components.Audit.AuditHistoryDataManager.DeleteDataBySystemEntity(DeleteIds, (int)Framework.Components.DataAccess.SystemEntity.ApplicationRouteParameter, SessionVariables.RequestProfile);
                Response.Redirect(Page.GetRouteUrl("ApplicationRouteParameterEntityRoute", new { Action = "Default", SetId = true }), false);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
Example #9
0
        public void LoadData(int applicationRouteParameterId, bool showId)
        {
            // clear UI
            Clear();

            // set up parameters
            var data = new ApplicationRouteParameterDataModel();

            data.ApplicationRouteParameterId = applicationRouteParameterId;

            // get data
            var items = Framework.Components.Core.ApplicationRouteParameterDataManager.GetEntityDetails(data, SessionVariables.RequestProfile);

            // should only have single match -- should log exception.
            if (items.Count != 1)
            {
                return;
            }

            var item = items[0];

            ApplicationRouteParameterId = item.ApplicationRouteParameterId;
            ApplicationRouteId          = item.ApplicationRouteId;
            ParameterName  = item.ParameterName;
            ParameterValue = item.ParameterValue;

            if (!showId)
            {
                txtApplicationRouteParameterId.Text = item.ApplicationRouteParameterId.ToString();

                //PlaceHolderAuditHistory.Visible = true;
                // only show Audit History in case of Update page, not for Clone.
                oHistoryList.Setup(PrimaryEntity, applicationRouteParameterId, PrimaryEntityKey);
            }
            else
            {
                txtApplicationRouteParameterId.Text = String.Empty;
            }

            oUpdateInfo.LoadText(item.UpdatedDate, item.UpdatedBy, item.LastAction);
        }
Example #10
0
        public override int?Save(string action)
        {
            var data = new ApplicationRouteParameterDataModel();

            data.ApplicationRouteParameterId = ApplicationRouteParameterId;
            data.ApplicationRouteId          = ApplicationRouteId;
            data.ParameterName  = ParameterName;
            data.ParameterValue = ParameterValue;

            if (action == "Insert")
            {
                Framework.Components.Core.ApplicationRouteParameterDataManager.Create(data, SessionVariables.RequestProfile);
            }
            else
            {
                Framework.Components.Core.ApplicationRouteParameterDataManager.Update(data, SessionVariables.RequestProfile);
            }

            // not correct ... when doing insert, we didn't get/change the value of ApplicationRouteID ?
            return(ApplicationRouteParameterId);
        }
Example #11
0
        protected override DataTable GetData()
        {
            try
            {
                SuperKey = ApplicationCommon.GetSuperKey();
                SetId    = ApplicationCommon.GetSetId();

                var selectedrows = new DataTable();
                var applicationRouteParameterdata = new ApplicationRouteParameterDataModel();

                selectedrows = Framework.Components.Core.ApplicationRouteParameterDataManager.GetDetails(applicationRouteParameterdata, SessionVariables.RequestProfile).Clone();
                if (!string.IsNullOrEmpty(SuperKey))
                {
                    var systemEntityTypeId = (int)PrimaryEntity;
                    var lstEntityKeys      = ApplicationCommon.GetSuperKeyDetails(systemEntityTypeId, SuperKey);

                    foreach (var entityKey in lstEntityKeys)
                    {
                        applicationRouteParameterdata.ApplicationRouteParameterId = entityKey;
                        var result = Framework.Components.Core.ApplicationRouteParameterDataManager.GetDetails(applicationRouteParameterdata, SessionVariables.RequestProfile);
                        selectedrows.ImportRow(result.Rows[0]);
                    }
                }
                else
                {
                    applicationRouteParameterdata.ApplicationRouteParameterId = SetId;
                    var result = Framework.Components.Core.ApplicationRouteParameterDataManager.GetDetails(applicationRouteParameterdata, SessionVariables.RequestProfile);
                    selectedrows.ImportRow(result.Rows[0]);
                }
                return(selectedrows);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }

            return(null);
        }
Example #12
0
        protected override DataTable UpdateData()
        {
            var UpdatedData = new DataTable();
            var data        = new ApplicationRouteParameterDataModel();

            UpdatedData = Framework.Components.Core.ApplicationRouteParameterDataManager.Search(data, SessionVariables.RequestProfile).Clone();
            for (var i = 0; i < SelectedData.Rows.Count; i++)
            {
                data.ApplicationRouteParameterId =
                    Convert.ToInt32(SelectedData.Rows[i][ApplicationRouteParameterDataModel.DataColumns.ApplicationRouteParameterId].ToString());
                data.ApplicationRouteId =
                    !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(ApplicationRouteParameterDataModel.DataColumns.ApplicationRouteId))
                                        ? int.Parse(CheckAndGetRepeaterTextBoxValue(ApplicationRouteParameterDataModel.DataColumns.ApplicationRouteId).ToString())
                                        : int.Parse(SelectedData.Rows[i][ApplicationRouteParameterDataModel.DataColumns.ApplicationRouteId].ToString());

                data.ParameterName =
                    !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(ApplicationRouteParameterDataModel.DataColumns.ParameterName))
                                        ? CheckAndGetRepeaterTextBoxValue(ApplicationRouteParameterDataModel.DataColumns.ParameterName)
                                        : SelectedData.Rows[i][ApplicationRouteParameterDataModel.DataColumns.ParameterName].ToString();

                data.ParameterValue =
                    !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(ApplicationRouteParameterDataModel.DataColumns.ParameterValue))
                                        ? CheckAndGetRepeaterTextBoxValue(ApplicationRouteParameterDataModel.DataColumns.ParameterValue)
                                        : SelectedData.Rows[i][ApplicationRouteParameterDataModel.DataColumns.ParameterValue].ToString();

                Framework.Components.Core.ApplicationRouteParameterDataManager.Update(data, SessionVariables.RequestProfile);
                data = new ApplicationRouteParameterDataModel();
                data.ApplicationRouteParameterId = Convert.ToInt32(SelectedData.Rows[i][ApplicationRouteParameterDataModel.DataColumns.ApplicationRouteParameterId].ToString());
                var dt = Framework.Components.Core.ApplicationRouteParameterDataManager.Search(data, SessionVariables.RequestProfile);

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