コード例 #1
0
        private void btnOctSave_Click(object sender, EventArgs e)
        {
            Teen_mR oct = new Teen_mR();

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

            else
            {
                MC.Teen_mR.Add(oct);
                MC.SaveChanges();
                MessageBox.Show("   Record Save For" + Environment.NewLine +
                                " Member:  " + comboBox1.Text + Environment.NewLine +
                                " To Beesi Name:  " + labelBcName.Text);
            }
        }
コード例 #2
0
 private void dgvten_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvten.CurrentRow.Index != -1)
         {
             m10.id = Convert.ToInt32(dgvten.CurrentRow.Cells["tenId"].Value);
             using (MonthlyContributionEntities mc = new MonthlyContributionEntities())
             {
                 m10               = mc.Teen_mR.Where(x => x.id == m10.id).FirstOrDefault();
                 textBox1.Text     = m10.bcName;
                 btnDelTen.Enabled = true;
             }
         }
     }
     catch (NullReferenceException)
     {
         MessageBox.Show("There Are no Record Available");
     }
 }