public ShowBedWindow(bed bed)
 {
     InitializeComponent();
     _viewModel = DataContext as ShowOneBedViewModel;
     if (_viewModel != null)
     {
         _viewModel.Initilize(bed);
         _viewModel.RegistrationBedEvent += viewModel_RegistrationBedEvent;
     }
 }
 public void Initilize(bed bed)
 {
     Bed = new BedForRedact
     {
         Id = bed.Id,
         Floor = bed.room.Floor,
         RoomNumber = bed.room.Number,
         RoomId = bed.RoomId,
         Price = bed.Price,
         Status = bed.Status,
         Mark = bed.Mark,
         OrderBed = new List<order_bed>()
     };
     Recalck();
     PropertyChanged += ShowOneBedViewModel_PropertyChanged;
     Title = "Просмотр места №:" + Bed.Id;
 }
예제 #3
0
        public List <bed> Bed_select()
        {
            List <bed>    Bed    = new List <bed>();
            SqlDataReader reader = DBHelper.SectionRoomSelect("p_bed_select");

            while (reader.Read())
            {
                bed B = new bed();
                B.Idsickroom = int.Parse(reader[0] + "");
                B.Idbed      = int.Parse(reader[1] + "");
                B.KId        = int.Parse(reader[2] + "");
                B.State      = reader[3] + "";
                Bed.Add(B);
            }
            DBHelper.con.Close();
            DBHelper.con.Dispose();
            DBHelper.cmd.Dispose();
            return(Bed);
        }
 public BedForSelect(bed bed)
 {
     Bed = bed;
     Status =
         ProjectSettings.DbContext.status.Where(item => item.ForBed && item.Id==bed.Status).Select(item => item.Text).FirstOrDefault();
 }