Пример #1
0
        public IActionResult Teacher(Int64 TeacherId, TeacherPayment teacherPayment)
        {
            var data = _context.TeacherPayment.ToList();

            var model = new List <TeacherPayment>();

            foreach (var i in data)
            {
                if (TeacherId != i.TeacherId)
                {
                    continue;
                }

                var s = new TeacherPayment();
                s.TeacherId = i.TeacherId;
                s.Date      = i.Date;
                s.Salary    = i.Salary;

                s.MonthName = i.MonthName;

                s.Fine = i.Fine;

                model.Add(s);
            }
            return(View(model));
        }
Пример #2
0
        public IActionResult TeacherPaymentAdd(TeacherPayment teacherPayment)
        {
            Int64 Id = teacherPayment.TeacherId;

            _context.TeacherPayment.Add(teacherPayment);
            _context.SaveChanges();



            return(RedirectToAction("Teacher", new { id = Id }));
        }
Пример #3
0
        public IActionResult TeacherPaymentEdit(TeacherPayment i)
        {
            var s = _context.TeacherPayment.Where(u => u.TeacherId == i.TeacherId && u.No == i.No).FirstOrDefault();

            s.TeacherId = i.TeacherId;
            s.Date      = i.Date;
            s.Salary    = i.Salary;

            s.MonthName = i.MonthName;
            s.Fine      = i.Fine;

            //  _context.StudentPayment.Update(s);
            _context.SaveChanges();
            return(RedirectToAction("Teacher", new { Teacherid = i.TeacherId }));
        }
Пример #4
0
 public IActionResult TeacherPaymentAdd(Int64 Id, TeacherPayment teacherPayment)
 {
     teacherPayment.TeacherId = Id;
     return(View());
 }