예제 #1
0
        public ActionResult Delete(long id)
        {
            var task = _context.ScheduleMaintenanceTbl.Find(id);

            _context.ScheduleMaintenanceTbl.Remove(task);
            _context.SaveChanges();

            return(Json(new { success = true }));
        }
예제 #2
0
        public ActionResult DeleteScheParts(long id)
        {
            var taskline = _context.WoRequestSpartpartLineTbl.Find(id);

            _context.WoRequestSpartpartLineTbl.Remove(taskline);
            _context.SaveChanges();

            return(Json(new { success = true }));
        }
예제 #3
0
        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));
        }
예제 #4
0
        public ActionResult Delete(long id)
        {
            var sparepart = _db.AssetGroupTbl.Find(id);

            _db.AssetGroupTbl.Remove(sparepart);
            _db.SaveChanges();

            return(Json(new { success = true }));
        }
예제 #5
0
        public ActionResult Delete(long id)
        {
            var sparepart = _context.EntityTbl.Find(id);

            _context.EntityTbl.Remove(sparepart);
            _context.SaveChanges();

            return(Json(new { success = true }));
        }
예제 #6
0
 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));
 }
예제 #7
0
 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));
 }
예제 #8
0
        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());
        }
예제 #9
0
        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));
        }