Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        private void LoadData()
        {
            OrgEmployee emp   = new OrgEmployee();
            int         OrgID = Account.AccountId;

            DataTable data = emp.GetAllEmpInOrg(OrgID);

            if (data.Rows.Count != 0)
            {
                dataGridView1.DataSource = data;
            }
        }
Exemplo n.º 3
0
        private void UpdateBtn_Click(object sender, EventArgs e)
        {
            int         Id     = Account.AccountId;
            OrgEmployee emp    = new OrgEmployee();
            int         result = emp.UpdateEmpinfo(Id, FNametextBox.Text, LNametextBox.Text, PhonetextBox.Text, EmailtextBox.Text, PasswordtextBox.Text);

            if (result != 0)
            {
                MessageBox.Show("Data Updated Successfully.");
                MyProfile_Click();
            }
        }
Exemplo n.º 4
0
        private void buttonAddNewEmp_Click(object sender, EventArgs e)
        {
            OrgEmployee oe = new OrgEmployee();

            oe.AddEmp(FName_textbox.Text, LName_textbox.Text, Phone_textbox.Text, Email_textbox.Text, Password_textbox.Text, Account.AccountId);
            MessageBox.Show("Data Inserted successfully.");
            FName_textbox.Text    = "";
            LName_textbox.Text    = "";
            Phone_textbox.Text    = "";
            Email_textbox.Text    = "";
            Password_textbox.Text = "";
        }
Exemplo n.º 5
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;
            }
        }
Exemplo n.º 6
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;
            }
        }