public async Task <IActionResult> Edit(int id, [Bind("OcId,Date,ElectricityBillMonthName,ElectricityBillAmount,WaterBillMonth,WaterBillAmount,ItBill,FunctionCost,ScienceFairCost,StudyTourCost,PoorFund,SchoolDev,SchoolMaintenance,ServicingCharge,AnyCostName,AnyCostFee")] OtherCostInfo otherCostInfo) { if (id != otherCostInfo.OcId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(otherCostInfo); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OtherCostInfoExists(otherCostInfo.OcId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(otherCostInfo)); }
public async Task <IActionResult> Create([Bind("OcId,Date,ElectricityBillMonthName,ElectricityBillAmount,WaterBillMonth,WaterBillAmount,ItBill,FunctionCost,ScienceFairCost,StudyTourCost,PoorFund,SchoolDev,SchoolMaintenance,ServicingCharge,AnyCostName,AnyCostFee")] OtherCostInfo otherCostInfo) { if (ModelState.IsValid) { _context.Add(otherCostInfo); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(otherCostInfo)); }