public ActionResult Delete(long id) { var task = _context.ScheduleMaintenanceTbl.Find(id); _context.ScheduleMaintenanceTbl.Remove(task); _context.SaveChanges(); return(Json(new { success = true })); }
public ActionResult DeleteScheParts(long id) { var taskline = _context.WoRequestSpartpartLineTbl.Find(id); _context.WoRequestSpartpartLineTbl.Remove(taskline); _context.SaveChanges(); return(Json(new { success = true })); }
public async Task <IActionResult> Run(long id, WoExeAndWoExeTask woexe) { if (id != woexe.WoExecution.Id) { return(NotFound()); } if (ModelState.IsValid) { woexe.WoExecution.Status = "Complete"; _db.Update(woexe.WoExecution); _db.SaveChanges(); return(RedirectToAction(nameof(Index))); } return(View(woexe)); }
public ActionResult Delete(long id) { var sparepart = _db.AssetGroupTbl.Find(id); _db.AssetGroupTbl.Remove(sparepart); _db.SaveChanges(); return(Json(new { success = true })); }
public ActionResult Delete(long id) { var sparepart = _context.EntityTbl.Find(id); _context.EntityTbl.Remove(sparepart); _context.SaveChanges(); return(Json(new { success = true })); }
public async Task <IActionResult> Edit(long id, PeriodTbl period) { // var create = _db.SiteMasterTbl.Where(m => m.SiteId == siteMaster.SiteId).First().CreatedAtSite; if (id != period.PeriodId) { return(NotFound()); } if (ModelState.IsValid) { // //siteMaster.CreatedAtSite = create; period.ModifyAtPeriod = DateTime.Now; _db.Update(period); _db.SaveChanges(); return(RedirectToAction(nameof(Index))); } return(View(period)); }
public async Task <IActionResult> Edit(long id, SparepartTbl sparepart) { // var create = _db.SiteMasterTbl.Where(m => m.SiteId == siteMaster.SiteId).First().CreatedAtSite; if (id != sparepart.SparepartId) { return(NotFound()); } if (ModelState.IsValid) { // //siteMaster.CreatedAtSite = create; sparepart.ModifyAtSupp = DateTime.Now; _db.Update(sparepart); _db.SaveChanges(); return(RedirectToAction(nameof(Index))); } return(View(sparepart)); }
public ActionResult UpdateCustomer(List <string> listkey) { var t = listkey; string quant = t[0]; string spares = t[1]; string aidi = t[2]; string woaidi = t[3]; //WoExeSparepartTbl woExe = _context.WoExeSparepartTbl.Where(x => x.WoExeId == Convert.ToInt64(aidi) && x.SparepartCode == spares).First(); //woExe.Quantity = Convert.ToInt32(quant); //_context.Update(woExe); //_context.SaveChanges(); SparepartRequestLinesTbl spas = _context.SparepartRequestLinesTbl.Where(x => x.SprId == Convert.ToInt64(aidi) && x.SparepartCode == spares).First(); spas.Quantity = Convert.ToInt32(quant); _context.Update(spas); _context.SaveChanges(); return(new EmptyResult()); }
public async Task <IActionResult> Edit(long id, WorkOrderTbl workOrder) { if (id != workOrder.WoId) { return(NotFound()); } //var a = Convert.ToBoolean(workOrder.SparepartActive); //var b = ""; //if (a == true) //{ // b = "Active"; //} //else //{ // b = "Non Active"; //} if (ModelState.IsValid) { // var checkmainid = _db.WorkOrderTbl.Where(x => x.WoId == id).First(); workOrder.MaentenanceId = _db.WorkOrderTbl.AsNoTracking().Where(x => x.WoId == id).First().MaentenanceId; workOrder.RequestId = _db.WorkOrderTbl.AsNoTracking().Where(x => x.WoId == id).First().RequestId; //workOrder.SparepartActive = b; //_db.Add(workOrder); //await _db.SaveChangesAsync(); _db.Update(workOrder); _db.SaveChanges(); return(RedirectToAction(nameof(Index))); } return(View(workOrder)); }