protected override DataTable UpdateData() { var UpdatedData = new DataTable(); var data = new MilestoneFeatureStateDataModel(); UpdatedData = MilestoneFeatureStateDataManager.Search(data, SessionVariables.RequestProfile).Clone(); for (var i = 0; i < SelectedData.Rows.Count; i++) { data.MilestoneFeatureStateId = Convert.ToInt32(SelectedData.Rows[i][MilestoneFeatureStateDataModel.DataColumns.MilestoneFeatureStateId].ToString()); data.Name = SelectedData.Rows[i][StandardDataModel.StandardDataColumns.Name].ToString(); data.Description = !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.Description)) ? CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.Description) : SelectedData.Rows[i][StandardDataModel.StandardDataColumns.Description].ToString(); data.SortOrder = !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.SortOrder)) ? int.Parse(CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.SortOrder)) : int.Parse(SelectedData.Rows[i][StandardDataModel.StandardDataColumns.SortOrder].ToString()); MilestoneFeatureStateDataManager.Update(data, SessionVariables.RequestProfile); data = new MilestoneFeatureStateDataModel(); data.MilestoneFeatureStateId = Convert.ToInt32(SelectedData.Rows[i][MilestoneFeatureStateDataModel.DataColumns.MilestoneFeatureStateId].ToString()); var dt = MilestoneFeatureStateDataManager.Search(data, SessionVariables.RequestProfile); if (dt.Rows.Count == 1) { UpdatedData.ImportRow(dt.Rows[0]); } } return(UpdatedData); }
public override int?Save(string action) { var data = new MilestoneFeatureStateDataModel(); data.MilestoneFeatureStateId = SystemKeyId; data.Name = Name; data.Description = Description; data.SortOrder = SortOrder; if (action == "Insert") { var dtMilestoneFeatureState = MilestoneFeatureStateDataManager.DoesExist(data, SessionVariables.RequestProfile); if (dtMilestoneFeatureState.Rows.Count == 0) { MilestoneFeatureStateDataManager.Create(data, SessionVariables.RequestProfile); } else { throw new Exception("Record with given ID already exists."); } } else { MilestoneFeatureStateDataManager.Update(data, SessionVariables.RequestProfile); } return(data.MilestoneFeatureStateId); }
protected override void Update(Dictionary <string, string> values) { var data = new MilestoneFeatureStateDataModel(); if (values.ContainsKey(MilestoneFeatureStateDataModel.DataColumns.MilestoneFeatureStateId)) { data.MilestoneFeatureStateId = int.Parse(values[MilestoneFeatureStateDataModel.DataColumns.MilestoneFeatureStateId]); } if (values.ContainsKey(StandardDataModel.StandardDataColumns.Name)) { data.Name = values[StandardDataModel.StandardDataColumns.Name]; } if (values.ContainsKey(StandardDataModel.StandardDataColumns.Description)) { data.Description = values[StandardDataModel.StandardDataColumns.Description]; } if (values.ContainsKey(StandardDataModel.StandardDataColumns.SortOrder)) { data.SortOrder = int.Parse(values[StandardDataModel.StandardDataColumns.SortOrder]); } MilestoneFeatureStateDataManager.Update(data, SessionVariables.RequestProfile); base.Update(values); }
private void UpdateData(ArrayList values) { var data = new MilestoneFeatureStateDataModel(); data.MilestoneFeatureStateId = int.Parse(values[0].ToString()); data.Name = values[1].ToString(); data.Description = values[2].ToString(); data.SortOrder = int.Parse(values[3].ToString()); MilestoneFeatureStateDataManager.Update(data, SessionVariables.RequestProfile); ReBindEditableGrid(); }