示例#1
0
        public async Task <IActionResult> Create([Bind("Id,IdCode,FullName,PhoneNumber,Address,Gender,Status")] CustomerEntities customerEntities)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customerEntities);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customerEntities));
        }
示例#2
0
        public async Task <IActionResult> Create([Bind("Id,Password")] Bos bos)
        {
            if (ModelState.IsValid)
            {
                _context.Add(bos);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(bos));
        }
示例#3
0
        public async Task <IActionResult> Create([Bind("IdPesanan,NamaCustomer,Tipe,BeratTotal,HrgSatuan,HrgTotal,TglPesanan")] Pesanan pesanan)
        {
            if (ModelState.IsValid)
            {
                _context.Add(pesanan);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(pesanan));
        }
示例#4
0
        public async Task <IActionResult> Create([Bind("Id,IdCode,CustomerId,LaundryTypeId,AmountUnit,OrderType,Description,TotalPayment,Status")] OrderEntities orderEntities)
        {
            if (ModelState.IsValid)
            {
                _context.Add(orderEntities);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(orderEntities));
        }
示例#5
0
        public async Task <IActionResult> Create([Bind("IdKaryawan,IdPesanan")] DetailPelayanan detailPelayanan)
        {
            if (ModelState.IsValid)
            {
                _context.Add(detailPelayanan);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(detailPelayanan));
        }
示例#6
0
        public async Task <IActionResult> Create([Bind("IdKaryawan,NamaKaryawan,JnsKelamin,Alamat")] Karyawan karyawan)
        {
            if (ModelState.IsValid)
            {
                _context.Add(karyawan);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(karyawan));
        }
示例#7
0
        public async Task <IActionResult> Create([Bind("ID,Name")] DeliveryEntities deliveryEntities)
        {
            if (ModelState.IsValid)
            {
                _context.Add(deliveryEntities);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(deliveryEntities));
        }
        public async Task <IActionResult> Create([Bind("ID,IdCode,LaundryName,Price,Init,Status")] LaudryTypeEnitites laudryTypeEnitites)
        {
            if (ModelState.IsValid)
            {
                _context.Add(laudryTypeEnitites);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(laudryTypeEnitites));
        }
示例#9
0
        public async Task <IActionResult> Create([Bind("ID,IdCode,DateCreate,TotalExpenses,Status")] BillEntities billEntities)
        {
            if (ModelState.IsValid)
            {
                _context.Add(billEntities);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(billEntities));
        }
        public async Task <bool> AddBookingSession(AddBookingSessionModel addBookingSession)
        {
            var bookingSession = _mapper.Map <BookingSession>(addBookingSession);

            await _laundryContext.BookingSessions.AddAsync(bookingSession);

            var success = await _laundryContext.SaveChangesAsync();

            return(success > 0);
        }
示例#11
0
        public async Task <ApiResultCode> Complete()
        {
            try
            {
                await _context.SaveChangesAsync();

                return(new ApiResultCode(ApiResultType.Success, 1, "Save successfully"));
            }
            catch (Exception ex)
            {
                ErrorTrace.Logger(LogArea.ApplicationTier, ex);
                return(new ApiResultCode(ApiResultType.ExceptionDuringOpration, 3, "Exception during saveing"));
            }
        }