Exemplo n.º 1
0
        // 得到所有的病床
        public List <CommContracts.SickBed> GetAllSickBed(string strName = "")
        {
            CommClient.SickBed myd = new CommClient.SickBed();

            List <CommContracts.SickBed> list = new List <CommContracts.SickBed>();

            list = myd.GetAllSickBed(strName);
            return(list);
        }
Exemplo n.º 2
0
        // 删除供病床
        public bool DeleteSickBed(int sickRoomID)
        {
            CommClient.SickBed myd = new CommClient.SickBed();
            if (myd.DeleteSickBed(sickRoomID))
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 3
0
        private void SaveBtn_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(this.NameEdit.Text.Trim()))
            {
                return;
            }

            if (this.DepartmentCombo.SelectedItem == null)
            {
                return;
            }

            if (this.SickRoomCombo.SelectedItem == null)
            {
                return;
            }

            if (bIsEdit)
            {
                SickBed.Name       = this.NameEdit.Text.Trim();
                SickBed.Remarks    = this.RemarksEdit.Text.Trim();
                SickBed.SickRoomID = ((CommContracts.SickRoom) this.SickRoomCombo.SelectedItem).ID;


                CommClient.SickBed myd = new CommClient.SickBed();
                if (myd.UpdateSickBed(SickBed))
                {
                    (this.Parent as Window).DialogResult = true;
                    (this.Parent as Window).Close();
                }
            }
            else
            {
                CommContracts.SickBed sickBed = new CommContracts.SickBed();
                sickBed.Name       = this.NameEdit.Text.Trim();
                sickBed.Remarks    = this.RemarksEdit.Text.Trim();
                sickBed.SickRoomID = ((CommContracts.SickRoom) this.SickRoomCombo.SelectedItem).ID;


                CommClient.SickBed myd = new CommClient.SickBed();
                if (myd.SaveSickBed(sickBed))
                {
                    (this.Parent as Window).DialogResult = true;
                    (this.Parent as Window).Close();
                }
            }
        }