コード例 #1
0
        public void Delete(Receptionist obj)
        {
            int count = 0;
            var q     = from a in patDL.Read()
                        where (a.ReceptionistId == obj.Id)
                        select new { a.Id };

            foreach (var item in q.ToList())
            {
                count++;
            }

            int count2 = 0;
            var q2     = from a in bilDL.Read()
                         where (a.ReceptionistId == obj.Id)
                         select new { a.Id };

            foreach (var item in q2.ToList())
            {
                count2++;
            }

            if (count > 0 || count2 > 0)
            {
                throw new Exception("این پذیرش دارای سوابق است و نمی‌توانید آن را حذف کنید");
            }
            else
            {
                DL.Delete(obj);
            }
        }
コード例 #2
0
        public void Delete(Patient obj)
        {
            int count = 0;
            var q     = from a in BilDL.Read()
                        where (a.PatientId == obj.Id)
                        select new { a.Id };

            foreach (var item in q.ToList())
            {
                count++;
            }

            if (count > 0)
            {
                throw new Exception("این بیمار دارای قبض پرداخت نشده است و نمی‌تواند ترخیص شود");
            }
            else
            {
                DL.Delete(obj);
            }
        }
コード例 #3
0
 public List <Bill> Read()
 {
     return(DL.Read());
 }