예제 #1
0
        public ReaderVO(string BAR)
        {
            var dbr = new DBReader();
            DataRow reader = dbr.GetReaderByBAR(BAR);
            if (reader == null) return;
            this.ID = (int)reader["NumberReader"];
            this.Family = reader["FamilyName"].ToString();
            this.Father = reader["FatherName"].ToString();
            this.Name = reader["Name"].ToString();
            this.FIO = this.Family + " " + this.Name + " " + this.Father;
            if (reader["fotka"].GetType() != typeof(System.DBNull))
            {
                object o = reader["fotka"];
                byte[] data = (byte[])reader["fotka"];

                if (data != null)
                {
                    using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
                    {
                        ms.Write(data, 0, data.Length);
                        ms.Position = 0L;

                        this.Photo = new Bitmap(ms);
                    }
                }
            }
            else
            {
                this.Photo = Properties.Resources.nofoto;
            }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            //dataGridView1.Rows.Clear();

            if (this.textBox1.Text == "")
            {
                MessageBox.Show("Введите фамилию читателя!", "Внимание!", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            DBReader dbr = new DBReader();

            //DataSet DS = new DataSet();

            DataTable t = dbr.GetReaderByFamily(textBox1.Text);
            if (t.Rows.Count == 0)
            {
                MessageBox.Show("Читатель не найден!", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            dataGridView1.DataSource = t;
            dataGridView1.Columns[0].HeaderText = "Номер читателя";
            dataGridView1.Columns[1].HeaderText = "Фамилия";
            dataGridView1.Columns[2].HeaderText = "Имя";
            dataGridView1.Columns[3].HeaderText = "Отчество";
            dataGridView1.Columns[4].HeaderText = "Дата рождения";
            dataGridView1.Columns[5].HeaderText = "Город";
            dataGridView1.Columns[6].HeaderText = "Улица";
            dataGridView1.Columns[7].HeaderText = "Email";
            dataGridView1.Columns[6].Width = 200;
            dataGridView1.Columns[7].Width = 200;
        }
예제 #3
0
        private void InitReaderRights()
        {
            var       dbr    = new DBReader();
            DataTable rights = dbr.GetReaderRightsById(this.ID);

            if (rights.Rows.Count != 0)
            {
                foreach (DataRow r in rights.Rows)
                {
                    switch (r["IDReaderRight"].ToString())
                    {
                    case "1":
                        this.ReaderRights |= Rights.BRIT;
                        break;

                    case "2":
                        this.ReaderRights |= Rights.HALL;
                        break;

                    case "3":
                        this.ReaderRights |= Rights.EMPL;
                        this.IDDepartment  = r["IDOrganization"].ToString();
                        break;

                    case "4":
                        this.ReaderRights |= Rights.ABON;
                        break;

                    case "5":
                        this.ReaderRights |= Rights.PERS;
                        break;

                    case "6":
                        this.ReaderRights |= Rights.COLL;
                        break;

                    default:
                        this.ReaderRights |= Rights.HALL;
                        break;
                    }
                }
            }
        }
예제 #4
0
        public ReaderVO(string BAR)
        {
            this.BAR = BAR;
            if (BAR[0] == 'G')
            {
                return;
            }
            var     dbr    = new DBReader();
            DataRow reader = dbr.GetReaderByBAR(BAR);

            if (reader == null)
            {
                return;
            }
            this.ID     = (int)reader["NumberReader"];
            this.Family = reader["FamilyName"].ToString();
            this.Father = reader["FatherName"].ToString();
            this.Name   = reader["Name"].ToString();
            this.FIO    = this.Family + " " + this.Name + " " + this.Father;
            if (reader["fotka"].GetType() != typeof(System.DBNull))
            {
                object o    = reader["fotka"];
                byte[] data = (byte[])reader["fotka"];

                if (data != null)
                {
                    using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
                    {
                        ms.Write(data, 0, data.Length);
                        ms.Position = 0L;

                        this.Photo = new Bitmap(ms);
                    }
                }
            }
            else
            {
                this.Photo = Properties.Resources.nofoto;
            }
            InitReaderRights();
        }
예제 #5
0
        public bool IsAlreadyMarked()
        {
            DBReader dbr = new DBReader();

            return(dbr.IsAlreadyMarked(this.BAR));


            //кароче тут такая фигня неоднозначная:
            //Если читатель забыл билет, то ему выдают временный с буквой G, который привязан к реальному. При этом в таблице Input поле TapeInput = 3.
            //и типа надо проверять, что за читатель на самом деле. Но сейчас ему выдают не временный, а ещё один реальный. Полноценный, но с другим штрихкодом
            //поэтому можно забить на такую проверку. Всё равно нужно только количество. А когда правила изменятся, тогда и будем думать
            //в основном фонде это типа реализовано, хотя и как-то подозрительно.

            //string idgcurrent = this.GetRealIDByGuestBar(bar);
            //foreach (DataRow r in DS.Tables["t"].Rows)
            //{
            //    if (idgcurrent == r["BAR"].ToString())
            //    {
            //        return true;
            //    }
            //}
            //return false;
        }
예제 #6
0
 internal void Prolong(int idiss, int days,int idemp)
 {
     DBReader dbr = new DBReader();
     dbr.ProlongByIDISS(idiss,days,idemp);
 }
예제 #7
0
        internal void ChangeComment(string comment)
        {
            DBReader dbr = new DBReader();

            dbr.ChangeComment(this.ID, comment);
        }
예제 #8
0
        internal string GetComment()
        {
            DBReader dbr = new DBReader();

            return(dbr.GetComment(this.ID));
        }
예제 #9
0
        internal string GetRealIDByGuestBar(string bar)
        {
            DBReader dbr = new DBReader();

            return(dbr.GetRealIDByGuestBar(bar));
        }
예제 #10
0
파일: ReaderVO.cs 프로젝트: infra-hdc/LIBFL
        public string GetEmail()
        {
            DBReader dbr = new DBReader();

            return(dbr.GetEmail(this));
        }
예제 #11
0
        public DataTable GetFormular()
        {
            DBReader dbr = new DBReader();

            return(dbr.GetFormular(this.ID));
        }
예제 #12
0
        public bool IsAlreadyIssuedMoreThanFourBooks()
        {
            DBReader dbr = new DBReader();

            return(dbr.IsAlreadyIssuedMoreThanFourBooks(this));
        }
예제 #13
0
 public DataTable GetFormular()
 {
     DBReader dbr = new DBReader();
     return dbr.GetFormular(this.ID);
 }
예제 #14
0
 internal string GetLastDateEmail()
 {
     DBReader dbr = new DBReader();
     return dbr.GetLastDateEmail(this);
 }
예제 #15
0
 public bool IsAlreadyIssuedMoreThanFourBooks()
 {
     DBReader dbr = new DBReader();
     return dbr.IsAlreadyIssuedMoreThanFourBooks(this);
 }
예제 #16
0
        public void Prolong(int idiss, int days, int idemp)
        {
            DBReader dbr = new DBReader();

            dbr.ProlongByIDISS(idiss, days, idemp);
        }
예제 #17
0
 private void button2_Click_1(object sender, EventArgs e)
 {
     DBReader dbr = new DBReader();
     byte[] fotka = File.ReadAllBytes("f://41_1.jpg");
     dbr.AddPhoto(fotka);
 }
예제 #18
0
        internal string GetLastDateEmail()
        {
            DBReader dbr = new DBReader();

            return(dbr.GetLastDateEmail(this));
        }