示例#1
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (this.textBox7.Text == "" || this.textBox9.Text == "" || this.textBox10.Text == "")
            {
                MessageBox.Show("Insert the data");
            }

            else
            {
                string id          = this.textBox7.Text;
                double runningCost = Convert.ToDouble(this.textBox9.Text);
                string report      = this.textBox10.Text;

                MarketingRepository mr = new MarketingRepository();
                if (mr.UpdateCost(id, runningCost, report))
                {
                    List <MarketingR> iList = mr.GetAllApprovedCampaign();
                    this.dataGrid2.DataSource = iList;

                    this.textBox7.Text  = "";
                    this.textBox9.Text  = "";
                    this.textBox10.Text = "";
                }
                else
                {
                    MessageBox.Show("Can Not Update Campaign", "Update Error");
                }
            }
        }
示例#2
0
        private void approvedTab_Click(object sender, EventArgs e)
        {
            this.dataGrid.Visible  = false;
            this.dataGrid1.Visible = false;
            this.dataGrid2.Visible = true;

            this.groupBox1.Visible = true;
            this.groupBox2.Visible = true;
            this.groupBox3.Visible = false;

            MarketingRepository mr          = new MarketingRepository();
            List <MarketingR>   allCampaign = mr.GetAllApprovedCampaign();

            this.dataGrid2.DataSource = allCampaign;
        }