public ActionResult DeleteConfirmed(DateTime id) { TAXREPORT tAXREPORT = db.TAXREPORTs.Find(id); db.TAXREPORTs.Remove(tAXREPORT); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Month,EmployeeID,TotalIncome,FreeTax,Deduction,OverTimeHour,OverTimeFreeTax,TaxableIncome,IncomeTax")] TAXREPORT tAXREPORT) { if (ModelState.IsValid) { db.Entry(tAXREPORT).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmployeeID = new SelectList(db.EMPLOYEEs, "EmployeeID", "EmployeeName", tAXREPORT.EmployeeID); return(View(tAXREPORT)); }
// GET: TAXREPORTs/Delete/5 public ActionResult Delete(DateTime id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TAXREPORT tAXREPORT = db.TAXREPORTs.Find(id); if (tAXREPORT == null) { return(HttpNotFound()); } return(View(tAXREPORT)); }
// GET: TAXREPORTs/Details/5 public ActionResult Details(string id, DateTime month) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TAXREPORT tAXREPORT = db.TAXREPORTs.Find(month, id); if (tAXREPORT == null) { return(HttpNotFound()); } return(View(tAXREPORT)); }
// GET: TAXREPORTs/Edit/5 public ActionResult Edit(DateTime id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TAXREPORT tAXREPORT = db.TAXREPORTs.Find(id); if (tAXREPORT == null) { return(HttpNotFound()); } ViewBag.EmployeeID = new SelectList(db.EMPLOYEEs, "EmployeeID", "EmployeeName", tAXREPORT.EmployeeID); return(View(tAXREPORT)); }
// GET: TAXREPORTs public ActionResult Index() { Session["MainTitle"] = "Báo cáo tiền lương"; Session["SubTitle"] = "Thuế TNCN"; DateTime date = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1, 0, 0, 0); //var tAXREPORTs = db.TAXREPORTs.Include(t => t.EMPLOYEE); var employeelist = db.EMPLOYEEs.Where(x => x.State == true).ToList(); foreach (EMPLOYEE e in employeelist) { if (db.TAXREPORTs.Count(x => x.EmployeeID == e.EmployeeID && x.Month == date) == 0) { var tAXREPORT = new TAXREPORT { EmployeeID = e.EmployeeID, EMPLOYEE = e, Month = date, StandardSalary = CalculateStandardSalary(e, date), SelfDeduction = (int)db.PARAMETERs.Find("MucGiamTruBanThan").Value, DependentDeduction = (int)db.PARAMETERs.Find("MucGiamTruNguoiPhuThuoc").Value *e.DependentDeduction + CalculateTotalInsurancePay(e, date), OverTimeHour = CalculateTotalWorkHour(e, date), TaxableOverTime = CalculateTaxableOvertimeSalary(e, date), TaxableIncome = CalculateTaxableIncome(e, date), AssessableIncome = CalculateAssessableIncome(e, date), TotalInsurancePay = CalculateTotalInsurancePay(e, date), IncomeTax = CalculateIncomeTax(e, date) }; db.TAXREPORTs.Add(tAXREPORT); db.SaveChanges(); } else { continue; } } return(View(db.TAXREPORTs.ToList())); }