public static void DeleteDataRefresh(string User, NittanDBcontext _context) { //get Token var UserToken = _context.UserTransaction.FirstOrDefault(x => x.UserName == User); if (UserToken != null) { var model = _context.isonite_temp.FirstOrDefault(item => item.user_create == User && item.Token == UserToken.Token); var sumTemp = _context.isonite_temp.Where(x => x.user_create == User).GroupBy(o => o.BarCode).Select(x => new { Barcode = x.Key, SumQty = x.Sum(i => i.QtyComplete + i.QtyNG) }).FirstOrDefault(); var isonite_line_temp = _context.Isonite_Line_Temp.Where(x => x.ModifyBy == User); if (isonite_line_temp != null) { _context.Isonite_Line_Temp.RemoveRange(isonite_line_temp); _context.SaveChanges(); } if (sumTemp != null) { var woRouting = _context.WoRouting.FirstOrDefault(item => item.BarCode == sumTemp.Barcode && item.ProcessCode == "ISONITE"); woRouting.QTYinProcess = woRouting.QTYinProcess - sumTemp.SumQty; _context.SaveChanges(); } if (model != null) { _context.isonite_temp.Remove(model); _context.SaveChanges(); } else { var model_1 = _context.isonite_temp.Where(item => item.user_create == User); _context.isonite_temp.RemoveRange(model_1); _context.SaveChanges(); } } }
public MenuController(NittanDBcontext db) { this.db = db; }
public IsoniteGetJigController(NittanDBcontext db) { this.Db = db; }
public PrintFGMovementController(NittanDBcontext context) { _context = context; }
public TagCard5TypeController(NittanDBcontext context) { this._context = context; }
public VW_MFC_Isonite_SummaryController(NittanDBcontext context) { this._Context = context; }
public PrintProduction1Controller(NittanDBcontext context) { _context = context; }
public static bool Log_Print(string RowNumber, string string_process, string token, string username, NittanDBcontext _context) { var Log_Select_Print = _context.Log_Select_Print.Where(w => w.opt == string_process); var flag = false; if (RowNumber != null) { flag = true; if (Log_Select_Print.Count() > 0) { var oldipaddress = Log_Select_Print.Where(w => w.opt == string_process && w.username == username); if (oldipaddress.Count() > 0) { var pp_update = _context.Log_Select_Print.FirstOrDefault(f => f.opt == string_process && f.username == username); pp_update.name = RowNumber; pp_update.token = token; pp_update.username = username; _context.Log_Select_Print.Update(pp_update); } else { var pp_insert = new Log_Select_Print { opt = string_process, name = RowNumber, token = token, username = username }; _context.Log_Select_Print.Add(pp_insert); } _context.SaveChanges(); } else { var pp_insert = new Log_Select_Print { opt = string_process, name = RowNumber, token = token, username = username }; _context.Log_Select_Print.Add(pp_insert); _context.SaveChanges(); } } return(flag); }
public IsoniteController(NittanDBcontext context) { _context = context; }
public ForgotPassWordController(NittanDBcontext context, IEmailService emailService) { this._Context = context; this._emailService = emailService; }
public m_BOMController(NittanDBcontext context) { this._context = context; }
public GridVW_MFC_WIPAdjustController(NittanDBcontext context) { this._context = context; }
public PrintDCWIPbyProcessController(NittanDBcontext context) { _context = context; }
public GridFGMovementController(NittanDBcontext context) { this._context = context; }
public WipMovementController(NittanDBcontext context) { _context = context; }
public LoginController(NittanDBcontext context) { _context = context; }
public RoutingLookupController(NittanDBcontext Db) { this.Db = Db; }
public PrintWIPStatusController(NittanDBcontext context) { _context = context; }
public GridWIPStatusController(NittanDBcontext context) { this._context = context; }
public GirdInspectionResultController(NittanDBcontext context) { this._context = context; }
public ResetPasswordController(NittanDBcontext context) { this.context = context; }
public UserMasterTestprintController(NittanDBcontext context) { _context = context; }
public DCWIPbyProcessRealtimeController(NittanDBcontext context) { _context = context; }
public DCWIPbyShiftHistoryController(NittanDBcontext context) { _context = context; }
public ProcessMasterController(NittanDBcontext context) { _context = context; }
public m_BPMasterController(NittanDBcontext context) { this._context = context; }
public WIPProcessBalanceController(NittanDBcontext context) { _context = context; }
public DCWIPbyProcessHistoryController(NittanDBcontext context) { _context = context; }
public GridDCWIPbyProcessHController(NittanDBcontext context) { this._context = context; }
public ImageUploadController(NittanDBcontext db, IHostingEnvironment appEnvironment) { this.Db = db; this._appEnvironment = appEnvironment; }