Esempio n. 1
0
        public static Doctor Doctor(System.Data.IDataReader reader)
        {
            Doctor result = null;

            if (null != reader && reader.Read())
            {
                result = new Doctor();
                PopulateDoctor(result, reader);
            }

            return result;
        }
Esempio n. 2
0
 public static void PopulateDoctor(Doctor input, System.Data.IDataReader reader)
 {
     PopulateRecord(input, reader);
     input.RecordId = Utilities.ToInt(reader[Medical.Apartment.Common.Doctor.ColumnNames.DoctorId]);
     input.OrganisationId = Utilities.ToInt(reader[Medical.Apartment.Common.Doctor.ColumnNames.OrganisationId]);
     input.SiteId = Utilities.ToInt(reader[Medical.Apartment.Common.Doctor.ColumnNames.SiteId]);
     input.SiteName = Utilities.ToString(reader[Medical.Apartment.Common.Doctor.ColumnNames.SiteName]);
     input.FirstName = Utilities.ToString(reader[Medical.Apartment.Common.Doctor.ColumnNames.FirstName]);
     input.LastName = Utilities.ToString(reader[Medical.Apartment.Common.Doctor.ColumnNames.LastName]);
     input.IsLegacy = Utilities.ToBool(reader[Medical.Apartment.Common.Doctor.ColumnNames.IsLegacy]);
     input.Gender = Utilities.ToNInt(reader[Medical.Apartment.Common.Doctor.ColumnNames.Gender]);
     input.DoB = Utilities.ToNDateTime(reader[Medical.Apartment.Common.Doctor.ColumnNames.DoB]);
     input.ContactInformationId = Utilities.ToInt(reader[Medical.Apartment.Common.Doctor.ColumnNames.ContactInformationId]);
 }
        //void gvwDoctors_BeginningEdit(object sender, Telerik.Windows.Controls.GridViewBeginningEditRoutedEventArgs e)
        //{
        //    if (e.Cell.Column.UniqueName == "NumberOfRooms")
        //    {
        //        e.Cancel = true;
        //    }
        //}

        void gvwDoctors_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
        {
            Doctor newItem = new Doctor();
            newItem.RecordId = null;
            newItem.OrganisationId = Globals.UserLogin.UserOrganisationId;            
            newItem.CreatedBy = Globals.UserLogin.UserName;
            newItem.DateCreated = Globals.Now;
            newItem.ContactInformation = new ContactInformation();
            newItem.ContactInformation.CountryId = _defaultCountryId;
            newItem.ContactInformation.ContactTypeId = (int)ContactType.Doctor;
            newItem.IsChanged = newItem.ContactInformation.IsChanged = true;
            e.NewObject = newItem;

            ucCntactInfoPanel.Visibility = System.Windows.Visibility.Collapsed;
        }