Пример #1
0
 public IActionResult Add(BillsAddView view)
 {
     if (ModelState.IsValid)
     {
         Bills model = new Bills
         {
             BillDate     = view.BillDate,
             BillSeriNo   = view.BillSeriNo,
             Deliverer    = view.Deliverer,
             VergiDairesi = view.VergiDairesi,
             BillOrderno  = view.BillOrderno,
             Hour         = view.Hour,
             Receiver     = view.Receiver,
         };
         _billsService.Add(model);
         return(RedirectToAction("Index"));
     }
     return(View(view));
 }
Пример #2
0
        void buttonSaveNewBill_Click(object sender, RoutedEventArgs e)
        {
            var april = Double.Parse(aprilTextBox.Text);

            Bill bill = new Bill()
            {
                April     = Double.Parse(aprilTextBox.Text),
                August    = Double.Parse(augustTextBox.Text),
                BillName  = nameTextBox.Text,
                December  = Double.Parse(decemberTextBox.Text),
                February  = Double.Parse(februaryTextBox.Text),
                January   = Double.Parse(januaryTextBox.Text),
                July      = Double.Parse(julyTextBox.Text),
                June      = Double.Parse(juneTextBox.Text),
                March     = Double.Parse(marchTextBox.Text),
                May       = Double.Parse(mayTextBox.Text),
                November  = Double.Parse(novemberTextBox.Text),
                October   = Double.Parse(octoberTextBox.Text),
                September = Double.Parse(septemberTextBox.Text),
                UserId    = usersService.GetUserIdByName(Settings.Default.Username)
            };

            billsService.Add(bill);
        }