protected override DataTable UpdateData() { var UpdatedData = new DataTable(); var data = new FieldConfigurationModeXApplicationRoleDataModel(); UpdatedData = FieldConfigurationModeXApplicationRoleDataManager.Search(data, SessionVariables.RequestProfile).Clone(); for (var i = 0; i < SelectedData.Rows.Count; i++) { data.FieldConfigurationModeXApplicationRoleId = Convert.ToInt32(SelectedData.Rows[i][FieldConfigurationModeXApplicationRoleDataModel.DataColumns.FieldConfigurationModeXApplicationRoleId].ToString()); data.ApplicationRoleId = !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(FieldConfigurationModeXApplicationRoleDataModel.DataColumns.ApplicationRoleId)) ? int.Parse(CheckAndGetRepeaterTextBoxValue(FieldConfigurationModeXApplicationRoleDataModel.DataColumns.ApplicationRoleId).ToString()) : int.Parse(SelectedData.Rows[i][FieldConfigurationModeXApplicationRoleDataModel.DataColumns.ApplicationRoleId].ToString()); data.FieldConfigurationModeId = !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(FieldConfigurationModeXApplicationRoleDataModel.DataColumns.FieldConfigurationModeId)) ? int.Parse(CheckAndGetRepeaterTextBoxValue(FieldConfigurationModeXApplicationRoleDataModel.DataColumns.FieldConfigurationModeId).ToString()) : int.Parse(SelectedData.Rows[i][FieldConfigurationModeXApplicationRoleDataModel.DataColumns.FieldConfigurationModeId].ToString()); FieldConfigurationModeXApplicationRoleDataManager.Update(data, SessionVariables.RequestProfile); data = new FieldConfigurationModeXApplicationRoleDataModel(); data.FieldConfigurationModeXApplicationRoleId = Convert.ToInt32(SelectedData.Rows[i][FieldConfigurationModeXApplicationRoleDataModel.DataColumns.FieldConfigurationModeXApplicationRoleId].ToString()); var dt = FieldConfigurationModeXApplicationRoleDataManager.Search(data, SessionVariables.RequestProfile); if (dt.Rows.Count == 1) { UpdatedData.ImportRow(dt.Rows[0]); } } return(UpdatedData); }
protected override void Update(Dictionary <string, string> values) { var data = new FieldConfigurationModeXApplicationRoleDataModel(); data.FieldConfigurationModeXApplicationRoleId = int.Parse(values[FieldConfigurationModeXApplicationRoleDataModel.DataColumns.FieldConfigurationModeXApplicationRoleId].ToString()); data.ApplicationRoleId = int.Parse(values[FieldConfigurationModeXApplicationRoleDataModel.DataColumns.ApplicationRoleId].ToString()); data.FieldConfigurationModeId = int.Parse(values[FieldConfigurationModeXApplicationRoleDataModel.DataColumns.FieldConfigurationModeId].ToString()); FieldConfigurationModeXApplicationRoleDataManager.Update(data, SessionVariables.RequestProfile); base.Update(values); }
public override int?Save(string action) { var data = new FieldConfigurationModeXApplicationRoleDataModel(); data.FieldConfigurationModeXApplicationRoleId = FieldConfigurationModeXApplicationRoleId; data.FieldConfigurationModeId = FieldConfigurationModeId; data.ApplicationRoleId = ApplicationRoleId; data.FieldConfigurationModeAccessModeId = FieldConfigurationModeAccessModeId; if (action == "Insert") { FieldConfigurationModeXApplicationRoleDataManager.Create(data, SessionVariables.RequestProfile); } else { FieldConfigurationModeXApplicationRoleDataManager.Update(data, SessionVariables.RequestProfile); } return(data.FieldConfigurationModeXApplicationRoleId); }