public IHttpActionResult PutLabelCheck(int id, LabelCheck labelCheck) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != labelCheck.ProcessOrderNo) { return(BadRequest()); } db.Entry(labelCheck).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!LabelCheckExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PostLabelCheck(LabelCheck labelCheck) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.LabelChecks.Add(labelCheck); try { db.SaveChanges(); } catch (DbUpdateException) { if (LabelCheckExists(labelCheck.ProcessOrderNo)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = labelCheck.ProcessOrderNo }, labelCheck)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,CheckType,Num1,Num2,ConsiderStartTime,ConsiderEndTime,PspMeasurementId")] LabelCheck labelCheck) { if (id != labelCheck.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(labelCheck); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LabelCheckExists(labelCheck.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["PspMeasurementId"] = new SelectList(_context.PspDbMeasurements, "MeasId", "Label", labelCheck.PspMeasurementId); return(View(labelCheck)); }
public IHttpActionResult GetLabelCheck(int id) { LabelCheck labelCheck = db.LabelChecks.Find(id); if (labelCheck == null) { return(NotFound()); } return(Ok(labelCheck)); }
public async Task <IActionResult> Create([Bind("Id,CheckType,Num1,Num2,ConsiderStartTime,ConsiderEndTime,PspMeasurementId")] LabelCheck labelCheck) { if (ModelState.IsValid) { _context.Add(labelCheck); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["PspMeasurementId"] = new SelectList(_context.PspDbMeasurements, "MeasId", "Label", labelCheck.PspMeasurementId); return(View(labelCheck)); }
public IHttpActionResult DeleteLabelCheck(int id) { LabelCheck labelCheck = db.LabelChecks.Find(id); if (labelCheck == null) { return(NotFound()); } db.LabelChecks.Remove(labelCheck); db.SaveChanges(); return(Ok(labelCheck)); }
// //扫描条码 // private void txb_SerialNumber_KeyUp(object sender, KeyEventArgs e) { try { if (e.Key == System.Windows.Input.Key.Enter && txb_SerialNumber.IsFocused) { if (txb_W_BoxSN.IsEnabled || txb_BoxSN.IsEnabled) { My_MessageBox.My_MessageBox_Message("请扫描外箱箱号与外箱ASN编码!"); } else { Encasement _M_Encasement = new Encasement(); Maticsoft.BLL.SerialNumber _M_SerialNumber = new SerialNumber(); //条码是否属于此工单 if (!_M_SerialNumber.Exists_where("(OrderID = '" + txb_OrderID.Text.Trim() + "') AND (SN LIKE '" + txb_SerialNumber.Text.Trim() + "%')")) { My_MessageBox.My_MessageBox_Message("此条吗不属于此工单!"); } else { //条码是否已经检测通过 if (!_M_SerialNumber.Exists_where("(State = 'Yet_Pack') AND (SN LIKE '" + txb_SerialNumber.Text.Trim() + "%')")) { My_MessageBox.My_MessageBox_Message("此条码未经过出货检测!"); } else { //条码是否已经装箱 if (_M_Encasement.Exists_where("(SN = '" + txb_SerialNumber.Text.Trim() + "')")) { My_MessageBox.My_MessageBox_Message("此条码已经装箱!"); } else { Maticsoft.BLL.LabelCheck labcheck = new LabelCheck(); //条码是否已经检测标签 if (!labcheck.Exists(txb_SerialNumber.Text.Trim())) { My_MessageBox.My_MessageBox_Message("此条码未核对标签!"); } else { //赋值记录 Maticsoft.Model.Encasement _Encasement = new Maticsoft.Model.Encasement(); _Encasement.BoxID = _GTT_BoxInfo.ID.ToString(); _Encasement.SN = txb_SerialNumber.Text.Trim(); _Encasement.Qty = Info_SackQty.Text.Trim(); //保存记录 _M_Encasement.Add(_Encasement); //显示箱子已包装数量 txb_SackCount.Text = _M_Encasement.GetBoxCount("(BoxID = '" + _GTT_BoxInfo.ID + "')").ToString(); //在 ListBox 控件中显示 view.Source = _M_Encasement.GetModelList("(BoxID = '" + _GTT_BoxInfo.ID + "')"); lab_EncasementRecordCount.Text = lsv_SerialNumberList.Items.Count.ToString(); if (txb_SackCount.Text.Trim() == txb_BoxCount.Text.Trim()) { txb_SerialNumber.IsEnabled = false; } txb_SerialNumber.Text = ""; //批号装箱完成 Maticsoft.BLL.BoxInfo _M_BoxInfo = new Maticsoft.BLL.BoxInfo(); if (_M_BoxInfo.GetYetEncasementCount("tb_BoxInfo.BatchNo = '" + cmb_BatchNo.Text.Trim() + "'") >= int.Parse(txb_BatchCount.Text.Trim())) { My_MessageBox.My_MessageBox_Message("批号:" + cmb_BatchNo.Text.Trim() + "数量:" + txb_BatchCount.Text.Trim() + "\r\n线材扫描完毕,请继续装箱!"); txb_SerialNumber.IsEnabled = false; } } } } } } } } catch (System.Exception ex) { My_MessageBox.My_MessageBox_Message(ex.Message); } }
private void AddForm(string addForm) { switch (addForm) { case "login": panel1.Controls.Clear(); Login l = new Login(userType); panel1.Controls.Add(l); break; case "MainForm": panel1.Controls.Clear(); MainInfor mi = new MainInfor(userType); panel1.Controls.Add(mi); break; case "Label_Syn": panel1.Controls.Clear(); SynForm syn = new SynForm(userType); panel1.Controls.Add(syn); break; case "Label_Checking": panel1.Controls.Clear(); RevpreForm RF = new RevpreForm(userType); panel1.Controls.Add(RF); break; case "Label_Batch": panel1.Controls.Clear(); BatchForm bf = new BatchForm(userType); panel1.Controls.Add(bf); break; case "Label_print": panel1.Controls.Clear(); PrintForm pf = new PrintForm(userType); panel1.Controls.Add(pf); break; case "Label_Check": panel1.Controls.Clear(); LabelCheck lc = new LabelCheck(userType); panel1.Controls.Add(lc); break; case "Label_Tool": panel1.Controls.Clear(); ToolForm tf = new ToolForm(userType); panel1.Controls.Add(tf); break; case "BatchRule": panel1.Controls.Clear(); BatchRule br = new BatchRule(userType); panel1.Controls.Add(br); break; case "DrugHelp": panel1.Controls.Clear(); DrugHelp dh = new DrugHelp(userType); panel1.Controls.Add(dh); break; case "DwardHelp": panel1.Controls.Clear(); DwardHelp ddh = new DwardHelp(userType); panel1.Controls.Add(ddh); break; case "BaiYaoCheck": panel1.Controls.Clear(); BaiYao BY = new BaiYao(userType); panel1.Controls.Add(BY); break; case "PaiYaoCheck": panel1.Controls.Clear(); QiTa QT = new QiTa(userType); panel1.Controls.Add(QT); break; //case "CheckForm": // ChangeColor(label15.Text); // panel1.Controls.Clear(); // LabelCheck lc = new LabelCheck(); // panel1.Controls.Add(lc); // break; //case "ScanPreForm": // ChangeColor(label7.Text); // panel1.Controls.Clear(); // ScanPre spe = new ScanPre(); // panel1.Controls.Add(spe); // break; //case "LabelCXForm": // ChangeColor(label8.Text); // panel1.Controls.Clear(); // LabelCX lcx = new LabelCX(); // panel1.Controls.Add(lcx); // break; //case "ToolsForm": // ChangeColor(label5.Text); // Tool t = new Tool(); // panel1.Controls.Add(t); // break; //case "ProblemForm": // ChangeColor(label10.Text); // panel1.Controls.Clear(); // Problem pb = new Problem(); // panel1.Controls.Add(pb); // break; //case "EdtionForm": // ChangeColor(label9.Text); // panel1.Controls.Clear(); // Edition ed = new Edition(); // panel1.Controls.Add(ed); // break; default: break; } }