private static void UpdateGridTableInCache(int systemEntityTypeId, int auditId) { var obj = new FieldConfigurationDataModel(); var data = new DataTable(); obj.SystemEntityTypeId = systemEntityTypeId; data = FieldConfigurationDataManager.Search(obj, auditId, SessionVariables.ApplicationMode); var dtInSession = (DataTable)SessionVariables.GridColumnsTable; if (dtInSession != null) { var odt = dtInSession.Clone(); var datarows = dtInSession.Select("SystemEntityTypeId = " + systemEntityTypeId); if (datarows.Length > 0) { foreach (var dr in datarows) { dtInSession.Rows.Remove(dr); } } dtInSession.Merge(data); SessionVariables.GridColumnsTable = dtInSession; } else { SessionVariables.GridColumnsTable = data; } }
public static DataTable GetGridViewColumns(int systemEntityTypeId, int auditId) { var obj = new FieldConfigurationDataModel(); var odt = new DataTable(); if (SessionVariables.AEFLTable == null) { obj.SystemEntityTypeId = systemEntityTypeId; odt = FieldConfigurationDataManager.Search(obj, auditId, SessionVariables.ApplicationMode); SessionVariables.AEFLTable = odt; } else { var dtInSession = SessionVariables.AEFLTable; odt = dtInSession.Clone(); var datarows = dtInSession.Select("SystemEntityTypeId = " + systemEntityTypeId); if (datarows.Length > 0) { foreach (var dr in datarows) { odt.ImportRow(dr); } } else { obj.SystemEntityTypeId = systemEntityTypeId; odt = FieldConfigurationDataManager.Search(obj, auditId, SessionVariables.ApplicationMode); dtInSession.Merge(odt); SessionVariables.AEFLTable = dtInSession; } } return(odt); }
public void SetupSearch() { if (SearchColumns == null) { //Code to bind the Search fields repeater with SearchField Mode columns from FieldConfig table var colsdata = new FieldConfigurationDataModel(); colsdata.FieldConfigurationModeId = SessionVariables.SearchControlColumnsModeId; colsdata.SystemEntityTypeId = Convert.ToInt32(Framework.Components.DataAccess.SystemEntity.Application); var cols = FieldConfigurationDataManager.Search(colsdata, AuditId, SessionVariables.ApplicationMode); SearchColumns = cols; } SearchParametersRepeater.DataSource = SearchColumns; SearchParametersRepeater.DataBind(); if (!string.IsNullOrEmpty(SettingCategory)) { PerferenceUtility.CreateUserPreferenceCategoryIfNotExists(SettingCategory, "Search Control Name"); } else { throw new Exception("Search control is not named"); } GetSettings(); SaveSettings(); RaiseSearch(); }
private System.Data.DataTable GetData() { var data = new FieldConfigurationDataModel(); var dt = FieldConfigurationDataManager.Search(data, SessionVariables.RequestProfile); return(dt); }
protected override DataTable GetEntityData(int?entityKey) { var fieldConfigurationdata = new FieldConfigurationDataModel(); fieldConfigurationdata.FieldConfigurationId = entityKey; var results = FieldConfigurationDataManager.Search(fieldConfigurationdata, SessionVariables.RequestProfile); return(results); }
protected void SearchParametersRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { var label = (Label)e.Item.FindControl("label"); var hdnfield = (HiddenField)e.Item.FindControl("hdnfield"); var txtbox = (TextBox)e.Item.FindControl("txtbox"); var txtbox1 = (TextBox)e.Item.FindControl("txtbox1"); var dropdownlist = (DropDownList)e.Item.FindControl("dropdownlist"); if (label != null && dropdownlist != null) { var name = hdnfield.Value; var data = new FieldConfigurationDataModel(); data.Name = name; data.FieldConfigurationModeId = SessionVariables.SearchControlColumnsModeId; var dt = FieldConfigurationDataManager.Search(data, SessionVariables.RequestProfile); if (dt.Rows.Count >= 1) { var controltype = dt.Rows[0] [FieldConfigurationDataModel.DataColumns.ControlType].ToString(); if (controltype.Equals("TextBox")) { txtbox.Visible = true; txtbox1.Visible = false; dropdownlist.Visible = false; } else if (controltype.Equals("DropDownList")) { txtbox.Visible = false; txtbox1.Visible = true; dropdownlist.Visible = true; if (name.Equals("FunctionalityId")) { var functionalityData = TaskTimeTracker.Components.Module.ApplicationDevelopment.FunctionalityDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(functionalityData, dropdownlist, StandardDataModel.StandardDataColumns.Name, FunctionalityDataModel.DataColumns.FunctionalityId); } if (name.Equals("FunctionalityActiveStatusId")) { var FunctionalityActiveStatusData = TaskTimeTracker.Components.Module.ApplicationDevelopment.FunctionalityActiveStatusDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(FunctionalityActiveStatusData, dropdownlist, StandardDataModel.StandardDataColumns.Name, FunctionalityActiveStatusDataModel.DataColumns.FunctionalityActiveStatusId); } dropdownlist.Items.Insert(0, new ListItem("All", "-1")); dropdownlist.SelectedIndex = 0; } } e.Item.Visible = PerferenceUtility.GetUserPreferenceByKeyAsBoolean(name + "Visibility", SettingCategory); } } }
protected void SearchParametersRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { var label = (Label)e.Item.FindControl("label"); var hdnfield = (HiddenField)e.Item.FindControl("hdnfield"); var txtbox = (TextBox)e.Item.FindControl("txtbox"); var txtbox1 = (TextBox)e.Item.FindControl("txtbox1"); var dropdownlist = (DropDownList)e.Item.FindControl("dropdownlist"); if (label != null && txtbox != null && dropdownlist != null) { var name = hdnfield.Value; var data = new FieldConfigurationDataModel(); data.Name = name; data.FieldConfigurationModeId = SessionVariables.SearchControlColumnsModeId; var dt = FieldConfigurationDataManager.Search(data, SessionVariables.RequestProfile); if (dt.Rows.Count >= 1) { var controltype = dt.Rows[0] [FieldConfigurationDataModel.DataColumns.ControlType].ToString(); if (controltype.Equals("TextBox")) { txtbox.Visible = true; txtbox1.Visible = false; dropdownlist.Visible = false; } else if (controltype.Equals("DropDownList")) { txtbox.Visible = false; txtbox1.Visible = true; dropdownlist.Visible = true; if (name.Equals("ApplicationUserId")) { var applicationUserData = Framework.Components.ApplicationUser.ApplicationUserDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(applicationUserData, dropdownlist, ApplicationUserDataModel.DataColumns.FullName, ApplicationUserDataModel.DataColumns.ApplicationUserId); } if (name.Equals("UserPreferenceKeyId")) { var UserPreferenceKeyData = Framework.Components.UserPreference.UserPreferenceKeyDataManager.GetList(SessionVariables.RequestProfile); UIHelper.LoadDropDown(UserPreferenceKeyData, dropdownlist, StandardDataModel.StandardDataColumns.Name, UserPreferenceKeyDataModel.DataColumns.UserPreferenceKeyId); } } } e.Item.Visible = PerferenceUtility.GetUserPreferenceByKeyAsBoolean(name + "Visibility", SettingCategory); } } }
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.RequestProfile); // List given search parameters var data = new FieldConfigurationDataModel(); var dt = FieldConfigurationDataManager.Search(data, SessionVariables.RequestProfile); return(dt); }
private DataTable GetGridFormatSettings() { var entityId = GetSystemEntityTypeId(); var auditId = SessionVariables.RequestProfile.AuditId; var dtGridFormat = new FieldConfigurationDataModel(); dtGridFormat.SystemEntityTypeId = entityId; var gridFormatdt = FieldConfigurationDataManager.Search(dtGridFormat, SessionVariables.RequestProfile); return(gridFormatdt); //var validColumns = _getColumnDelegate(); }
private DataTable GetApplicableModesList(int systemEntityTypeId) { var data = new FieldConfigurationDataModel(); data.SystemEntityTypeId = systemEntityTypeId; var columns = FieldConfigurationDataManager.Search(data, SessionVariables.RequestProfile); var modes = FieldConfigurationModeDataManager.GetList(SessionVariables.RequestProfile); var validModes = new DataTable(); validModes = modes.Clone(); for (var j = 0; j < modes.Rows.Count; j++) { for (var i = 0; i < columns.Rows.Count; i++) { if ( int.Parse( columns.Rows[i][ FieldConfigurationDataModel.DataColumns.FieldConfigurationModeId]. ToString()) == int.Parse( modes.Rows[j][ FieldConfigurationModeDataModel.DataColumns. FieldConfigurationModeId].ToString()) ) { var temp = validModes.Select("FieldConfigurationModeId = " + int.Parse( modes.Rows[j][ FieldConfigurationModeDataModel.DataColumns. FieldConfigurationModeId].ToString())); if (temp.Length == 0) { validModes.ImportRow(modes.Rows[j]); } } } } var dv = validModes.DefaultView; dv.Sort = "SortOrder ASC"; var sortedValidModes = dv.ToTable(); return(sortedValidModes); }
public static string[] GetGridViewColumns(int systemEntityTypeId, RequestProfile requestProfile) { var obj = new FieldConfigurationDataModel(); obj.SystemEntityTypeId = systemEntityTypeId; var odt = FieldConfigurationDataManager.Search(obj, SessionVariables.RequestProfile); var validColumns = new string[odt.Rows.Count]; for (var i = 0; i < odt.Rows.Count; i++) { validColumns[i] = odt.Rows[i][FieldConfigurationDataModel.DataColumns.Name].ToString(); } return(validColumns); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var data = new FieldConfigurationDataModel(); var modedt = FieldConfigurationModeDataManager.GetList(SessionVariables.RequestProfile); var rows = modedt.Select("Name = 'CommonEditable'"); if (rows.Length == 1) { data.FieldConfigurationModeId = int.Parse(rows[0][FieldConfigurationModeDataModel.DataColumns.FieldConfigurationModeId].ToString()); } data.SystemEntityTypeId = (int)Enum.Parse(typeof(SystemEntity), EntityName); Columns = FieldConfigurationDataManager.Search(data, SessionVariables.RequestProfile); repUpdate.DataSource = Columns; repUpdate.DataBind(); } }
protected override DataTable UpdateData() { var UpdatedData = new DataTable(); var data = new FieldConfigurationDataModel(); UpdatedData = FieldConfigurationDataManager.Search(data, SessionVariables.RequestProfile).Clone(); for (var i = 0; i < SelectedData.Rows.Count; i++) { data.FieldConfigurationId = Convert.ToInt32(SelectedData.Rows[i][FieldConfigurationDataModel.DataColumns.FieldConfigurationId].ToString()); data.Name = !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(FieldConfigurationDataModel.DataColumns.Name)) ? CheckAndGetRepeaterTextBoxValue(FieldConfigurationDataModel.DataColumns.Name).ToString() : SelectedData.Rows[i][FieldConfigurationDataModel.DataColumns.Name].ToString(); data.Value = !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(FieldConfigurationDataModel.DataColumns.Value)) ? CheckAndGetRepeaterTextBoxValue(FieldConfigurationDataModel.DataColumns.Value).ToString() : SelectedData.Rows[i][FieldConfigurationDataModel.DataColumns.Value].ToString(); data.ControlType = !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(FieldConfigurationDataModel.DataColumns.ControlType)) ? CheckAndGetRepeaterTextBoxValue(FieldConfigurationDataModel.DataColumns.ControlType).ToString() : SelectedData.Rows[i][FieldConfigurationDataModel.DataColumns.ControlType].ToString(); data.Formatting = !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(FieldConfigurationDataModel.DataColumns.Formatting)) ? CheckAndGetRepeaterTextBoxValue(FieldConfigurationDataModel.DataColumns.Formatting).ToString() : SelectedData.Rows[i][FieldConfigurationDataModel.DataColumns.Formatting].ToString(); data.HorizontalAlignment = !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(FieldConfigurationDataModel.DataColumns.HorizontalAlignment)) ? CheckAndGetRepeaterTextBoxValue(FieldConfigurationDataModel.DataColumns.HorizontalAlignment).ToString() : SelectedData.Rows[i][FieldConfigurationDataModel.DataColumns.HorizontalAlignment].ToString(); data.FieldConfigurationModeId = !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(FieldConfigurationDataModel.DataColumns.FieldConfigurationModeId)) ? int.Parse(CheckAndGetRepeaterTextBoxValue(FieldConfigurationDataModel.DataColumns.FieldConfigurationModeId).ToString()) : int.Parse(SelectedData.Rows[i][FieldConfigurationDataModel.DataColumns.FieldConfigurationModeId].ToString()); data.SystemEntityTypeId = !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(FieldConfigurationDataModel.DataColumns.SystemEntityTypeId)) ? int.Parse(CheckAndGetRepeaterTextBoxValue(FieldConfigurationDataModel.DataColumns.SystemEntityTypeId).ToString()) : int.Parse(SelectedData.Rows[i][FieldConfigurationDataModel.DataColumns.SystemEntityTypeId].ToString()); data.GridViewPriority = !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(FieldConfigurationDataModel.DataColumns.GridViewPriority)) ? int.Parse(CheckAndGetRepeaterTextBoxValue(FieldConfigurationDataModel.DataColumns.GridViewPriority).ToString()) : int.Parse(SelectedData.Rows[i][FieldConfigurationDataModel.DataColumns.GridViewPriority].ToString()); data.DetailsViewPriority = !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(FieldConfigurationDataModel.DataColumns.DetailsViewPriority)) ? int.Parse(CheckAndGetRepeaterTextBoxValue(FieldConfigurationDataModel.DataColumns.DetailsViewPriority).ToString()) : int.Parse(SelectedData.Rows[i][FieldConfigurationDataModel.DataColumns.DetailsViewPriority].ToString()); data.DisplayColumn = !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(FieldConfigurationDataModel.DataColumns.DisplayColumn)) ? int.Parse(CheckAndGetRepeaterTextBoxValue(FieldConfigurationDataModel.DataColumns.DisplayColumn).ToString()) : int.Parse(SelectedData.Rows[i][FieldConfigurationDataModel.DataColumns.DisplayColumn].ToString()); FieldConfigurationDataManager.Update(data, SessionVariables.RequestProfile); data = new FieldConfigurationDataModel(); data.FieldConfigurationId = Convert.ToInt32(SelectedData.Rows[i][FieldConfigurationDataModel.DataColumns.FieldConfigurationId].ToString()); var dt = FieldConfigurationDataManager.Search(data, SessionVariables.RequestProfile); if (dt.Rows.Count == 1) { UpdatedData.ImportRow(dt.Rows[0]); } } return(UpdatedData); }
protected override System.Data.DataTable GetData() { var dt = FieldConfigurationDataManager.Search(oSearchFilter.SearchParameters, SessionVariables.RequestProfile); return(dt); }