Ejemplo n.º 1
0
        private void btnJunSave_Click(object sender, EventArgs e)
        {
            Sixth_mR Jun = new Sixth_mR();

            Jun.memberName      = comboBox1.Text.Trim();
            Jun.monthlyAmount   = txtMonthlyAmount.Text.Trim();
            Jun.interest        = txtInterest.Text.Trim();
            Jun.paidAmount      = txtPaidAmount.Text.Trim();
            Jun.CollectedAmount = txtCollectAmt.Text.Trim();
            Jun.bcName          = labelBcName.Text.Trim();
            if (txtInterest.Text == "")
            {
                MessageBox.Show("Enter The Interest % Amount");
            }
            else if (txtPaidAmount.Text == "")
            {
                MessageBox.Show("Enter Paid Amount");
            }

            else
            {
                MC.Sixth_mR.Add(Jun);
                MC.SaveChanges();
                MessageBox.Show("   Record Save For" + Environment.NewLine +
                                " Member:  " + comboBox1.Text + Environment.NewLine +
                                " To Beesi Name:  " + labelBcName.Text);
            }
        }
 private void dgvSixth_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvSixth.CurrentRow.Index != -1)
         {
             m6.id = Convert.ToInt32(dgvSixth.CurrentRow.Cells["sixthId"].Value);
             using (MonthlyContributionEntities mc = new MonthlyContributionEntities())
             {
                 m6                = mc.Sixth_mR.Where(x => x.id == m6.id).FirstOrDefault();
                 textBox1.Text     = m6.bcName;
                 BtnDelSix.Enabled = true;
             }
         }
     }
     catch (NullReferenceException)
     {
         MessageBox.Show("There Are no Record Available");
     }
 }