示例#1
0
        public bool Update(Role role)
        {
            var fetchedRole = _context.Roles.FirstOrDefault(x => x.RoleId == role.RoleId);

            if (fetchedRole != null)
            {
                fetchedRole.RoleName = role.RoleName;
                _context.SaveChanges();
                return(true);
            }
            return(false);
        }
        public bool Update(Transaction transaction)
        {
            var fetchedtransaction = GetTransaction(transaction.TransactionId);

            if (fetchedtransaction != null)
            {
                fetchedtransaction.TransactionDate = System.DateTime.Now.ToLongDateString();
                fetchedtransaction.EmployeeId      = transaction.EmployeeId;
                fetchedtransaction.ServicePlanId   = transaction.ServicePlanId;
                fetchedtransaction.StudentInfoId   = transaction.StudentInfoId;
                _context.SaveChanges();
                return(true);
            }
            return(false);
        }
示例#3
0
        public bool Update(ServicePlan servicePlan)
        {
            var fetchedServiceplan = GetServiceplan(servicePlan.ServicePlanId);

            if (fetchedServiceplan != null)
            {
                fetchedServiceplan.Amount       = servicePlan.Amount;
                fetchedServiceplan.NoOfWashes   = servicePlan.NoOfWashes;
                fetchedServiceplan.PlanName     = servicePlan.PlanName;
                fetchedServiceplan.ValidityDate = servicePlan.ValidityDate;
                _context.SaveChanges();
                return(true);
            }
            return(false);
        }
示例#4
0
        public bool Update(Employee employee)
        {
            var fetchedEmp = GetEmployee(employee.EmployeeId);

            if (fetchedEmp != null)
            {
                fetchedEmp.ContactNo    = employee.ContactNo;
                fetchedEmp.EmailAddress = employee.EmailAddress;
                fetchedEmp.FirstName    = employee.FirstName;
                fetchedEmp.JoiningDate  = employee.JoiningDate;
                fetchedEmp.LastName     = employee.LastName;
                fetchedEmp.RoleId       = employee.RoleId;
                _context.SaveChanges();
                return(true);
            }
            return(false);
        }
示例#5
0
        public bool Update(StudentInfo studentInfo)
        {
            var fetchedStudent = GetStudentInfo(studentInfo.StudentInfoId);

            if (fetchedStudent != null)
            {
                fetchedStudent.ContactNo = studentInfo.ContactNo;
                fetchedStudent.FirstName = studentInfo.FirstName;
                fetchedStudent.LastName  = studentInfo.LastName;
                fetchedStudent.Barcode   = studentInfo.Barcode;
                fetchedStudent.BarcodeID = studentInfo.BarcodeID;
                fetchedStudent.EmailId   = studentInfo.EmailId;
                _context.SaveChanges();
                return(true);
            }
            return(false);
        }