/// <summary> /// 提交到数据库,插入ProductFinish表 /// </summary> /// <param name="productNr"></param> /// <param name="partNr"></param> /// <returns></returns> public Message Commit(string productNr, string partNr) { //ProductFinishDataContext context = new ProductFinishDataContext(); try { ProductFinish productFinish = new ProductFinish(); productFinish.productnr = productNr; productFinish.partNr = partNr; productFinish.status = 2000; productFinish.finishTime = DateTime.Now; context.ProductFinish.InsertOnSubmit(productFinish); //context.SubmitChanges(); MPS mps = new MPS(); mps.partnr = partNr; mps.orderedDate = DateTime.Now; mps.requiredDate = DateTime.Now; mps.quantity = 1; mps.source = "KSK"; mps.sourceDoc = "KSK"; mps.status = 2000; mps.unitId = null; context.MPS.InsertOnSubmit(mps); context.SubmitChanges(); return(new Message(true, "添加成功!")); } catch (SqlException e) { //MessageBox.Show(e.Message); return(new Message(false, "异常信息:" + e.Message)); } }
internal string Actual(SpeedParameter windParameter) { switch (windParameter) { case SpeedParameter.KMPH: return(KMPH.ToString("0.#")); case SpeedParameter.MPS: return(MPS.ToString("0.#")); case SpeedParameter.Knot: return(Knot.ToString("0.#")); default: return(KMPH.ToString("0.#")); } }
static void getMPSCaller() { MPS mps = new MPS(); //mps.getMPS(conn, _queue, _signal); }