Пример #1
0
        private System.Data.DataTable GetData()
        {
            var data = new Framework.Components.UserPreference.ApplicationEntityFieldLabelMode.Data();
            var dt   = Framework.Components.UserPreference.ApplicationEntityFieldLabelMode.Search(data, AuditId);

            return(dt);
        }
Пример #2
0
        private void ShowData(int applicationEntityFieldLabelModeId)
        {
            oDetailButtonPanel.SetId = SetId;
            var data = new Framework.Components.UserPreference.ApplicationEntityFieldLabelMode.Data();

            data.ApplicationEntityFieldLabelModeId = applicationEntityFieldLabelModeId;

            var dt = Framework.Components.UserPreference.ApplicationEntityFieldLabelMode.GetDetails(data, AuditId);

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

                lblApplicationEntityFieldLabelModeId.Text = Convert.ToString(row[Framework.Components.UserPreference.ApplicationEntityFieldLabelMode.DataColumns.ApplicationEntityFieldLabelModeId]);
                lblName.Text        = Convert.ToString(row[Framework.Components.UserPreference.ApplicationEntityFieldLabelMode.DataColumns.Name]);
                lblDescription.Text = Convert.ToString(row[Framework.Components.UserPreference.ApplicationEntityFieldLabelMode.DataColumns.Description]);
                lblSortOrder.Text   = Convert.ToString(row[Framework.Components.UserPreference.ApplicationEntityFieldLabelMode.DataColumns.SortOrder]);

                oUpdateInfo.LoadText(dt.Rows[0]);

                oHistoryList.Setup("AuditHistory", "Audit", "AuditHistoryId", true, true, (int)Framework.Components.DataAccess.SystemEntity.ApplicationEntityFieldLabelMode, applicationEntityFieldLabelModeId, "ApplicationEntityFieldLabelMode");
                dynAuditHistory.Visible = ApplicationCommon.GetUserPreferenceByKeyAsBoolean(ApplicationCommon.HistoryGridVisibilityKey, "ApplicationEntityFieldLabelMode");
            }
            else
            {
                Clear();
            }
        }
Пример #3
0
        private void InsertData()
        {
            var data = new Framework.Components.UserPreference.ApplicationEntityFieldLabelMode.Data();

            data.ApplicationEntityFieldLabelModeId = myGenericControl.ApplicationEntityFieldLabelModeId;
            data.Name        = myGenericControl.Name;
            data.Description = myGenericControl.Description;
            data.SortOrder   = myGenericControl.SortOrder;

            Framework.Components.UserPreference.ApplicationEntityFieldLabelMode.Create(data, AuditId);
        }
Пример #4
0
        private System.Data.DataTable GetData(string name)
        {
            // basic list -- no longer needed as Search will be more robust and powerfull
            //var dt = Shared.Components.BusinessLayer.Project.GetList(SessionVariables.AuditId);

            // List given search parameters
            var data = new Framework.Components.UserPreference.ApplicationEntityFieldLabelMode.Data();

            var dt = Framework.Components.UserPreference.ApplicationEntityFieldLabelMode.Search(data, AuditId);

            return(dt);
        }
Пример #5
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < plcUpdateList.Controls.Count; i++)
            {
                var myGenericControl = (Controls.Generic)plcUpdateList.Controls[i];
                var data             = new Framework.Components.UserPreference.ApplicationEntityFieldLabelMode.Data();
                data.ApplicationEntityFieldLabelModeId = (int?)myGenericControl.ApplicationEntityFieldLabelModeId;
                data.Name        = myGenericControl.Name;
                data.Description = myGenericControl.Description;
                data.SortOrder   = myGenericControl.SortOrder;


                Framework.Components.UserPreference.ApplicationEntityFieldLabelMode.Update(data, AuditId);
            }

            // To refresh values in the default page on an update.
            Response.Redirect(Page.GetRouteUrl("ConfiguratonSubRoutes", new { EntityName = "ApplicationEntityFieldLabelMode", Action = "Default", SetId = true }), false);
        }
Пример #6
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                string[] deleteIndexList = DeleteIds.Split(',');
                foreach (string index in deleteIndexList)
                {
                    var data = new Framework.Components.UserPreference.ApplicationEntityFieldLabelMode.Data();
                    data.ApplicationEntityFieldLabelModeId = int.Parse(index);
                    Framework.Components.UserPreference.ApplicationEntityFieldLabelMode.Delete(data, SessionVariables.AuditId);
                }

                Framework.Components.Audit.AuditHistory.DeleteDataBySystemEntity(DeleteIds, (int)Framework.Components.DataAccess.SystemEntity.ApplicationEntityFieldLabelMode, AuditId);
                Response.Redirect(Page.GetRouteUrl("ConfiguratonSubRoutes", new { EntityName = "ApplicationEntityFieldLabelMode", Action = "Default", SetId = true }), false);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
Пример #7
0
        public void LoadData(int ApplicationEntityFieldLabelModeId, bool showId)
        {
            var data = new Framework.Components.UserPreference.ApplicationEntityFieldLabelMode.Data();

            data.ApplicationEntityFieldLabelModeId = ApplicationEntityFieldLabelModeId;
            var oApplicationEntityFieldLabelModeTable = Framework.Components.UserPreference.ApplicationEntityFieldLabelMode.GetDetails(data, AuditId);

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

                if (!showId)
                {
                    txtApplicationEntityFieldLabelModeId.Text = row[Framework.Components.UserPreference.ApplicationEntityFieldLabelMode.DataColumns.ApplicationEntityFieldLabelModeId].ToString();

                    // only show Audit History in case of Update page, not for Clone.
                    oHistoryList.Setup("AuditHistory", "Audit", "AuditHistoryId", true, true, (int)Framework.Components.DataAccess.SystemEntity.ApplicationEntityFieldLabelMode, ApplicationEntityFieldLabelModeId, "ApplicationEntityFieldLabel");
                    dynAuditHistory.Visible = ApplicationCommon.GetUserPreferenceByKeyAsBoolean(ApplicationCommon.HistoryGridVisibilityKey, "ApplicationEntityFieldLabelMode");
                }
                else
                {
                    txtApplicationEntityFieldLabelModeId.Text = string.Empty;
                }
                txtName.Text         = row[Framework.Components.UserPreference.ApplicationEntityFieldLabelMode.DataColumns.Name].ToString();
                txtDescription.Value = row[Framework.Components.UserPreference.ApplicationEntityFieldLabelMode.DataColumns.Description].ToString();
                txtSortOrder.Text    = row[Framework.Components.UserPreference.ApplicationEntityFieldLabelMode.DataColumns.SortOrder].ToString();

                oUpdateInfo.LoadText(oApplicationEntityFieldLabelModeTable.Rows[0]);
            }
            else
            {
                txtApplicationEntityFieldLabelModeId.Text = string.Empty;
                txtName.Text         = string.Empty;
                txtDescription.Value = string.Empty;
                txtSortOrder.Text    = string.Empty;
            }
        }