private void linkLabel7_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            ProjectandAdvisorDetails frm = new ProjectandAdvisorDetails();

            this.Hide();
            frm.Show();
        }
Example #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            this.Hide();
            ProjectandAdvisorDetails frm = new ProjectandAdvisorDetails();

            frm.Show();
        }
Example #3
0
        private void linkLabel7_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            ProjectandAdvisorDetails d = new ProjectandAdvisorDetails();

            d.Show();
        }
Example #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (comboBox1.Text != "")
            {
                lbladvisor.Text = "";
            }
            else if (comboBox1.Text == "")
            {
                lbladvisor.Text    = "Please SElect the Advisor";
                lbladvisor.Visible = true;
            }
            if (comboBox2.Text != "")
            {
                lbltitle.Text = "";
            }
            else if (comboBox2.Text == "")
            {
                lbltitle.Text = "Select the Title";
            }
            if (comboBox3.Text != "")
            {
                lblrole.Text = "";
            }
            else if (comboBox3.Text == "")
            {
                lblrole.Text = "Select the Role of Advisor";
            }
            if (dateTimePicker1.Value > DateTime.Now)
            {
                label4.Text    = "Enter correct Assignment Date";
                label4.Visible = true;
            }
            else if (dateTimePicker1.Value <= DateTime.Now)
            {
                label4.Text = "";
            }

            if (lbladvisor.Text == "" && lblrole.Text == "" && lbltitle.Text == "" && label4.Text == "")
            {
                string cmnd = "Select Id from Project where Title = '" + comboBox2.Text + "'";

                int id = dbConnection.getInstance().getScalerData(cmnd);

                string b = "Select Id from Lookup where Value = '" + comboBox3.Text + "'";

                int o = dbConnection.getInstance().getScalerData(b);



                string query = "Select Count(AdvisorId) from ProjectAdvisor where ProjectId = '" + id + "' and AdvisorId = '" + Convert.ToInt32(comboBox1.Text) + "'";

                int count = dbConnection.getInstance().getScalerData(query);

                bool c = true;

                if (count >= 1)
                {
                    label4.Text    = "This Advisor is already serving project '" + comboBox2.Text + "'";
                    label4.Visible = true;
                    c = false;
                }


                else if (c == true)
                {
                    try
                    {
                        string s = "Select Id from Lookup where Value = '" + comboBox3.Text + "'";


                        int i = dbConnection.getInstance().getScalerData(s);



                        string os = "Update ProjectAdvisor SET ProjectId = '" + id + "', AdvisorId = '" + Convert.ToInt32(comboBox1.Text) + "',AdvisorRole = '" + i + "',AssignmentDate = '" + dateTimePicker1.Value + "' where ProjectId = '" + dataGridView1.CurrentRow.Cells["ProjectId"].Value + "'and AdvisorId = '" + dataGridView1.CurrentRow.Cells["AdvisorId"].Value + "'";
                        dbConnection.getInstance().exectuteQuery(os);
                        MessageBox.Show("Updated");
                        this.Hide();
                        ProjectandAdvisorDetails frm = new ProjectandAdvisorDetails();
                        frm.Show();
                    }
                    catch (Exception et)
                    {
                        throw (et);
                    }
                }
            }
        }