예제 #1
0
        public async Task <IActionResult> Create([Bind("ProductId,AssociateId,ApplicationNumber,DateFunded,BorrowerName,TransactionType,ProductDescription,Term,MortgageAmount,TotalFileCommissions,CreatedDate,CreatedBy,LastUpdateDate,LastUpdatedBy")] Product product)
        {
            if (ModelState.IsValid)
            {
                _context.Add(product);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AssociateId"] = new SelectList(_context.Associates, "AssociateId", "AssociateLastName", product.AssociateId);
            return(View(product));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("AssociateCommissionId,AssociateId,AssociateCommission1,EffectiveDate,CreatedDate,CreatedBy,LastUpdateDate,LastUpdatedBy,CommissionSplitId")] AssociateCommission associateCommission)
        {
            if (ModelState.IsValid)
            {
                _context.Add(associateCommission);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AssociateId"]       = new SelectList(_context.Associates, "AssociateId", "AssociateLastName", associateCommission.AssociateId);
            ViewData["CommissionSplitId"] = new SelectList(_context.CommissionSplits, "CommissionSplitId", "AssociateSplitPortion", associateCommission.CommissionSplitId);
            return(View(associateCommission));
        }
예제 #3
0
        public async Task <IActionResult> Create([Bind("CommissionsPaidId,DatePaid,CommissionType,PaymentType,ChequeNumber,CreatedDate,CreatedBy,LastUpdateDate,LastUpdatedBy")] CommissionsPaid commissionsPaid, [Bind("ProductId,AssociateId,ApplicationNumber,DateFunded,BorrowerName,TransactionType,ProductDescription,Term,MortgageAmount,TotalFileCommissions,CreatedDate,CreatedBy,LastUpdateDate,LastUpdatedBy")] Product product)
        {
            if (ModelState.IsValid)
            {
                _context.Add(product);
                _context.Add(commissionsPaid);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            return(View(commissionsPaid));
        }
예제 #4
0
        public async Task <IActionResult> Create([Bind("AssociateId,AssociateFirstName,AssociateLastName,Company,SplitId")] Associate associate, [Bind("CommissionSplitId,AssociateSplitPortion")] CommissionSplit commissionSplit)
        {
            if (ModelState.IsValid)
            {
                _context.Add(associate);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }


            return(View(associate));
        }
예제 #5
0
        public async Task <IActionResult> Create([Bind("CommissionsPaidProductId,CommissionsPaidId,ProductId,Commission,CreatedDate,CreatedBy,LastUpdateDate,LastUpdatedBy,AssociateId, AssociateFirstName, AssociateLastName, Company, DateOfPayment, SplitId")] CommissionsPaidProduct commissionsPaidProduct)
        {
            if (ModelState.IsValid)
            {
                _context.CommissionsPaidProducts.FromSqlRaw("SET IDENTITY_INSERT CommissionsPaidProductID ON");
                _context.Add(commissionsPaidProduct);

                _context.CommissionsPaidProducts.FromSqlRaw("SET IDENTITY_INSERT CommissionsPaidProductID OFF");
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CommissionsPaidId"] = new SelectList(_context.CommissionsPaids, "CommissionsPaidId", "CommissionsPaidId", commissionsPaidProduct.CommissionsPaidId);
            ViewData["ProductId"]         = new SelectList(_context.Products, "ProductId", "ProductId", commissionsPaidProduct.ProductId);
            ViewData["AssociateId"]       = new SelectList(_context.Associates, "AssociateId", "ProductId", commissionsPaidProduct.ProductId);
            return(View(commissionsPaidProduct));
        }