예제 #1
0
        /// <summary>
        /// lấy thông tin của nhân viên
        /// </summary>
        /// <param name="v_Staff_Id"></param>
        /// <returns></returns>
        public static string GetStaffName(int v_Staff_Id)
        {
            LStaff objStaff = LStaff.FetchByID(v_Staff_Id);

            if (objStaff != null)
            {
                return(objStaff.StaffName);
            }
            else
            {
                return("");
            }
        }
예제 #2
0
        /// <summary>
        /// Loads the viewer with a Score object generated from the specified MusicXml file.
        /// </summary>
        public void loadFile(string fileName)
        {
            this.fileName = fileName;
            if (File.Exists(fileName))
            {
                // Parser instance converts between Score object and MusicXML
                var   parser = new MusicXmlParser();
                Score score  = parser.Parse(XDocument.Load(fileName)); // Load the content of the specified file into Data
                data = null;
                Data = score;

                // Get the key signature
                keySig = (Key)score.FirstStaff.Elements.First(k => k.GetType() == typeof(Key));
                if (KeySig == null)
                {
                    KeySig = new Key(0);
                }

                // Get the time signature
                timeSig = (TimeSignature)score.FirstStaff.Elements.First(k => k.GetType() == typeof(TimeSignature));
                if (timeSig == null)
                {
                    timeSig = TimeSignature.CommonTime;
                }

                // Set up the back end data model
                staves = null;
                staves = new List <LStaff>();
                foreach (var staff in score.Staves)
                {
                    LStaff          ls       = null;
                    List <LMeasure> measures = new List <LMeasure>();
                    foreach (var measure in staff.Measures)
                    {
                        LMeasure m = new LMeasure(measure.Elements, ls, timeSig.WholeNoteCapacity);
                        measures.Add(m);
                    }
                    ls = new LStaff(staff, measures);
                    this.staves.Add(ls);
                }
                player = new MidiTaskScorePlayer(data);
                updateView();
            }
            else
            {
                throw new FileNotFoundException(fileName + " not found.");  //This and any parser exceptions will be caught by the calling function
            }
        }
예제 #3
0
        /// <summary>
        /// Adds the note to the staff in the correct location
        /// </summary>
        /// <param name="nr">The note to add</param>
        private void addNoteOrRestToStaff(NoteOrRest nr)
        {
            // New for LStaff
            var        elem  = Viewer.SelectedElement;
            LStaff     staff = getLStaff(elem);
            NoteOrRest noteToPlay;

            if (isValidTarget(elem))
            {
                LMeasure measure = staff.getMeasure(elem);
                staff.AddAfter(elem, nr);
                if (measure.Contains(nr))
                {
                    Viewer.SelectedElement = nr;
                }
                else if (measure.Node.Next != null && measure.Node.Next.Value.Count > 0)
                {
                    Viewer.SelectedElement = measure.Node.Next.Value.First.Value;
                }
                noteToPlay = (NoteOrRest)Viewer.SelectedElement;
            }
            else
            {
                staff.Add(nr);
                noteToPlay = (NoteOrRest)staff.Last.Value.Last(e => e.GetType().IsSubclassOf(typeof(NoteOrRest)));
            }

            // Play the note
            if (noteToPlay.GetType() == typeof(Note))
            {
                model.PlayNote((Note)noteToPlay);
            }

            // Update the view model to make the Play command available
            model.updateView();
        }
예제 #4
0
        private void getData()
        {
            TPhieuCapphatNoitru objPhieuCapphat = TPhieuCapphatNoitru.FetchByID(Utility.Int32Dbnull(txtID_CAPPHAT.Text));

            if (objPhieuCapphat != null)
            {
                txtID_CAPPHAT.Text   = Utility.sDbnull(objPhieuCapphat.IdCapphat);
                dtNgayCapPhat.Value  = dtNgayCapPhat.Value;
                txtID_KHOA_LINH.Text = Utility.sDbnull(objPhieuCapphat.IdKhoaLinh);
                idKhoaLinh           = Utility.Int32Dbnull(objPhieuCapphat.IdKhoaLinh);
                DmucKhoaphong objLDepartment = DmucKhoaphong.FetchByID(objPhieuCapphat.IdKhoaLinh);
                if (objLDepartment != null)
                {
                    txtTen_KHOA_LINH.Text = Utility.sDbnull(objLDepartment.TenKhoaphong);
                }
                //chkIsBoSung.Checked = Convert.ToBoolean(objPhieuCapphat.LinhBSung);

                IsPhieuBoSung         = Utility.Byte2Bool(objPhieuCapphat.LoaiPhieu);
                radLinhBoSung.Checked = IsPhieuBoSung;
                loaiphieu             = Utility.sDbnull(objPhieuCapphat.LoaiPhieu);
                radThuoc.Checked      = loaiphieu == "THUOC";
                radLinhVTYT.Checked   = loaiphieu == "VT";
                txtID_NVIEN.Text      = Utility.sDbnull(objPhieuCapphat.IdNhanviencapphat);
                DmucNhanvien objStaff = DmucNhanvien.FetchByID(objPhieuCapphat.IdNhanviencapphat);
                if (objStaff != null)
                {
                    txtTen_NVIEN.Text = Utility.sDbnull(objStaff.TenNhanvien);
                }
                txtId_KhoXuat.Text = Utility.sDbnull(objPhieuCapphat.IdKhoXuat);
                id_khoXuat         = Utility.Int32Dbnull(objPhieuCapphat.IdKhoXuat);
                DKho objKho = DKho.FetchByID(objPhieuCapphat.IdKhoXuat);
                if (objKho != null)
                {
                    txtTenKho.Text = Utility.sDbnull(objKho.TenKho);
                }
                madoituong         = Utility.sDbnull(objPhieuCapphat.MaDoiTuong);
                txtMaDoiTuong.Text = Utility.sDbnull(madoituong);
                SqlQuery    sqlQuery   = new Select().From <LObjectType>().Where(LObjectType.Columns.ObjectTypeCode).IsEqualTo(madoituong);
                LObjectType objectType = sqlQuery.ExecuteSingle <LObjectType>();
                if (objectType != null)
                {
                    txtObjectType_Name.Text = Utility.sDbnull(objectType.ObjectTypeName);
                }
                txtMOTA_THEM.Text = Utility.sDbnull(objPhieuCapphat.MotaThem);
            }
            else
            {
                dtNgayCapPhat.Value  = BusinessHelper.GetSysDateTime();
                txtID_KHOA_LINH.Text = Utility.sDbnull(idKhoaLinh);
                LDepartment objLDepartment = LDepartment.FetchByID(idKhoaLinh);
                if (objLDepartment != null)
                {
                    txtTen_KHOA_LINH.Text = Utility.sDbnull(objLDepartment.DepartmentName);
                }
                txtID_NVIEN.Text = Utility.sDbnull(globalVariables.gv_StaffID);
                LStaff objStaff = LStaff.FetchByID(globalVariables.gv_StaffID);
                if (objStaff != null)
                {
                    txtTen_NVIEN.Text = Utility.sDbnull(objStaff.StaffName);
                }

                txtId_KhoXuat.Text = Utility.sDbnull(id_khoXuat);
                DKho objKho = DKho.FetchByID(id_khoXuat);
                if (objKho != null)
                {
                    txtTenKho.Text = Utility.sDbnull(objKho.TenKho);
                }
                //loaiphieu = Utility.sDbnull(objPhieuCapphat.LoaiPhieu);
                radThuoc.Checked      = loaiphieu == "THUOC";
                radLinhVTYT.Checked   = loaiphieu == "VT";
                radLinhBoSung.Checked = IsPhieuBoSung;
                // IsPhieuBoSung = Convert.ToBoolean(objPhieuCapphat.LinhBSung);
                txtMaDoiTuong.Text = Utility.sDbnull(madoituong);
                SqlQuery    sqlQuery   = new Select().From <LObjectType>().Where(LObjectType.Columns.ObjectTypeCode).IsEqualTo(madoituong);
                LObjectType objectType = sqlQuery.ExecuteSingle <LObjectType>();
                if (objectType != null)
                {
                    txtObjectType_Name.Text = Utility.sDbnull(objectType.ObjectTypeName);
                }
            }
            LoadPhieuDonThuoc();
        }
예제 #5
0
        private void getData()
        {
            TPhieuCapphatNoitru objPhieuCapphat = TPhieuCapphatNoitru.FetchByID(Utility.Int32Dbnull(txtID_CAPPHAT.Text));

            if (objPhieuCapphat != null)
            {
                txtID_CAPPHAT.Text = Utility.sDbnull(objPhieuCapphat.IdCapphat);
                if (!string.IsNullOrEmpty(Utility.sDbnull(objPhieuCapphat.NgayNhap)))
                {
                    dtNgayCapPhat.Value = Convert.ToDateTime(objPhieuCapphat.NgayNhap);
                }
                else
                {
                    dtNgayCapPhat.Value = DateTime.Now;
                }
                txtID_KHOA_LINH.Text = Utility.sDbnull(objPhieuCapphat.IdKhoaLinh);
                idKhoaLinh           = Utility.Int32Dbnull(objPhieuCapphat.IdKhoaLinh);
                DmucKhoaphong objLDepartment = DmucKhoaphong.FetchByID(objPhieuCapphat.IdKhoaLinh);
                if (objLDepartment != null)
                {
                    txtTen_KHOA_LINH.Text = Utility.sDbnull(objLDepartment.DepartmentName);
                }
                //chkIsBoSung.Checked = Convert.ToBoolean(objPhieuCapphat.LinhBSung);

                IsPhieuBoSung         = Convert.ToBoolean(objPhieuCapphat.loaiPhieu);
                radLinhBoSung.Checked = IsPhieuBoSung;
                loaiphieu             = Utility.sDbnull(objPhieuCapphat.LoaiPhieu);
                radThuoc.Checked      = loaiphieu == "THUOC";
                radLinhVTYT.Checked   = loaiphieu == "VT";
                txtID_NVIEN.Text      = Utility.sDbnull(objPhieuCapphat.idn);
                DmucNhanvien objStaff = DmucNhanvien.FetchByID(objPhieuCapphat.IdNvien);
                if (objStaff != null)
                {
                    txtTen_NVIEN.Text = Utility.sDbnull(objStaff.StaffName);
                }
                txtId_KhoXuat.Text = Utility.sDbnull(objPhieuCapphat.IdKhoXuat);
                id_khoXuat         = Utility.Int32Dbnull(objPhieuCapphat.IdKhoXuat);
                DKho objKho = DKho.FetchByID(objPhieuCapphat.IdKhoXuat);
                if (objKho != null)
                {
                    txtTenKho.Text = Utility.sDbnull(objKho.TenKho);
                }
                madoituong         = Utility.sDbnull(objPhieuCapphat.MaDoiTuong);
                txtMaDoiTuong.Text = Utility.sDbnull(madoituong);
                if (globalVariables.gv_TongHopDonThuocMaDoiTuong)
                {
                    SqlQuery sqlQuery =
                        new Select().From <LObjectType>().Where(LObjectType.Columns.ObjectTypeCode).IsEqualTo(madoituong);
                    var objectType = sqlQuery.ExecuteSingle <LObjectType>();
                    if (objectType != null)
                    {
                        txtObjectType_Name.Text = Utility.sDbnull(objectType.ObjectTypeName);
                    }
                }
                else
                {
                    txtObjectType_Name.Text = "Tất cả";
                }
                txtMOTA_THEM.Text = Utility.sDbnull(objPhieuCapphat.MotaThem);
                me_Action         = action.Update;
            }
            else
            {
                dtNgayCapPhat.Value  = globalVariables.SysDate;
                txtID_KHOA_LINH.Text = Utility.sDbnull(idKhoaLinh);
                LDepartment objLDepartment = LDepartment.FetchByID(idKhoaLinh);
                if (objLDepartment != null)
                {
                    txtTen_KHOA_LINH.Text = Utility.sDbnull(objLDepartment.DepartmentName);
                }
                txtID_NVIEN.Text = Utility.sDbnull(globalVariables.gv_StaffID);
                LStaff objStaff = LStaff.FetchByID(globalVariables.gv_StaffID);
                if (objStaff != null)
                {
                    txtTen_NVIEN.Text = Utility.sDbnull(objStaff.StaffName);
                }

                txtId_KhoXuat.Text = Utility.sDbnull(id_khoXuat);
                DKho objKho = DKho.FetchByID(id_khoXuat);
                if (objKho != null)
                {
                    txtTenKho.Text = Utility.sDbnull(objKho.TenKho);
                }
                //loaiphieu = Utility.sDbnull(objPhieuCapphat.LoaiPhieu);
                radThuoc.Checked      = loaiphieu == "THUOC";
                radLinhVTYT.Checked   = loaiphieu == "VT";
                radLinhBoSung.Checked = IsPhieuBoSung;
                // IsPhieuBoSung = Convert.ToBoolean(objPhieuCapphat.LinhBSung);
                txtMaDoiTuong.Text = Utility.sDbnull(madoituong);
                if (globalVariables.gv_TongHopDonThuocMaDoiTuong)
                {
                    SqlQuery sqlQuery =
                        new Select().From <LObjectType>().Where(LObjectType.Columns.ObjectTypeCode).IsEqualTo(madoituong);
                    var objectType = sqlQuery.ExecuteSingle <LObjectType>();
                    if (objectType != null)
                    {
                        txtObjectType_Name.Text = Utility.sDbnull(objectType.ObjectTypeName);
                    }
                }
                else
                {
                    txtObjectType_Name.Text = "Tất cả";
                }
            }
            LoadDonThuoc();
        }
예제 #6
0
        public void Insert(string StaffCode,string StaffName,short DepartmentId,int? ParentId,short StaffTypeId,short RankId,string Uid,byte? Status,string SDesc,decimal SpecMoney,byte? Actived,int? CanSign,string NguoiTao,DateTime? NgayTao,string NguoiSua,DateTime? NgaySua,byte? ChoPhepChuyenGoi,byte? ChoPhepDchinhTtoan,byte? ChoPhepHuyKhoat,byte? ChoPhepKhoat,byte? ChoPhepNvien,byte? ChoPhepNhapTheBhyt,byte? ChoPhepSuaDlieu,byte? ChoPhepChonBly,byte? ChoPhepDieuChinhBg,string MaQuyen,int? SoThuTu,byte? ChoMGiam)
        {
            LStaff item = new LStaff();

            item.StaffCode = StaffCode;

            item.StaffName = StaffName;

            item.DepartmentId = DepartmentId;

            item.ParentId = ParentId;

            item.StaffTypeId = StaffTypeId;

            item.RankId = RankId;

            item.Uid = Uid;

            item.Status = Status;

            item.SDesc = SDesc;

            item.SpecMoney = SpecMoney;

            item.Actived = Actived;

            item.CanSign = CanSign;

            item.NguoiTao = NguoiTao;

            item.NgayTao = NgayTao;

            item.NguoiSua = NguoiSua;

            item.NgaySua = NgaySua;

            item.ChoPhepChuyenGoi = ChoPhepChuyenGoi;

            item.ChoPhepDchinhTtoan = ChoPhepDchinhTtoan;

            item.ChoPhepHuyKhoat = ChoPhepHuyKhoat;

            item.ChoPhepKhoat = ChoPhepKhoat;

            item.ChoPhepNvien = ChoPhepNvien;

            item.ChoPhepNhapTheBhyt = ChoPhepNhapTheBhyt;

            item.ChoPhepSuaDlieu = ChoPhepSuaDlieu;

            item.ChoPhepChonBly = ChoPhepChonBly;

            item.ChoPhepDieuChinhBg = ChoPhepDieuChinhBg;

            item.MaQuyen = MaQuyen;

            item.SoThuTu = SoThuTu;

            item.ChoMGiam = ChoMGiam;

            item.Save(UserName);
        }
예제 #7
0
        private void cboRegExam_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                txtSoLanKham.Text = Utility.sDbnull(cboRegExam.SelectedValue, -1);
                TRegExam objRegExam = TRegExam.FetchByID(Utility.Int32Dbnull(txtSoLanKham.Text));
                if (objRegExam != null)
                {
                    DataTable m_dtThongTin =
                        SPs.LaokhoaLaythongtinBenhnhanNgoaitruLankham(ObjPatientExam.PatientCode,
                                                                      Utility.Int32Dbnull(ObjPatientExam.PatientId, -1),
                                                                      Utility.Int32Dbnull(txtSoLanKham.Text)).GetDataSet
                            ().Tables[0];
                    if (m_dtThongTin.Rows.Count > 0)
                    {
                        DataRow dr = m_dtThongTin.Rows[0];
                        if (dr != null)
                        {
                            dtInput_Date.Value = Convert.ToDateTime(dr[TPatientExam.Columns.InputDate]);

                            txtExam_ID.Text       = Utility.sDbnull(objRegExam.RegId);
                            dtpCreatedDate.Value  = Convert.ToDateTime(objRegExam.RegDate);
                            txtDepartment_ID.Text = Utility.sDbnull(objRegExam.DepartmentId);
                            LDepartment objDepartment = LDepartment.FetchByID(Utility.Int32Dbnull(txtDepartment_ID.Text));
                            if (objDepartment != null)
                            {
                                txtDepartment_Name.Text = Utility.sDbnull(objDepartment.DepartmentName);
                            }
                            txtTenKham.Text = Utility.sDbnull(objRegExam.KieuKhambenh);
                            if (objRegExam.UserId == "ADMIN")
                            {
                                txtNguoiTiepNhan.Text = objRegExam.UserId;
                            }
                            else
                            {
                                LStaff lStaff = BusinessHelper.GetStaffByUserName(objRegExam.UserId);
                                if (lStaff != null)
                                {
                                    txtNguoiTiepNhan.Text = Utility.sDbnull(lStaff.StaffName);
                                }
                                else
                                {
                                    txtNguoiTiepNhan.Text = objRegExam.UserId;
                                }
                            }
                            if (Utility.Int32Dbnull(objRegExam.IdBsyThien, -1) <= 0)
                            {
                                cboDoctorAssign.SelectedValue = Utility.Int32Dbnull(objRegExam.IdBsyThien, -1);
                            }
                            else
                            {
                                cboDoctorAssign.SelectedIndex = 0;
                            }
                            //TExamInfo objExam = TExamInfo.FetchByID(Utility.Int32Dbnull(txtExam_ID.Text));
                            //if (objExam != null)
                            //{
                            //    txtKet_Luan.Text = Utility.sDbnull(objExam.KetLuan);
                            //    txtHuongdieutri.Text = objExam.HuongDieuTri;
                            //    nmrSongayDT.Value = Utility.DecimaltoDbnull(objExam.SoNgay, 0);
                            //    var objDiagInfo = new Select().From(TDiagInfo.Schema)
                            //        .Where(TDiagInfo.Columns.ExamId).IsEqualTo(objExam.ExamId).ExecuteSingle<TDiagInfo>();
                            //    if (objDiagInfo != null)
                            //    {
                            //        txtChanDoan.Text = Utility.sDbnull(objDiagInfo.DiagInfo);
                            //        txtMaBenhChinh.Text = Utility.sDbnull(objDiagInfo.MainDiseaseId);
                            //        string dataString = Utility.sDbnull(objDiagInfo.AuxiDiseaseId, "");
                            //        if (!string.IsNullOrEmpty(dataString))
                            //        {
                            //            dt_ICD_PHU.Clear();
                            //            string[] rows = dataString.Split(',');
                            //            foreach (string row in rows)
                            //            {
                            //                if (!string.IsNullOrEmpty(row))
                            //                {
                            //                    DataRow newDr = dt_ICD_PHU.NewRow();
                            //                    newDr["MA_ICD"] = row;
                            //                    newDr["TEN_ICD"] = GetTenBenh(row);
                            //                    dt_ICD_PHU.Rows.Add(newDr);
                            //                    dt_ICD_PHU.AcceptChanges();
                            //                }
                            //            }
                            //            grd_ICD.DataSource = dt_ICD_PHU;
                            //        }
                            //        else
                            //        {
                            //            dt_ICD_PHU.Clear();
                            //        }
                            //    }
                            //}
                            GetDataChiDinh();
                        }
                    }
                }
            }
            catch (Exception)
            {
                Utility.ShowMsg("Có lỗi trong quá trình lấy thông tin khám chữa bệnh");
            }
        }