private void DonateNowButton_CLICK(object sender, EventArgs e) { string s = DateTime.Now.ToString(); DonationByNgo bd = new DonationByNgo(); bd.DonationId = this.RecieverIDtextBox5.Text; bd.DonationTitle = Convert.ToString(this.DonationTitleCombobox.SelectedItem); bd.RecieverId = this.donationIDtextBox.Text; bd.GivenTime = Convert.ToString(s); bd.DonationItem = Convert.ToString(this.DonationItemComboBox.SelectedItem); bd.RecieverPhone = this.ContacttextBox2.Text; bd.GiveBYID = Convert.ToString(VariableHolderValueLabel.Text); AeMployeeRepisotary bookRepo = new AeMployeeRepisotary(); if (bookRepo.Insert(bd)) { MessageBox.Show("Sucessfully Donated", "Insert Sucess"); this.RecieverIDtextBox5.Text = ""; this.ContacttextBox2.Text = ""; this.donationIDtextBox.Text = ""; // this.RecieverIDtextBox5.Text = ""; } else { MessageBox.Show("Donation Missing", "Insert Error"); } }
private void button2_Click(object sender, EventArgs e) { DateTime dt = new DateTime(); string s = DateTime.Now.ToString(); UpcomingEvent bd = new UpcomingEvent(); bd.Projectname = this.textBox3.Text; bd.ProjectID = this.textBox5.Text; bd.Projectarea = this.textBox2.Text; bd.ProposedDate = Convert.ToDateTime(this.textBox1.Text); //bList.Add(bd); AeMployeeRepisotary depkRepo = new AeMployeeRepisotary(); if (depkRepo.Insert(bd)) { MessageBox.Show("Can Insert ", "Insert Sucess"); this.textBox3.Text = ""; this.textBox2.Text = ""; this.textBox5.Text = ""; this.textBox1.Text = ""; AeMployeeRepisotary accRepo = new AeMployeeRepisotary(); List <UpcomingEvent> bList = accRepo.GetAllUpcomingList(); this.UpcomingProjectGridView2.DataSource = bList; } else { MessageBox.Show("Can Not Insert ", "Insert Error"); } }