private void timer1_Tick(object sender, EventArgs e) { timer1.Stop(); OPCMessageEntity ent = OPCMessageFactory.GetMyMessage(); if (ent != null) { if (ent.MESSAGE_CODE == "sn") { if (!DealSn(ent.MESSAGE_VALUE)) { return; } } RMESEventArgs arg = new RMESEventArgs(); arg.MessageHead = ent.MESSAGE_CODE == "sn"?"SN":ent.MESSAGE_CODE; arg.MessageBody = ent.MESSAGE_VALUE; SendDataChangeMessage(arg); ent.MESSAGE_FLAG = "R"; OPCMessageFactory.UpdateMessage(ent); } timer1.Start(); }
public void UpdateMessage(OPCMessageEntity ent) { //if (db.Exists<OPCMessageEntity>(ent)) //{ db.Update(ent); //} //else //{ // db.Insert(ent); //} }
public static void UpdateMessage(OPCMessageEntity ent) { new OPCMessageDal().UpdateMessage(ent); }