private void ShowData(int applicationEntityFieldLabelId) { oDetailButtonPanel.SetId = SetId; var data = new Framework.Components.UserPreference.ApplicationEntityFieldLabel.Data(); data.ApplicationEntityFieldLabelId = applicationEntityFieldLabelId; var dt = Framework.Components.UserPreference.ApplicationEntityFieldLabel.GetDetails(data, AuditId); if (dt.Rows.Count == 1) { var row = dt.Rows[0]; lblApplicationEntityFieldLabelId.Text = Convert.ToString(row[Framework.Components.UserPreference.ApplicationEntityFieldLabel.DataColumns.ApplicationEntityFieldLabelId]); lblName.Text = Convert.ToString(row[Framework.Components.UserPreference.ApplicationEntityFieldLabel.DataColumns.Name]); lblValue.Text = Convert.ToString(row[Framework.Components.UserPreference.ApplicationEntityFieldLabel.DataColumns.Value]); lblSystemEntityTypeId.Text = Convert.ToString(row[Framework.Components.UserPreference.ApplicationEntityFieldLabel.DataColumns.SystemEntityTypeId]); lblWidth.Text = Convert.ToString(row[Framework.Components.UserPreference.ApplicationEntityFieldLabel.DataColumns.Width]); lblFormatting.Text = Convert.ToString(row[Framework.Components.UserPreference.ApplicationEntityFieldLabel.DataColumns.Formatting]); lblControlType.Text = Convert.ToString(row[Framework.Components.UserPreference.ApplicationEntityFieldLabel.DataColumns.ControlType]); lblHorizontalAlignment.Text = Convert.ToString(row[Framework.Components.UserPreference.ApplicationEntityFieldLabel.DataColumns.HorizontalAlignment]); oUpdateInfo.LoadText(dt.Rows[0]); oHistoryList.Setup("AuditHistory", "Audit", "AuditHistoryId", true, true, (int)Framework.Components.DataAccess.SystemEntity.ApplicationEntityFieldLabel, applicationEntityFieldLabelId, "ApplicationEntityFieldLabel"); dynAuditHistory.Visible = ApplicationCommon.GetUserPreferenceByKeyAsBoolean(ApplicationCommon.HistoryGridVisibilityKey, "ApplicationEntityFieldLabel"); } else { Clear(); } }
private System.Data.DataTable GetData() { var data = new Framework.Components.UserPreference.ApplicationEntityFieldLabel.Data(); var dt = Framework.Components.UserPreference.ApplicationEntityFieldLabel.Search(data, AuditId); return(dt); }
public void LoadData(int applicationEntityFieldLabelId, bool showId) { var data = new Framework.Components.UserPreference.ApplicationEntityFieldLabel.Data(); data.ApplicationEntityFieldLabelId = applicationEntityFieldLabelId; var oApplicationEntityFieldLabelTable = Framework.Components.UserPreference.ApplicationEntityFieldLabel.GetDetails(data, AuditId); if (oApplicationEntityFieldLabelTable.Rows.Count == 1) { var row = oApplicationEntityFieldLabelTable.Rows[0]; if (!showId) { txtApplicationEntityFieldLabelId.Text = row[Framework.Components.UserPreference.ApplicationEntityFieldLabel.DataColumns.ApplicationEntityFieldLabelId].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.ApplicationEntityFieldLabel, applicationEntityFieldLabelId, "ApplicationEntityFieldLabel"); dynAuditHistory.Visible = ApplicationCommon.GetUserPreferenceByKeyAsBoolean(ApplicationCommon.HistoryGridVisibilityKey, "ApplicationEntityFieldLabel"); } else { txtApplicationEntityFieldLabelId.Text = string.Empty; } txtValue.InnerText = row[Framework.Components.UserPreference.ApplicationEntityFieldLabel.DataColumns.Value].ToString(); txtName.Text = row[Framework.Components.UserPreference.ApplicationEntityFieldLabel.DataColumns.Name].ToString(); txtWidth.Text = row[Framework.Components.UserPreference.ApplicationEntityFieldLabel.DataColumns.Width].ToString(); txtFormatting.Text = row[Framework.Components.UserPreference.ApplicationEntityFieldLabel.DataColumns.Formatting].ToString(); txtControlType.Text = row[Framework.Components.UserPreference.ApplicationEntityFieldLabel.DataColumns.ControlType].ToString(); txtSystemEntityTypeId.Text = Convert.ToString(row[Framework.Components.UserPreference.ApplicationEntityFieldLabel.DataColumns.SystemEntityTypeId]); txtHorizontalAlignment.Text = Convert.ToString(row[Framework.Components.UserPreference.ApplicationEntityFieldLabel.DataColumns.HorizontalAlignment]); drpSystemEntityTypeList.SelectedValue = Convert.ToString(row[Framework.Components.UserPreference.ApplicationEntityFieldLabel.DataColumns.SystemEntityTypeId]); txtGridViewPriority.Text = row[Framework.Components.UserPreference.ApplicationEntityFieldLabel.DataColumns.GridViewPriority].ToString(); txtDetailsViewPriority.Text = row[Framework.Components.UserPreference.ApplicationEntityFieldLabel.DataColumns.DetailsViewPriority].ToString(); txtApplicationEntityFieldLabelMode.Text = Convert.ToString(row[Framework.Components.UserPreference.ApplicationEntityFieldLabel.DataColumns.ApplicationEntityFieldLabelModeId]); ddlApplicationEntityFieldLabelMode.SelectedValue = Convert.ToString(row[Framework.Components.UserPreference.ApplicationEntityFieldLabel.DataColumns.ApplicationEntityFieldLabelModeId]); oUpdateInfo.LoadText(oApplicationEntityFieldLabelTable.Rows[0]); } else { txtApplicationEntityFieldLabelId.Text = string.Empty; txtValue.InnerText = string.Empty; txtName.Text = string.Empty; txtWidth.Text = string.Empty; txtFormatting.Text = string.Empty; txtControlType.Text = string.Empty; txtSystemEntityTypeId.Text = string.Empty; txtHorizontalAlignment.Text = string.Empty; txtGridViewPriority.Text = string.Empty; txtDetailsViewPriority.Text = string.Empty; txtApplicationEntityFieldLabelMode.Text = string.Empty; } }
private void InsertData() { var data = new Framework.Components.UserPreference.ApplicationEntityFieldLabel.Data(); data.ApplicationEntityFieldLabelId = (int?)myGenericControl.ApplicationEntityFieldLabelId; data.Name = myGenericControl.Name; data.Value = myGenericControl.Value; data.SystemEntityTypeId = myGenericControl.SystemEntityTypeId; data.Width = myGenericControl.Width; data.Formatting = myGenericControl.Formatting; data.ControlType = myGenericControl.ControlType; data.HorizontalAlignment = myGenericControl.HorizontalAlignment; Framework.Components.UserPreference.ApplicationEntityFieldLabel.Create(data, AuditId); }
protected void btnDelete_Click(object sender, EventArgs e) { try { string[] deleteIndexList = DeleteIds.Split(','); foreach (string index in deleteIndexList) { var data = new Framework.Components.UserPreference.ApplicationEntityFieldLabel.Data(); data.ApplicationEntityFieldLabelId = int.Parse(index); Framework.Components.UserPreference.ApplicationEntityFieldLabel.Delete(data, SessionVariables.AuditId); } Framework.Components.Audit.AuditHistory.DeleteDataBySystemEntity(DeleteIds, (int)Framework.Components.DataAccess.SystemEntity.ApplicationEntityFieldLabel, AuditId); Response.Redirect(Page.GetRouteUrl("ConfiguratonSubRoutes", new { EntityName = "ApplicationEntityFieldLabel", Action = "Default", SetId = true }), false); } catch (Exception ex) { Response.Write(ex.Message); } }
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.ApplicationEntityFieldLabel.Data(); data.ApplicationEntityFieldLabelId = (int?)myGenericControl.ApplicationEntityFieldLabelId; data.Name = myGenericControl.Name; data.Value = myGenericControl.Value; data.SystemEntityTypeId = myGenericControl.SystemEntityTypeId; data.Width = myGenericControl.Width; data.Formatting = myGenericControl.Formatting; data.ControlType = myGenericControl.ControlType; data.HorizontalAlignment = myGenericControl.HorizontalAlignment; data.GridViewPriority = myGenericControl.GridViewPriority; data.DetailsViewPriority = myGenericControl.DetailsViewPriority; data.ApplicationEntityFieldLabelModeId = myGenericControl.ApplicationEntityFieldLabelModeId; Framework.Components.UserPreference.ApplicationEntityFieldLabel.Update(data, AuditId); } // To refresh values in the default page on an update. Response.Redirect(Page.GetRouteUrl("ConfiguratonSubRoutes", new { EntityName = "ApplicationEntityFieldLabel", Action = "Default", SetId = true }), false); }