Esempio n. 1
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            List <StudentListPrint> items = new List <StudentListPrint>();

            //University university = universityBLO.GetByIndex(i);
            for (int i = 0; i < dataGridView1.Rows.Count; i++)
            {
                University university = universityBLO.GetUniversity();
                Student    s          = dataGridView1.Rows[i].DataBoundItem as Student;
                items.Add
                (
                    new StudentListPrint
                    (
                        university?.Name,
                        s.FirstName,
                        s.LastName,
                        s.BornOn,
                        s.BornAt,
                        s.Photo,
                        s.Sexe,
                        s.EmailS,
                        university?.Email,
                        university?.Tel.ToString(),
                        s.TelS,
                        !string.IsNullOrEmpty(university?.Logo) ? File.ReadAllBytes(university?.Logo) : null,
                        s.QrCode

                    )
                );
            }
            Form f = new StudentList("StudentsCard.rdlc", items);

            f.Show();
        }
Esempio n. 2
0
        //public FrmUniversity(University university, Action callback) : this(callback)
        //{
        //    this.olduniversity = university;
        //    txtName.Text = university.Name;
        //    txtTel.Text = university.Tel.ToString();
        //    pictureBox1.Image = university.Logo != null ? Image.FromStream(new MemoryStream(university.Logo.)) : null;
        //    txtEmail.Text = university.Email;

        //}



        private void loadData(UniversityBLO universityBLO)
        {
            //string value = txtSearch.Text;
            //var universities = universityBLO.GetBy(
            //    x =>
            //    x.Name.ToLower().Contains(value) ||
            //    x.Tel.ToString().Contains(value)
            //    ).OrderBy(x => x.Name).ToArray();
            dataGridView1.DataSource = null;
            dataGridView1.DataSource = universityBLO.GetUniversity();
            dataGridView1.ClearSelection();
        }
Esempio n. 3
0
 public FrmUniversity()
 {
     InitializeComponent();
     dataGridView1.AutoGenerateColumns = false;
     universityBLO = new UniversityBLO(ConfigurationManager.AppSettings["DbFolder"]);
     olduniversity = universityBLO.GetUniversity();
     if (olduniversity != null)
     {
         txtName.Text = olduniversity.Name;
         txtTel.Text  = olduniversity.Tel.ToString();
         pictureBox1.ImageLocation = olduniversity.Logo;
         txtEmail.Text             = olduniversity.Email;
     }
 }