コード例 #1
0
        private void UpdateBtn_Click(object sender, EventArgs e)
        {
            int       Id     = Account.AccountId;
            Organizer org    = new Organizer();
            int       result = org.UpdateOrganizer(Id, NameTextBox.Text, PhonetextBox.Text, EmailtextBox.Text, PasswordtextBox.Text);

            if (result != 0)
            {
                MessageBox.Show("Data Updated Successfully.");
                MyProfile_Click();
            }
        }
コード例 #2
0
        private void buttonAddOrg_Click(object sender, EventArgs e)
        {
            Organizer org = new Organizer();

            org.AddOrganizer(textBoxName.Text, textBoxPhone.Text, textBoxEmail.Text,
                             textBoxPassword.Text);
            MessageBox.Show("Data Inserted successfully.");
            textBoxName.Text     = "";
            textBoxPhone.Text    = "";
            textBoxEmail.Text    = "";
            textBoxPassword.Text = "";
        }
コード例 #3
0
        private GroupBox GetGroupBox(DataRow row, int width, int height, bool flag)
        {
            int       OrgID = (int)row["OrgID"];
            Organizer org   = new Organizer();


            DataTable OrgTb   = org.GetOrganizerById(OrgID);
            String    OrgName = OrgTb.Rows[0]["OrgName"].ToString();


            GroupBox g = new GroupBox();

            g.Size     = new Size(width, height);
            g.Text     = row["Title"].ToString();
            g.AutoSize = true;


            Label Orgnaizer = new Label();

            Orgnaizer.Text     = "Provided by: " + OrgName;
            Orgnaizer.AutoSize = true;
            Orgnaizer.Location = new Point(5, 40);

            Label Presenter = new Label();

            Presenter.Text     = "Presenter name: " + row["Presenter"].ToString();
            Presenter.AutoSize = true;
            Presenter.Location = new Point(5, 60);


            Label Date = new Label();

            Date.Text     = "Date: " + row["WDate"].ToString();
            Date.AutoSize = true;
            Date.Location = new Point(5, 80);


            Label Duration = new Label();

            Duration.Text     = "Duration: " + row["Duration"].ToString();
            Duration.AutoSize = true;
            Duration.Location = new Point(5, 100);


            Label Location = new Label();

            Location.Text     = "Location: " + row["WLocation"].ToString();
            Location.AutoSize = true;
            Location.Location = new Point(5, 120);



            Label DescriptionLable = new Label();

            DescriptionLable.Text     = "Description: ";
            DescriptionLable.AutoSize = true;
            DescriptionLable.Location = new Point(5, 140);


            Label Description = new Label();

            Description.Text        = row["WDescription"].ToString();
            Description.AutoSize    = true;
            Description.TextAlign   = ContentAlignment.MiddleLeft;
            Description.MaximumSize = new Size(500, 0);
            Description.Location    = new Point(100, 140);

            Button EnrollBtn = new Button();

            EnrollBtn.Location = new Point(710, 0);
            EnrollBtn.Size     = new Size(80, 40);


            if (workshop.Check_reg(Account.AccountId, (int)row["ID"]).Rows.Count == 0 && flag == false)
            {
                EnrollBtn.Text = "Enroll";
                // you can add an event here...
                EnrollBtn.Click += (s, e) => EnrollBtnEvent(s, "Enroll", (int)row["ID"], (int)row["OrgID"]);
            }
            else
            {
                EnrollBtn.Text = "Unenroll";
                // you can add an event here...
                EnrollBtn.Click += (s, e) => UnEnrollBtnEvent(s, "Unenroll", (int)row["ID"], (int)row["OrgID"]);
            }

            g.Controls.Add(Orgnaizer);
            g.Controls.Add(Presenter);
            g.Controls.Add(Date);
            g.Controls.Add(Duration);
            g.Controls.Add(Location);
            g.Controls.Add(DescriptionLable);
            g.Controls.Add(Description);
            g.Controls.Add(EnrollBtn);
            return(g);
        }