private void btnDecSave_Click(object sender, EventArgs e) { Twelve_mR dec = new Twelve_mR(); dec.memberName = comboBox1.Text.Trim(); dec.monthlyAmount = txtMonthlyAmount.Text.Trim(); dec.interest = txtInterest.Text.Trim(); dec.paidAmount = txtPaidAmount.Text.Trim(); dec.CollectedAmount = txtCollectAmt.Text.Trim(); dec.bcName = labelBcName.Text.Trim(); if (txtInterest.Text == "") { MessageBox.Show("Enter The Interest % Amount"); } else if (txtPaidAmount.Text == "") { MessageBox.Show("Enter Paid Amount"); } else { MC.Twelve_mR.Add(dec); MC.SaveChanges(); MessageBox.Show(" Record Save For" + Environment.NewLine + " Member: " + comboBox1.Text + Environment.NewLine + " To Beesi Name: " + labelBcName.Text); } }
private void dgvtwele_Click(object sender, EventArgs e) { try { if (dgvtwele.CurrentRow.Index != -1) { m12.id = Convert.ToInt32(dgvtwele.CurrentRow.Cells["tweleId"].Value); using (MonthlyContributionEntities mc = new MonthlyContributionEntities()) { m12 = mc.Twelve_mR.Where(x => x.id == m12.id).FirstOrDefault(); textBox1.Text = m12.bcName; btnDelTwele.Enabled = true; } } } catch (NullReferenceException) { MessageBox.Show("There Are no Record Available"); } }