private void buttonAdd_Click(object sender, EventArgs e)
        {
            Workshop ws = new Workshop();

            int OrgID = -1;

            if (Account.AccountType == 2)
            {
                OrgEmployee emp = new OrgEmployee();
                OrgID = emp.GetOrgIdByEmpId(Account.AccountId);
            }
            else if (Account.AccountType == 1)
            {
                OrgID = Account.AccountId;
            }


            ws.AddWorkshop(
                textBoxTitle.Text,
                dateTimePickerDate.Value,
                textBoxDuration.Text,
                textBoxPresenter.Text,
                int.Parse(numericUpDownSeats.Text),
                textBoxLocation.Text,
                richTextBoxDesc.Text,
                OrgID);

            MessageBox.Show("Data Inserted successfully.");
            ClearControls();
        }
Example #2
0
 private void LoadData()
 {
     if (Account.AccountType == 2)
     {
         int       OrgID = emp.GetOrgIdByEmpId(Account.AccountId);
         DataTable data  = workshop.GetAllOrgWorkshops(OrgID);
         if (data.Rows.Count != 0)
         {
             dgvWorkshop.DataSource = data;
         }
     }
     else if (Account.AccountType == 1)
     {
         DataTable data = workshop.GetAllOrgWorkshops(Account.AccountId);
         if (data.Rows.Count != 0)
         {
             dgvWorkshop.DataSource = data;
         }
     }
 }
Example #3
0
        private void ViewAudience_Load(object sender, EventArgs e)
        {
            Audience aud   = new Audience();
            String   Query = "";


            int OrgID = -1;

            if (Account.AccountType == 2)
            {
                OrgEmployee emp = new OrgEmployee();
                OrgID = emp.GetOrgIdByEmpId(Account.AccountId);
            }
            else if (Account.AccountType == 1)
            {
                OrgID = Account.AccountId;
            }


            switch (Account.AccountType)
            {
            case 1:
                Query = "Select DISTINCT Audience.ID,FName,LName,Email,Phone from Audience " +
                        "join Registration on Registration.AudienceID = Audience.ID " +
                        "where Registration.OrganaizerID=" + OrgID;
                break;

            case 2:
                Query = "Select DISTINCT  Audience.ID,FName,LName,Email,Phone from Audience " +
                        "join Registration on Registration.AudienceID = Audience.ID " +
                        "where Registration.OrganaizerID=" + OrgID;
                break;

            case 3:
                Query = "Select * from Audience";
                break;
            }

            DataTable data = aud.GetAllAudience(Query);

            if (data.Rows.Count != 0)
            {
                dataGridView1.DataSource = data;
            }
        }
Example #4
0
        private void Load_workshopTitle(object sender, EventArgs e)
        {
            if (Account.AccountType == 2)
            {
                OrgEmployee emp = new OrgEmployee();
                OrgID = emp.GetOrgIdByEmpId(Account.AccountId);
            }
            else if (Account.AccountType == 1)
            {
                OrgID = Account.AccountId;
            }

            Workshop workshop = new Workshop();

            Table = workshop.GetWorkshopTitle(OrgID);
            foreach (DataRow row in Table.Rows)
            {
                TitleList.Items.Add(row["Title"]);
            }
        }
        private void ViewWorkshop_Load(object sender, EventArgs e)
        {
            Workshop ws    = new Workshop();
            String   Query = "";

            int OrgID = -1;

            if (Account.AccountType == 2)
            {
                OrgEmployee emp = new OrgEmployee();
                OrgID = emp.GetOrgIdByEmpId(Account.AccountId);
            }
            else if (Account.AccountType == 1)
            {
                OrgID = Account.AccountId;
            }


            switch (Account.AccountType)
            {
            case 1:
            case 2:
                Query = "Select * from  Workshop where OrgID=" + OrgID;
                break;

            case 3:
                Query = "Select * from Workshop";
                break;
            }



            DataTable data = ws.GetAllWorkshop(Query);

            if (data.Rows.Count != 0)
            {
                dataGridView1.DataSource = data;
            }
        }