Exemplo n.º 1
0
        protected override void SaveMaintained()
        {
            if (String.IsNullOrEmpty(VehicleCategoriesMaintenance.id.Text))
            {
                Category category = new Category(0, VehicleCategoriesMaintenance.name.Text,
                                                 Convert.ToDecimal(VehicleCategoriesMaintenance.dailyPrice.Text),
                                                 Convert.ToDecimal(VehicleCategoriesMaintenance.weeklyPrice.Text),
                                                 Convert.ToDecimal(VehicleCategoriesMaintenance.monthlyPrice.Text));

                CategoryData.Insert(category);
            }
            else
            {
                Category category = Current();
                category.Name         = VehicleCategoriesMaintenance.name.Text;
                category.DailyPrice   = Convert.ToDecimal(VehicleCategoriesMaintenance.dailyPrice.Text);
                category.WeeklyPrice  = Convert.ToDecimal(VehicleCategoriesMaintenance.weeklyPrice.Text);
                category.MonthlyPrice = Convert.ToDecimal(VehicleCategoriesMaintenance.monthlyPrice.Text);
                CategoryData.Update(category);
            }
        }
Exemplo n.º 2
0
 protected override void CreateData()
 {
     this.data = new CategoryData();
 }
Exemplo n.º 3
0
 protected override void DeleteMaintained()
 {
     CategoryData.Delete(Current());
 }
Exemplo n.º 4
0
 protected override void LoadMaintanied()
 {
     this.Maintained = CategoryData.GetAll();
 }