public FM_Disbursement_CheckInventory() { getCheckInventoryType = new List <CheckInventoryTable>(); getCheckInventorycolumns = new CheckInventoryTable(); getCheckInventoryList = new List <CheckInventoryList>(); globalClasses = new GlobalClasses(); }
//Add Check Maintenance public JsonResult AddCheckMaintenance(FM_Disbursement_CheckMaintenance model) { CheckMaintenanceTable tblCheckMaintenance = new CheckMaintenanceTable(); tblCheckMaintenance.CheckInvntID = model.CheckMaintenanceInventoryID; tblCheckMaintenance.DateIssued = model.getCheckMaintenancecolumns.DateIssued; tblCheckMaintenance.ConsumedValue = model.CheckMaintenanceQuantityID; TOSSDB.CheckMaintenanceTables.Add(tblCheckMaintenance); TOSSDB.SaveChanges(); CheckInventoryTable tblAccountablechkInventory = (from e in TOSSDB.CheckInventoryTables where e.CheckInvntID == model.CheckMaintenanceInventoryID select e).FirstOrDefault(); if (tblAccountablechkInventory.IsIssued == false) { tblAccountablechkInventory.IsIssued = true; } else { tblAccountablechkInventory.IsIssued = false; } TOSSDB.Entry(tblAccountablechkInventory); TOSSDB.SaveChanges(); return(Json("")); }
//Delete DVType public ActionResult DeleteCheckInventory(FM_Disbursement_CheckInventory model, int CheckInvntID) { CheckInventoryTable tblCheckIventory = (from e in TOSSDB.CheckInventoryTables where e.CheckInvntID == CheckInvntID select e).FirstOrDefault(); TOSSDB.CheckInventoryTables.Remove(tblCheckIventory); TOSSDB.SaveChanges(); return(RedirectToAction("Index")); }
//Update DVType public ActionResult UpdateCheckInventory(FM_Disbursement_CheckInventory model) { CheckInventoryTable tblCheckIventory = (from e in TOSSDB.CheckInventoryTables where e.CheckInvntID == model.getCheckInventorycolumns.CheckInvntID select e).FirstOrDefault(); tblCheckIventory.BankAccountID = model.CheckInventoryAccountNameID; tblCheckIventory.Quantity = model.getCheckInventorycolumns.Quantity; tblCheckIventory.StartingChckNo = model.getCheckInventorycolumns.StartingChckNo; tblCheckIventory.EndingChckNo = model.getCheckInventorycolumns.EndingChckNo; tblCheckIventory.DateIssued = model.getCheckInventorycolumns.DateIssued; TOSSDB.Entry(tblCheckIventory); TOSSDB.SaveChanges(); return(PartialView("CheckInventory/_UpdateCheckInventory", model)); }
//Get Update DVType public ActionResult Get_UpdateCheckInventory(FM_Disbursement_CheckInventory model, int CheckInvntID) { CheckInventoryTable tblCheckIventory = (from e in TOSSDB.CheckInventoryTables where e.CheckInvntID == CheckInvntID select e).FirstOrDefault(); model.getCheckInventorycolumns.CheckInvntID = tblCheckIventory.CheckInvntID; model.CheckInventoryBankTempID = tblCheckIventory.BankAccountTable.BankID; model.CheckInventoryAccountNameTempID = tblCheckIventory.BankAccountID; model.getCheckInventorycolumns.Quantity = tblCheckIventory.Quantity; model.getCheckInventorycolumns.StartingChckNo = tblCheckIventory.StartingChckNo; model.getCheckInventorycolumns.EndingChckNo = tblCheckIventory.EndingChckNo; model.getCheckInventorycolumns.DateIssued = tblCheckIventory.DateIssued; return(PartialView("CheckInventory/_UpdateCheckInventory", model)); }
//Add DVType public JsonResult AddCheckInventory(FM_Disbursement_CheckInventory model) { CheckInventoryTable tblCheckInventory = new CheckInventoryTable(); tblCheckInventory.BankAccountID = model.CheckInventoryAccountNameID; tblCheckInventory.Quantity = model.getCheckInventorycolumns.Quantity; tblCheckInventory.StartingChckNo = model.getCheckInventorycolumns.StartingChckNo; tblCheckInventory.EndingChckNo = model.getCheckInventorycolumns.EndingChckNo; tblCheckInventory.DateIssued = model.getCheckInventorycolumns.DateIssued; tblCheckInventory.IsIssued = false; TOSSDB.CheckInventoryTables.Add(tblCheckInventory); TOSSDB.SaveChanges(); return(Json(tblCheckInventory)); }
public ActionResult Get_CheckMaintenanceQuantyNEnd(int StartingChckNo) { FM_Disbursement_CheckMaintenance model = new FM_Disbursement_CheckMaintenance(); CheckInventoryTable tblCheckIventory = (from e in TOSSDB.CheckInventoryTables where e.StartingChckNo == StartingChckNo select e).FirstOrDefault(); if (tblCheckIventory != null) { model.CheckMaintenanceEndingNoID = tblCheckIventory.EndingChckNo; model.CheckMaintenanceQuantityID = tblCheckIventory.Quantity; } return(PartialView("CheckMaintenance/_DynamicTBQuantyNEndNo", model)); }
//Update Check Maintenance //Delete Check Maintenance public ActionResult DeleteCheckMaintenance(FM_Disbursement_CheckMaintenance model, int CheckMainteID) { CheckMaintenanceTable tblCheckMaintenance = (from e in TOSSDB.CheckMaintenanceTables where e.CheckMainteID == CheckMainteID select e).FirstOrDefault(); TOSSDB.CheckMaintenanceTables.Remove(tblCheckMaintenance); TOSSDB.SaveChanges(); CheckInventoryTable tblAccountablechkInventory = (from e in TOSSDB.CheckInventoryTables where e.IsIssued == true select e).FirstOrDefault(); if (tblAccountablechkInventory.IsIssued == true) { tblAccountablechkInventory.IsIssued = false; } else { tblAccountablechkInventory.IsIssued = true; } TOSSDB.Entry(tblAccountablechkInventory); TOSSDB.SaveChanges(); return(RedirectToAction("Index")); }