public async Task <IActionResult> Create([Bind("Id,Name,Surname,Explanation")] Salary salary)
        {
            if (ModelState.IsValid)
            {
                _context.Add(salary);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(salary));
        }
        public async Task <IActionResult> Create([Bind("Id,Defenition")] ObjectType objectType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(objectType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(objectType));
        }
        public async Task <IActionResult> Create([Bind("Id,Number,Address")] Building building)
        {
            if (ModelState.IsValid)
            {
                _context.Add(building);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(building));
        }
        public async Task <IActionResult> Create([Bind("Id,Username,Password,IsAdmin")] Users users)
        {
            if (ModelState.IsValid)
            {
                _context.Add(users);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(users));
        }
示例#5
0
        public async Task <IActionResult> Create([Bind("Id,Amount,CreatedDate,PaymentDate,Explanation,Explanation2,Explanation3,ContractId,Customer,Cash,CostTypDefenition,IncomeTypeDefenition,TransactionTypDefenition,SupportTypDefenition,Number,CustDocno,SignTypeId,SignTypeDefenition,CashId,TransactionTypeId,CustomersId,CostTypeId,SupportTypeId,ObjectsId,PaymentsId,IncomeTypeId")] PaymentTransactions paymentTransactions)
        {
            if (ModelState.IsValid)
            {
                _context.Add(paymentTransactions);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(paymentTransactions));
        }
示例#6
0
        public async Task <IActionResult> Create([Bind("Id,Defenition,Number")] Permission permission)
        {
            if (ModelState.IsValid)
            {
                _context.Add(permission);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(permission));
        }
示例#7
0
        public async Task <IActionResult> Create([Bind("Id,ContractDetailId,SupportTypeId,ObjectsId,Amount,SpDefenition,ObjNumber,CustomersId,MonthDept")] PaymentsList paymentsList)
        {
            if (ModelState.IsValid)
            {
                _context.Add(paymentsList);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(paymentsList));
        }
        public async Task <IActionResult> Create([Bind("Id,Amount,CustomersId,ContractDetailId,ContractId,ObjectsId,SupportTypeDefenition,Customer,PaymentDate,Reason,CreateDate,Pdid")] GetPaymentDuration getPaymentDuration)
        {
            if (ModelState.IsValid)
            {
                _context.Add(getPaymentDuration);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(getPaymentDuration));
        }
        public async Task <IActionResult> Create([Bind("Id,Number,Defenition")] Cash cash)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cash);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(cash));
        }
示例#10
0
        public async Task <IActionResult> Create([Bind("Id,CustomersId,PaymentDate,Notes")] Contract contract)
        {
            if (ModelState.IsValid)
            {
                _context.Add(contract);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CustomersId"] = new SelectList(_context.Set <Customers>(), "Id", "DocNumber", contract.CustomersId);
            return(View(contract));
        }
示例#11
0
        public async Task <IActionResult> Create([Bind("Id,Name,Surname,Phone,Email,DocNumber,CustomerTypeId,CreatedDate")] Customers customers)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customers);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CustomerTypeId"] = new SelectList(_context.Set <CustomerType>(), "Id", "Defenition", customers.CustomerTypeId);
            return(View(customers));
        }
        public async Task <IActionResult> Create([Bind("Id,ContractDetailId,PaymentDate,Reason,CreateDate")] PaymentDuration paymentDuration)
        {
            if (ModelState.IsValid)
            {
                _context.Add(paymentDuration);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ContractDetailId"] = new SelectList(_context.ContractDetail, "Id", "Id", paymentDuration.ContractDetailId);
            return(View(paymentDuration));
        }
        public async Task <IActionResult> Create([Bind("Id,Porch,Floor,Number,Squares,BuildingId,ObjectTypeId")] Objects objects)
        {
            if (ModelState.IsValid)
            {
                _context.Add(objects);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BuildingId"]   = new SelectList(_context.Building, "Id", "Address", objects.BuildingId);
            ViewData["ObjectTypeId"] = new SelectList(_context.Set <ObjectType>(), "Id", "Defenition", objects.ObjectTypeId);
            return(View(objects));
        }
        public async Task <IActionResult> Create([Bind("Id,UserId,PermissionId,Acces")] UserPermissions userPermissions)
        {
            if (ModelState.IsValid)
            {
                _context.Add(userPermissions);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PermissionId"] = new SelectList(_context.Permission, "Id", "Id", userPermissions.PermissionId);
            ViewData["UserId"]       = new SelectList(_context.Set <Users>(), "Id", "Password", userPermissions.UserId);
            return(View(userPermissions));
        }
        public async Task <IActionResult> Create([Bind("Id,ContractId,SupportTypeId,ServicePrice,ObjectsId")] ContractDetail contractDetail)
        {
            if (ModelState.IsValid)
            {
                _context.Add(contractDetail);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ContractId"]    = new SelectList(_context.Contract, "Id", "Id", contractDetail.ContractId);
            ViewData["ObjectsId"]     = new SelectList(_context.Set <Objects>(), "Id", "Floor", contractDetail.ObjectsId);
            ViewData["SupportTypeId"] = new SelectList(_context.Set <SupportType>(), "Id", "Defenition", contractDetail.SupportTypeId);
            return(View(contractDetail));
        }
        public async Task <IActionResult> PaymentCreate([Bind("Id,Amount,Explanation,TransactionTypeId,SignTypeId,CashId,CostTypeId,ContractDetailId")] Payments payments)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    payments.SignTypeId        = 1;
                    payments.TransactionTypeId = 1;

                    _context.Add(payments);
                    await _context.SaveChangesAsync();

                    //return RedirectToAction(nameof(PaymentDetail));
                    return(RedirectToAction("PaymentDetail", "Payments", new { Id = payments.Id }));
                }
                ViewData["CashId"]            = new SelectList(_context.Cash, "Id", "Id", payments.CashId);
                ViewData["ContractDetailId"]  = new SelectList(_context.ContractDetail, "Id", "Id", payments.ContractDetailId);
                ViewData["SignTypeId"]        = new SelectList(_context.SignType, "Id", "Id", payments.SignTypeId);
                ViewData["TransactionTypeId"] = new SelectList(_context.TransactionType, "Id", "Id", payments.TransactionTypeId);
                //return View(payments);
            }
            catch (Exception ex)
            {
            }
            return(View(payments));
        }