Example #1
0
        public async Task <IActionResult> PutPaymentDetail(string id, PaymentDetail paymentDetail)
        {
            if (id != paymentDetail.InvoiceNo)
            {
                return(BadRequest());
            }

            _context.Entry(paymentDetail).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PaymentDetailExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Example #2
0
        public async Task <IActionResult> PutAppInfo(int id, AppInfo appInfo)
        {
            if (id != appInfo.AppInfoId)
            {
                return(BadRequest());
            }

            _context.Entry(appInfo).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!AppInfoExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Example #3
0
        public async Task <IActionResult> PutDueRecoverd(int id, DueRecoverd dueRecoverd)
        {
            if (id != dueRecoverd.DueRecoverdId)
            {
                return(BadRequest());
            }

            _context.Entry(dueRecoverd).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!DueRecoverdExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Example #4
0
        public async Task <IActionResult> PutDailySale(int id, DailySale dailySale)
        {
            if (id != dailySale.DailySaleId)
            {
                return(BadRequest());
            }

            _context.Entry(dailySale).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!DailySaleExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Example #5
0
        public async Task <IActionResult> PutOnlineVendor(int id, OnlineVendor onlineVendor)
        {
            if (id != onlineVendor.OnlineVendorId)
            {
                return(BadRequest());
            }

            _context.Entry(onlineVendor).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!OnlineVendorExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutBankAccount(int id, BankAccount bankAccount)
        {
            if (id != bankAccount.BankAccountId)
            {
                return(BadRequest());
            }

            _context.Entry(bankAccount).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!BankAccountExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Example #7
0
        public async Task <IActionResult> Create([Bind("ExpenseId,Particulars,PartyName,EmployeeId,OnDate,PayMode,BankAccountId,PaymentDetails,Amount,Remarks,PartyId,LedgerEnteryId,IsCash,StoreId,UserId,EntryStatus")] Expense expense)
        {
            if (ModelState.IsValid)
            {
                if (expense.PayMode == PaymentMode.Cash)
                {
                    expense.BankAccountId = null;
                }
                _context.Add(expense);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BankAccountId"] = new SelectList(_context.BankAccounts, "BankAccountId", "Account", expense.BankAccountId);
            ViewData["EmployeeId"]    = new SelectList(_context.Employees, "EmployeeId", "StaffName", expense.EmployeeId);
            ViewData["PartyId"]       = new SelectList(_context.Parties.OrderBy(c => c.PartyName), "PartyId", "PartyName", expense.PartyId);
            ViewData["StoreId"]       = ActiveSession.GetActiveSession(HttpContext.Session, HttpContext.Response, _returnUrl);

            Console.WriteLine($"StoreId+{expense.StoreId}\tEnt {expense.EntryStatus},\t us {expense.UserId}, \taa=" + ModelState.IsValid);
            foreach (var modelState in ViewData.ModelState.Values)
            {
                foreach (ModelError error in modelState.Errors)
                {
                    Console.WriteLine(error.ErrorMessage);
                }
            }
            return(View(expense));
        }
Example #8
0
        public async Task <IActionResult> PutPurchaseItem(int id, PurchaseItem purchaseItem)
        {
            if (id != purchaseItem.PurchaseItemId)
            {
                return(BadRequest());
            }

            _context.Entry(purchaseItem).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PurchaseItemExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutLedgerEntry(int id, LedgerEntry ledgerEntry)
        {
            if (id != ledgerEntry.LedgerEntryId)
            {
                return(BadRequest());
            }

            _context.Entry(ledgerEntry).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!LedgerEntryExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Example #10
0
        public async Task <IActionResult> PutCashInBank(int id, CashInBank cashInBank)
        {
            if (id != cashInBank.CashInBankId)
            {
                return(BadRequest());
            }

            _context.Entry(cashInBank).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CashInBankExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutEDC(int id, EDC eDC)
        {
            if (id != eDC.EDCId)
            {
                return(BadRequest());
            }

            _context.Entry(eDC).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!EDCExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Example #12
0
        private async System.Threading.Tasks.Task AddContactsAsync()
        {
            //ContactId	FirstName	LastName	MobileNo	PhoneNo	EMailAddress	Remarks	UserName

            var ws = xS.GetWS("Contacts");
            var nonEmptyDataRows = ws.RowsUsed();
            int Row = 6;//Title;

            foreach (var dR in nonEmptyDataRows)
            {
                if (dR.RowNumber() > Row)
                {
                    Contact con = new Contact
                    {
                        FirstName    = dR.Cell(2).GetValue <string>(),
                        LastName     = dR.Cell(3).GetValue <string>(),
                        MobileNo     = dR.Cell(4).GetValue <string>(),
                        PhoneNo      = dR.Cell(5).GetValue <string>(),
                        EMailAddress = dR.Cell(6).GetValue <string>(),
                        Remarks      = dR.Cell(7).GetValue <string>(),
                    };

                    db.Contacts.Add(con);
                }
            }

            await db.SaveChangesAsync();
        }
        public async Task <IActionResult> PutRegularInvoice(string id, RegularInvoice regularInvoice)
        {
            if (id != regularInvoice.InvoiceNo)
            {
                return(BadRequest());
            }

            _context.Entry(regularInvoice).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!RegularInvoiceExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutTranscationMode(int id, TranscationMode transcationMode)
        {
            if (id != transcationMode.TranscationModeId)
            {
                return(BadRequest());
            }

            _context.Entry(transcationMode).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TranscationModeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutStoreHoliday(int id, StoreHoliday storeHoliday)
        {
            if (id != storeHoliday.StoreHolidayId)
            {
                return(BadRequest());
            }

            _context.Entry(storeHoliday).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!StoreHolidayExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutRentedLocation(int id, RentedLocation rentedLocation)
        {
            if (id != rentedLocation.RentedLocationId)
            {
                return(BadRequest());
            }

            _context.Entry(rentedLocation).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!RentedLocationExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Example #17
0
        public async Task <IActionResult> PutPaySlip(int id, PaySlip paySlip)
        {
            if (id != paySlip.PaySlipId)
            {
                return(BadRequest());
            }

            _context.Entry(paySlip).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PaySlipExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Example #18
0
        private async System.Threading.Tasks.Task <SortedList <int, string> > AddBookingAsync()
        {
            // TalioringBookingId BookingDate CustName DeliveryDate    TryDate BookingSlipNo   TotalAmount TotalQty    ShirtQty ShirtPrice
            // PantQty PantPrice   CoatQty CoatPrice   KurtaQty KurtaPrice  BundiQty BundiPrice  Others OthersPrice IsDelivered StoreId
            // UserName

            var ws = xS.GetWS("Bookings");
            var nonEmptyDataRows = ws.RowsUsed();
            int Row = 6;//Title;
            SortedList <int, string> list = new SortedList <int, string>();

            foreach (var dR in nonEmptyDataRows)
            {
                if (dR.RowNumber() > Row)
                {
                    list.Add(dR.Cell(1).GetValue <int>(), dR.Cell(6).Value.ToString());
                    TalioringBooking book = new TalioringBooking
                    {
                        IsReadOnly    = true,
                        EntryStatus   = 0,
                        BookingDate   = dR.Cell(2).GetDateTime(),
                        CustName      = dR.Cell(3).GetValue <string>(),
                        DeliveryDate  = dR.Cell(4).GetDateTime(),
                        TryDate       = dR.Cell(5).GetDateTime(),
                        BookingSlipNo = dR.Cell(6).Value.ToString(),
                        TotalAmount   = dR.Cell(7).GetValue <decimal>(),
                        TotalQty      = dR.Cell(8).GetValue <int>(),
                        ShirtQty      = dR.Cell(9).GetValue <int>(),
                        ShirtPrice    = dR.Cell(10).GetValue <decimal>(),

                        PantQty   = dR.Cell(11).GetValue <int>(),
                        PantPrice = dR.Cell(12).GetValue <decimal>(),

                        CoatQty   = dR.Cell(13).GetValue <int>(),
                        CoatPrice = dR.Cell(14).GetValue <decimal>(),

                        KurtaQty   = dR.Cell(15).GetValue <int>(),
                        KurtaPrice = dR.Cell(16).GetValue <decimal>(),

                        BundiQty   = dR.Cell(17).GetValue <int>(),
                        BundiPrice = dR.Cell(18).GetValue <decimal>(),

                        Others      = dR.Cell(19).GetValue <int>(),
                        OthersPrice = dR.Cell(20).GetValue <decimal>(),
                        IsDelivered = dR.Cell(21).GetBoolean(),
                        StoreId     = 1,//dR.Cell(22).GetValue<int>(),
                        UserId      = dR.Cell(23).GetValue <string>()
                    };
                    await db.TalioringBookings.AddAsync(book);
                }
            }

            await db.SaveChangesAsync();

            return(list);
        }
Example #19
0
        public async Task <IActionResult> Create([Bind("CustomerId,FirstName,LastName,Age,DateOfBirth,City,MobileNo,Gender,NoOfBills,TotalAmount,CreatedDate")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(PartialView(customer));
        }
Example #20
0
        public async Task <IActionResult> Create([Bind("LedgerTypeId,LedgerNameType,Category,Remark")] LedgerType ledgerType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ledgerType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(PartialView(ledgerType));
        }
        public async Task <IActionResult> Create([Bind("PurchaseTaxTypeId,TaxName,TaxType,CompositeRate")] PurchaseTaxType purchaseTaxType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(purchaseTaxType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(PartialView(purchaseTaxType));
        }
Example #22
0
        public async Task <IActionResult> Create([Bind("ContactId,FirstName,LastName,MobileNo,PhoneNo,EMailAddress,Remarks")] Contact contact)
        {
            if (ModelState.IsValid)
            {
                _context.Add(contact);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(PartialView(contact));
        }
Example #23
0
        public async Task <IActionResult> Create([Bind("OnlineVendorId,VendorName,OnDate,IsActive,Remark,OffDate,Reason")] OnlineVendor onlineVendor)
        {
            if (ModelState.IsValid)
            {
                _context.Add(onlineVendor);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(PartialView(onlineVendor));
        }
Example #24
0
        public async Task <IActionResult> Create([Bind("FirstName,LastName,IsEmployee,EmployeeId,IsWorking,Id,UserName,NormalizedUserName,Email,NormalizedEmail,EmailConfirmed,PasswordHash,SecurityStamp,ConcurrencyStamp,PhoneNumber,PhoneNumberConfirmed,TwoFactorEnabled,LockoutEnd,LockoutEnabled,AccessFailedCount")] AppUser appUser)
        {
            if (ModelState.IsValid)
            {
                _context.Add(appUser);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(appUser));
        }
        public async Task <IActionResult> Create([Bind("TranscationModeId,Transcation")] TranscationMode transcationMode)
        {
            if (ModelState.IsValid)
            {
                _context.Add(transcationMode);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(transcationMode));
        }
Example #26
0
        public async Task <IActionResult> Create([Bind("StoreId,StoreCode,StoreName,Address,City,PinCode,PhoneNo,StoreManagerName,StoreManagerPhoneNo,PanNo,GSTNO,NoOfEmployees,OpeningDate,ClosingDate,Status")] Store store)
        {
            if (ModelState.IsValid)
            {
                _context.Add(store);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(PartialView(store));
        }
Example #27
0
        public async Task <IActionResult> Create([Bind("SalesmanInfoId,SalesmanName,TotalSale,CurrentYear,CurrentMonth,LastMonth,LastYear,TotalBillCount,Average")] SalesmanInfo salesmanInfo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(salesmanInfo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(salesmanInfo));
        }
        public async Task <IActionResult> Create([Bind("RentedLocationId,PlaceName,Address,OnDate,VacatedDate,City,OwnerName,MobileNo,RentAmount,AdvanceAmount,IsRented,RentType,StoreId,UserId,IsReadOnly")] RentedLocation rentedLocation)
        {
            if (ModelState.IsValid)
            {
                _context.Add(rentedLocation);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["StoreId"] = new SelectList(_context.Stores, "StoreId", "StoreName", rentedLocation.StoreId);
            return(PartialView(rentedLocation));
        }
Example #29
0
        public async Task <IActionResult> Create([Bind("ElectricityConnectionId,LocationName,ConnectioName,City,State,PinCode,ConsumerNumber,ConusumerId,Connection,ConnectinDate,DisconnectionDate,KVLoad,OwnedMetter,TotalConnectionCharges,SecurityDeposit,Remarks,StoreId,UserId,IsReadOnly")] ElectricityConnection electricityConnection)
        {
            if (ModelState.IsValid)
            {
                _context.Add(electricityConnection);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["StoreId"] = new SelectList(_context.Stores, "StoreId", "StoreName", electricityConnection.StoreId);
            return(View(electricityConnection));
        }
Example #30
0
        public async Task <IActionResult> Create([Bind("CashInHandId,CIHDate,OpenningBalance,ClosingBalance,CashIn,CashOut,StoreId")] CashInHand cashInHand)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cashInHand);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["StoreId"] = new SelectList(_context.Stores, "StoreId", "StoreId", cashInHand.StoreId);
            return(View(cashInHand));
        }