public static void oEdiDoc_EventNotify(ediEventNotify EventNotify) { EDIModel.ErrorMessage error = new ErrorMessage(); if (EventNotify.Severity == EventIDConstants.Event_Warning) { Int64 MemberID= dbAccess.GetMemberID(); error.ErrCode = EventNotify.ErrorCode; error.ErrDesc = EventNotify.ErrorDescription.Replace('\'', '"'); dbAccess.insertNewErrorMessage(error, MemberID); } }
public int insertNewErrorMessage(ErrorMessage msg_error, Int64 MemberID) { Database db = new Database(); SqlParameter[] param = { db.MakeInParam("@MemeberID",SqlDbType.BigInt,0,MemberID), db.MakeInParam("@ErrorCode",SqlDbType.VarChar,200,msg_error.ErrCode), db.MakeInParam("@ErrorMessage",SqlDbType.VarChar,850,msg_error.ErrDesc) }; try { db.execNonQuery("EDI_Message_Error_Add", param); db.Close(); return 0; } catch (Exception ex) { if (db.IsOpen() == "Open") db.Close(); log.writeToAppLog("ERROR", "Unable to insert the message error .\r\n" + ex.ToString(), "", ""); throw new Exception(ex.ToString()); } }