Exemplo n.º 1
0
 public Nanny(int myId, string myFamily = "", string myName           = "", string myBirth      = "01.01.0001", int myMobilePhone = 0, int myPhone = 0, string myAddress = "", bool myIsLift = false, int myFloor = 0, int myExperience = 0,
              int myMaxChild            = 0, int myMinAgeMounth       = 0, int myMaxAgeMounth   = 0, bool myIfHour = false, int myHour = 0, int myMounth = 0, bool[] myIsWork = null, /*Time[] myNumWorkHours=null,*/
              Eduction myeduction       = 0, string myRecommendations = "", string myBankAcount = "", bool myIfPrepareFood = false)
 {
     Id           = myId;
     Family       = myFamily;
     Name         = myName;
     Birth        = DateTime.Parse(myBirth);
     MobilePhone  = myMobilePhone;
     Phone        = myPhone;
     Address      = myAddress;
     IsLift       = myIsLift;
     Floor        = myFloor;
     Experience   = myExperience;
     MaxChild     = myMaxChild;
     MinAgeMounth = myMinAgeMounth;
     MaxAgeMounth = myMaxAgeMounth;
     IfHour       = myIfHour;
     Hour         = myHour;
     Mounth       = myMounth;
     //IsWork = myIsWork;
     //NumWorkHours = myNumWorkHours;
     eduction        = myeduction;
     Recommendations = myRecommendations;
     BankAcount      = myBankAcount;
     IfPrepareFood   = myIfPrepareFood;
 }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,SchoolName,Program,StartTime,EndTime,Description,UserId")] Eduction eduction)
        {
            if (id != eduction.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(eduction);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EductionExists(eduction.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["UserId"] = new SelectList(_context.ApplicationUser, "Id", "Id", eduction.UserId);
            return(View(eduction));
        }
Exemplo n.º 3
0
        public async Task <Eduction> UpdateAsync(Eduction Eduction)
        {
            context.Update(Eduction);
            await context.SaveChangesAsync();

            return(Eduction);
        }
Exemplo n.º 4
0
        public async Task <Eduction> AddAsync(Eduction Eduction)
        {
            context.Eduction.Add(Eduction);
            await context.SaveChangesAsync();

            return(Eduction);
        }
Exemplo n.º 5
0
        public async Task <IActionResult> Create([Bind("Id,SchoolName,Program,StartTime,EndTime,Description,UserId")] Eduction eduction)
        {
            if (ModelState.IsValid)
            {
                _context.Add(eduction);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["UserId"] = new SelectList(_context.ApplicationUser, "Id", "Id", eduction.UserId);
            return(View(eduction));
        }