/// <summary> /// Populate a Organisation object. /// </summary> /// <param name="input">The Organisation object to populate.</param> /// <param name="reader">The data reader from which to populate the Organisation object.</param> public static void PopulateOrganisation(Organisation input, System.Data.IDataReader reader) { PopulateRecord(input, reader); input.RecordId = input.OrganisationId = Utilities.ToInt(reader["OrganisationID"]); input.Name = Utilities.ToString(reader["Name"]); input.ContactInformationId = Utilities.ToInt(reader["ContactInformationID"]); input.DisplayIndex = Utilities.ToInt(reader["DisplayIndex"]); input.IsLegacy = Utilities.ToBool(reader["IsLegacy"]); input.AuthorisationCode = Utilities.ToString(reader["AuthorisationCode"]); }
/// <summary> /// Creates a Organisation object using data from a data reader. /// </summary> /// <param name="reader">A data reader containing a key and corresponding value for each property of a Organisation object.</param> /// <returns>A populated Organisation object.</returns> public static Organisation PopulateOrganisation(System.Data.IDataReader reader) { Organisation result = null; if (reader != null && reader.Read()) { result = new Organisation(); PopulateOrganisation(result, reader); } return result; }
//void gvwOrganisations_BeginningEdit(object sender, Telerik.Windows.Controls.GridViewBeginningEditRoutedEventArgs e) //{ // if (e.Cell.Column.UniqueName == "NumberOfRooms") // { // e.Cancel = true; // } //} void gvwOrganisations_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e) { Organisation newItem = new Organisation(); newItem.RecordId = null; newItem.CreatedBy = Globals.UserLogin.UserName; //newItem.DateCreated = Globals.ServerNow; newItem.AuthorisationCode = string.Empty; newItem.ContactInformation = new ContactInformation(); newItem.ContactInformation.ContactTypeId = (int)ContactType.Organisation; if (_originalItemSource.Count() > 0) newItem.DisplayIndex = _originalItemSource.Max(d => d.DisplayIndex) + 1; newItem.IsChanged = true; e.NewObject = newItem; gridContactAccount.Visibility = System.Windows.Visibility.Collapsed; }