private void btnAugustSave_Click(object sender, EventArgs e) { Eight_mR aug = new Eight_mR(); aug.memberName = comboBox1.Text.Trim(); aug.monthlyAmount = txtMonthlyAmount.Text.Trim(); aug.interest = txtInterest.Text.Trim(); aug.paidAmount = txtPaidAmount.Text.Trim(); aug.CollectedAmount = txtCollectAmt.Text.Trim(); aug.bcName = labelBcName.Text.Trim(); if (txtInterest.Text == "") { MessageBox.Show("Enter The Interest % Amount"); } else if (txtPaidAmount.Text == "") { MessageBox.Show("Enter Paid Amount"); } /*else if (MC.Second_R.Any(o => o.memberName == comboBox1.Text)) * { * MessageBox.Show("Record Alredy Submitted for this Member" + Environment.NewLine + * " Do You want to Update Delete It First"); * return; * }*/ else { MC.Eight_mR.Add(aug); MC.SaveChanges(); MessageBox.Show(" Record Save For" + Environment.NewLine + " Member: " + comboBox1.Text + Environment.NewLine + " To Beesi Name: " + labelBcName.Text); } }
private void dgvEigth_Click(object sender, EventArgs e) { try { if (dgvEigth.CurrentRow.Index != -1) { m8.id = Convert.ToInt32(dgvEigth.CurrentRow.Cells["eightId"].Value); using (MonthlyContributionEntities mc = new MonthlyContributionEntities()) { m8 = mc.Eight_mR.Where(x => x.id == m8.id).FirstOrDefault(); textBox1.Text = m8.bcName; btnDelEight.Enabled = true; } } } catch (NullReferenceException) { MessageBox.Show("There Are no Record Available"); } }