示例#1
0
        void b_Click(object sender, EventArgs e)
        {
            DeleteButton b = (DeleteButton)sender;

            b.ExecuteDeletion();
            LoadEntries();
        }
示例#2
0
        void b2_Click(object sender, EventArgs e)
        {
            DeleteButton casted = (DeleteButton)sender;

            casted.ExecuteDeletion();
            LoadEntriesSurveys();
        }
示例#3
0
        public void LoadEntriesSessions()
        {
            SessionsTable.Controls.Clear();
            _sessions = DbConnector.GetInstance().GetSessions(_card.id);
            SessionsTable.RowCount = _sessions.Count;
            SessionsTable.Update();
            for (int i = 0; i < _sessions.Count; i++)
            {
                Label lb = new Label(); lb.AutoSize = true; lb.Font = new Font("Calibri", 12); lb.Size = new Size(150, lb.Height);
                lb.Text = _sessions[i].ProcedureName; lb.Show();

                DateTimePicker lb1 = new DateTimePicker(); lb1.Size = new Size(120, lb1.Height);
                lb1.Text = _sessions[i].DateTime; lb1.Show();

                Label        lb2 = new Label(); lb2.Font = new Font("Calibri", 12); lb2.Text = _sessions[i].EmployeeName; lb2.Show();
                Label        lb3 = new Label(); lb3.Font = new Font("Calibri", 12); lb3.Text = _sessions[i].Cost.ToString(); lb2.Show();
                DeleteButton sb  = new DeleteButton(_sessions[i].id, "session");
                sb.Click += sb_Click;
                this.SessionsTable.Controls.Add(lb, 0, i);
                this.SessionsTable.Controls.Add(lb1, 1, i);
                this.SessionsTable.Controls.Add(lb2, 2, i);
                this.SessionsTable.Controls.Add(lb3, 3, i);
                this.SessionsTable.Controls.Add(sb, 4, i);
            }
        }
示例#4
0
 public void LoadEntriesTests()
 {
     CuredLabel.Text = _card.IsCured ? "Cured" : "Not cured";
     TestsTable.Controls.Clear();
     _tests = DbConnector.GetInstance().GetTests(_card.id);
     TestsTable.RowCount = _tests.Count;
     TestsTable.Update();
     for (int i = 0; i < _tests.Count; i++)
     {
         DateTimePicker lb1 = new DateTimePicker(); lb1.Size = new Size(120, lb1.Height);
         lb1.Text = _tests[i].DateTime; lb1.Show();
         TextBox lb2 = new TextBox(); lb2.Font = new Font("Calibri", 12);
         lb2.Size = new Size(300, lb2.Height);
         lb2.Text = _tests[i].Result; lb2.Show();
         ComboBox cb = new ComboBox(); cb.BeginUpdate(); _tt.ForEach(x => cb.Items.Add(x.Name)); cb.EndUpdate();
         cb.Text = _tests[i].Type;
         Label lb3 = new Label(); lb3.Font = new Font("Calibri", 12);
         lb3.Text = _tt.Find(x => x.Name == _tests[i].Type).Cost.ToString(); lb3.Show();
         DeleteButton b = new DeleteButton(_tests[i].id, "test");
         b.Click += b_Click;
         this.TestsTable.Controls.Add(cb, 0, i);
         this.TestsTable.Controls.Add(lb1, 1, i);
         this.TestsTable.Controls.Add(lb2, 2, i);
         this.TestsTable.Controls.Add(lb3, 3, i);
         this.TestsTable.Controls.Add(b, 4, i);
     }
 }
示例#5
0
        public void LoadEntries()
        {
            CardTable.Controls.Clear();
            this.TopLabel.Text    = "Profile of " + _profileName;
            _profile              = DbConnector.GetInstance().GetPatientProfile(_profileName);
            this.NameBox.Text     = _profile.Name;
            this.AddressBox.Text  = _profile.Address;
            this.AgeBox.Text      = _profile.Age.ToString();
            this.PhoneBox.Text    = _profile.PhoneNumber;
            this.SessionsBox.Text = _profile.SessionsTaken.ToString();

            cards = DbConnector.GetInstance().GetCards(_profile.id);
            CardTable.RowCount = cards.Count;
            for (int i = 0; i < cards.Count; i++)
            {
                LinkLabel lb = new LinkLabel(); lb.AutoSize = true;
                lb.Font = new Font("Calibri", 12); lb.Text = cards[i].Name; lb.Show();
                Label lb1 = new Label(); lb1.Font = new Font("Calibri", 12);
                lb1.Text = cards[i].YearsSuffered.ToString(); lb1.Show();
                Label lb2 = new Label(); lb2.Font = new Font("Calibri", 12);
                lb2.Text = cards[i].Doctor; lb2.Show();
                Label lb3 = new Label(); lb3.Font = new Font("Calibri", 12);
                lb3.Text = cards[i].Type; lb3.Show();
                DeleteButton b = new DeleteButton(cards[i].id, "medical_card"); b.Click += b_Click;
                lb.Click += lb_Click;
                this.CardTable.Controls.Add(lb, 0, i);
                this.CardTable.Controls.Add(lb1, 1, i);
                this.CardTable.Controls.Add(lb2, 2, i);
                this.CardTable.Controls.Add(lb3, 3, i);
                this.CardTable.Controls.Add(b, 4, i);
            }
        }
示例#6
0
 public void LoadEntriesDisease()
 {
     dis = DbConnector.GetInstance().GetDiseaseTypes();
     DiseaseTable.Controls.Clear();
     DiseaseTable.RowCount = dis.Count;
     DiseaseTable.Update();
     for (int i = 0; i < dis.Count; i++)
     {
         TextBox      lb = new TextBox(); lb.Font = new Font("Calibri", 12); lb.Text = dis[i].Name; lb.Show();
         DeleteButton b3 = new DeleteButton(dis[i].id, "diseasetype");
         b3.Click += b3_Click;
         this.DiseaseTable.Controls.Add(lb, 0, i);
         this.DiseaseTable.Controls.Add(b3, 1, i);
     }
 }
示例#7
0
 public void LoadEntriesTests()
 {
     TestsTable.Controls.Clear();
     tests = DbConnector.GetInstance().GetTestTypes();
     TestsTable.RowCount = tests.Count;
     TestsTable.Update();
     for (int i = 0; i < tests.Count; i++)
     {
         TextBox      lb  = new TextBox(); lb.Font = new Font("Calibri", 12); lb.Text = tests[i].Name; lb.Show();
         TextBox      lb1 = new TextBox(); lb1.Font = new Font("Calibri", 12); lb1.Text = tests[i].Cost.ToString(); lb1.Show();
         DeleteButton b1  = new DeleteButton(tests[i].id, "testtype");
         b1.Click += b1_Click;
         this.TestsTable.Controls.Add(lb, 0, i);
         this.TestsTable.Controls.Add(lb1, 1, i);
         this.TestsTable.Controls.Add(b1, 2, i);
     }
 }
示例#8
0
 public void LoadEntriesSurveys()
 {
     SurveyTable.Controls.Clear();
     survs = DbConnector.GetInstance().GetSurveyTypes();
     SurveyTable.RowCount = survs.Count;
     SurveyTable.Update();
     for (int i = 0; i < survs.Count; i++)
     {
         TextBox      lb  = new TextBox(); lb.Font = new Font("Calibri", 12); lb.Text = survs[i].Name; lb.Show();
         TextBox      lb1 = new TextBox(); lb1.Font = new Font("Calibri", 12); lb1.Text = survs[i].Cost.ToString(); lb1.Show();
         DeleteButton b2  = new DeleteButton(survs[i].id, "surveytype");
         b2.Click += b2_Click;
         this.SurveyTable.Controls.Add(lb, 0, i);
         this.SurveyTable.Controls.Add(lb1, 1, i);
         this.SurveyTable.Controls.Add(b2, 2, i);
     }
 }
示例#9
0
 public void LoadEntries()
 {
     this.ProceduresTable.Controls.Clear();
     procs = DbConnector.GetInstance().GetProceduresList();
     this.ProceduresTable.RowCount = procs.Count;
     this.ProceduresTable.Update();
     for (int i = 0; i < procs.Count; i++)
     {
         TextBox      lb  = new TextBox(); lb.Font = new Font("Calibri", 12); lb.Text = procs[i].Name; lb.Show();
         TextBox      lb1 = new TextBox(); lb1.Font = new Font("Calibri", 12); lb1.Text = procs[i].Duration.ToString(); lb1.Show();
         TextBox      lb2 = new TextBox(); lb2.Font = new Font("Calibri", 12); lb2.Text = procs[i].Cost.ToString(); lb2.Show();
         DeleteButton b   = new DeleteButton(procs[i].id, "proc");
         b.Click += b_Click;
         this.ProceduresTable.Controls.Add(lb, 0, i);
         this.ProceduresTable.Controls.Add(lb1, 1, i);
         this.ProceduresTable.Controls.Add(lb2, 2, i);
         this.ProceduresTable.Controls.Add(b, 3, i);
     }
 }
示例#10
0
        public void LoadEntries()
        {
            this.tableLayoutPanel1.Controls.Clear();
            DbConnector          db        = DbConnector.GetInstance();
            List <EmployeeModel> staffList = new List <EmployeeModel>();

            staffList = db.GetStaffList();
            this.tableLayoutPanel1.AutoSize = true;
            this.tableLayoutPanel1.RowCount = staffList.Count;
            this.tableLayoutPanel1.Update();
            for (int i = 0; i < staffList.Count; i++)
            {
                LinkLabel    lb  = new LinkLabel(); lb.Font = new Font("Calibri", 12);  lb.Text = staffList[i].Name; lb.Show();
                Label        lb1 = new Label(); lb1.Font = new Font("Calibri", 12); lb1.Text = staffList[i].Specialty; lb1.Show();
                DeleteButton b   = new DeleteButton(staffList[i].id, "employee"); b.Show();
                lb.Click += lb_Click;
                b.Click  += b_Click;
                this.tableLayoutPanel1.Controls.Add(lb, 0, i);
                this.tableLayoutPanel1.Controls.Add(lb1, 1, i);
                this.tableLayoutPanel1.Controls.Add(b, 2, i);
            }
        }
示例#11
0
        public void LoadEntries()
        {
            this.tableLayoutPanel1.Controls.Clear();
            List <PatientModel> patients = DbConnector.GetInstance().GetPatientList();

            this.tableLayoutPanel1.RowCount = patients.Count;
            this.tableLayoutPanel1.Update();
            for (int i = 0; i < patients.Count; i++)
            {
                LinkLabel lb = new LinkLabel(); lb.AutoSize = true;
                lb.Font   = new Font("Calibri", 12); lb.Text = patients[i].Name; lb.Show();
                lb.Click += lb_Click;
                Label lb1 = new Label(); lb1.Text = patients[i].Age.ToString(); lb1.Font = new Font("Calibri", 12); lb1.Show();
                Label lb2 = new Label(); lb2.AutoSize = true;
                lb2.Text = patients[i].Address; lb2.Font = new Font("Calibri", 12); lb2.Show();
                DeleteButton b = new DeleteButton(patients[i].id, "patient"); b.Click += b_Click;
                this.tableLayoutPanel1.Controls.Add(lb, 0, i);
                this.tableLayoutPanel1.Controls.Add(lb1, 1, i);
                this.tableLayoutPanel1.Controls.Add(lb2, 2, i);
                this.tableLayoutPanel1.Controls.Add(b, 3, i);
            }
        }
示例#12
0
        public void LoadEntriesSurveys()
        {
            SurveysTable.Controls.Clear();
            _surveys = DbConnector.GetInstance().GetSurveys(_card.id);
            SurveysTable.RowCount = _tests.Count;
            SurveysTable.Update();
            for (int i = 0; i < _surveys.Count; i++)
            {
                ComboBox n = new ComboBox(); n.Font = new Font("Calibri", 12);
                n.BeginUpdate();
                _st.ForEach(x => n.Items.Add(x.Name));
                n.EndUpdate(); n.Text = _surveys[i].Type;

                DateTimePicker lb1 = new DateTimePicker(); lb1.Size = new Size(120, lb1.Height);
                lb1.Text = _surveys[i].DateTime; lb1.Show();

                TextBox lb2 = new TextBox(); lb2.Font = new Font("Calibri", 12);
                lb2.Text = _surveys[i].Result; lb2.Show();

                ComboBox cb = new ComboBox(); cb.Font = new Font("Calibri", 12);
                cb.BeginUpdate();
                _employees.ForEach(x => cb.Items.Add(x.Name));
                cb.EndUpdate(); cb.Text = _surveys[i].EmployeeName;

                Label lb3 = new Label(); lb3.Font = new Font("Calibri", 12);
                lb3.Text = _st.Find(x => x.Name == _surveys[i].Type).Cost.ToString(); lb3.Show();

                DeleteButton vb = new DeleteButton(_surveys[i].id, "survey");
                vb.Click += vb_Click;
                this.SurveysTable.Controls.Add(n, 0, i);
                this.SurveysTable.Controls.Add(lb1, 1, i);
                this.SurveysTable.Controls.Add(lb2, 2, i);
                this.SurveysTable.Controls.Add(cb, 3, i);
                this.SurveysTable.Controls.Add(lb3, 4, i);
                this.SurveysTable.Controls.Add(vb, 5, i);
            }
        }