예제 #1
0
        /// <summary>
        /// Add property object to the Database
        /// </summary>
        /// <param name="prop"></param>
        public void AddProperty(property prop)
        {
            context.properties.Add(prop);
            context.SaveChanges();

            _mw.LoadPropertyList();
        }
예제 #2
0
 /// <summary>
 /// adding the new tenant
 /// </summary>
 /// <param name="tenant"></param>
 public void AddNewTenant(tenant tenant, int propertyId)
 {
     tenant.tenant_property_id = propertyId;
     contex.tenants.Add(tenant);
     contex.SaveChanges();
     MainWindow.TenantDataGrid.ItemsSource = contex.tenants.ToList();
 }
예제 #3
0
        /// <summary>
        /// Add New Expense to the Database
        /// </summary>
        /// <param name="prop_id"></param>
        /// <param name="exp_name"></param>
        /// <param name="exp_cost"></param>
        /// <param name="exp_desc"></param>
        /// <param name="contractor_name"></param>
        /// <param name="exp_type"></param>
        public void AddExpense(expense exp, int propertyId)
        {
            exp.expense_property_id = propertyId;
            context.expenses.Add(exp);
            context.SaveChanges();

            MainWindow.ExpenseDataGrid.ItemsSource = context.expenses.ToList();
        }
예제 #4
0
        /// <summary>
        /// Add New Analysis to the Database
        /// </summary>
        /// <param name="ana"></param>
        public void AddAnalysis(analysis ana)
        {
            //TODO SET PROPERTY_EXPENSE_ID HERE - LE

            context.analyses.Add(ana);
            context.SaveChanges();

            _aw.LoadPropertyList();
            //MainWindow.analysisDataGrid.ItemsSource = context.analysis.ToList();
        }