/// <summary>
        /// Create a new MoneyForSavings object.
        /// </summary>
        /// <param name="iDSaving">Initial value of the IDSaving property.</param>
        /// <param name="moneyFSaving">Initial value of the MoneyFSaving property.</param>
        /// <param name="month">Initial value of the Month property.</param>
        public static MoneyForSavings CreateMoneyForSavings(global::System.DateTime iDSaving, global::System.Int32 moneyFSaving, global::System.Int32 month)
        {
            MoneyForSavings moneyForSavings = new MoneyForSavings();

            moneyForSavings.IDSaving     = iDSaving;
            moneyForSavings.MoneyFSaving = moneyFSaving;
            moneyForSavings.Month        = month;
            return(moneyForSavings);
        }
示例#2
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     if (lstIncome.SelectedRows.Count == 1)
     {
         var      row  = lstIncome.SelectedRows[0];
         var      cell = row.Cells["ID"];
         DateTime ID   = (DateTime)cell.Value;
         ExpenseManagementEntities db    = new ExpenseManagementEntities();
         MoneyForSavings           Money = db.MoneyForSavings.Single(st => st.IDSaving == ID);
         db.MoneyForSavings.DeleteObject(Money);
         db.SaveChanges();
         this.LoadMoneyList();
     }
     else
     {
         MessageBox.Show("You should select a month!");
     }
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the MoneyForSavings EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToMoneyForSavings(MoneyForSavings moneyForSavings)
 {
     base.AddObject("MoneyForSavings", moneyForSavings);
 }